Package org.openide.windows

Examples of org.openide.windows.TopComponent


* @author markiewb
*/
class PathUtil {

    public String getPath(ShowPathInTitleOptions options) {
  TopComponent activeTC = null;
  if (options.useNodeAsReference) {
      activeTC = TopComponent.getRegistry().getActivated();
  }
  if (options.useEditorAsReference) {
      activeTC = getCurrentEditor();
  }

  if (null == activeTC) {
      return null;
  }

  DataObject dataObject = activeTC.getLookup().lookup(DataObject.class);
  Project project = activeTC.getLookup().lookup(Project.class);
  Node node = activeTC.getLookup().lookup(Node.class);
  FileObject fileObject = activeTC.getLookup().lookup(FileObject.class);
  //                showInStatusBar(project);

  String projectName = null;
  String projectDir = null;
  String fileName = null;
View Full Code Here


        super(NbBundle.getMessage(OracleAction.class, "CTL_OracleAction"));
        putValue(SMALL_ICON, new ImageIcon(ImageUtilities.loadImage(OracleTopComponent.ICON_PATH, true)));
    }

    public void actionPerformed(ActionEvent evt) {
        TopComponent win = OracleTopComponent.findInstance();
        win.open();
        win.requestActive();
    }
View Full Code Here

    /**
     * Obtain the OracleTopComponent instance. Never call {@link #getDefault} directly!
     */
    public static synchronized OracleTopComponent findInstance() {
        TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
        if (win == null) {
            Logger.getLogger(OracleTopComponent.class.getName()).warning(
                    NbBundle.getMessage(Utils.getCommonClass(), "LBL_OracleTopComponentWarning1", PREFERRED_ID));
            return getDefault();
        }
View Full Code Here

    public void execute() throws BuildException {
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                TopComponent taw;
                if (null == name || name.startsWith("${")) {
                    taw = new SipAgentMainWindow(1);
                } else {
                    taw = SipAgentMainWindow.get(name);
                }
                taw.requestActive();
            }
        });
    }
View Full Code Here

        open();
    }
   
    static public SipAgentMainWindow get(String name) {
        // search and create
        TopComponent retVal = WindowManager.getDefault().findTopComponent(name);
        if (null == retVal || !(retVal instanceof SipAgentMainWindow)) {
            retVal = new SipAgentMainWindow(name);
        }
        return (SipAgentMainWindow) retVal;
    }
View Full Code Here

        }
        return null;
    }

    protected FileObject getPrimaryFile() {
        TopComponent activatedTC = TopComponent .getRegistry().getActivated();
        if(activatedTC == null)
            return null;
        DataObject activeFile = activatedTC.getLookup().lookup(DataObject.class);
        if(activeFile == null)
            return null;

        return activeFile.getPrimaryFile();
    }
View Full Code Here

  private TopComponent w;

  public SimulatorUtility() {
    f = new PlotPanel();
    w = new TopComponent();
                w.setDisplayName("Simulator");
                w.setLayout(new BorderLayout());
    w.add(f.getPanel(), BorderLayout.CENTER);
                Mode outPutMode = WindowManager.getDefault().findMode("output");
                outPutMode.dockInto(w);
View Full Code Here

    /**
     * Obtain the RosaryUITopComponent instance. Never call {@link #getDefault} directly!
     */
    public static synchronized RosaryUITopComponent findInstance() {
        TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
        if (win == null) {
            Logger.getLogger(RosaryUITopComponent.class.getName()).warning(
                    "Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system.");
            return getDefault();
        }
View Full Code Here

    /**
     * Obtain the LyExplorerTopComponent instance. Never call {@link #getDefault} directly!
     */
    public static synchronized LyExplorerTopComponent findInstance() {
        TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
        if (win == null) {
            Logger.getLogger(LyExplorerTopComponent.class.getName()).warning(
                    "Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system.");
            return getDefault();
        }
View Full Code Here

        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                Iterator it = TopComponent.getRegistry().getOpened().iterator();
                while (it.hasNext()) {
                    TopComponent tc = (TopComponent) it.next();
                    EditorCookie ec = tc.getLookup().lookup(EditorCookie.class);
                    if (ec == null) {
                        continue;
                    }
                    JEditorPane[] eps = ec.getOpenedPanes();
                    if (eps == null) {
View Full Code Here

TOP

Related Classes of org.openide.windows.TopComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.