/** Indicates whether this <code>TopComponent</code> is opened. * @return true if given top component is opened, false otherwise */ public final boolean isOpened () { return isOpened(null); }
/** Indicates whether this <code>TopComponent</code> is opened. * @return true if given top component is opened, false otherwise */ public final boolean isOpened () { return isOpened(null); }
/** This method is called when this <code>TopComponent</code> is about to close. * Allows subclasses to decide if <code>TopComponent</code> is ready to close. * @since 4.13 */ public boolean canClose() { if(!isOpened()) { return false; } return canClose(null, true); }
/** This method is called when this <code>TopComponent</code> is about to close. * Allows subclasses to decide if <code>TopComponent</code> is ready to close. * @since 4.13 */ public boolean canClose() { if(!isOpened()) { return false; } return canClose(null, true); }
public static boolean isComponentOpened(String viewName) { TopComponent view = WindowManager.getDefault().findTopComponent(viewName); if (view == null) { throw new IllegalArgumentException(viewName); } return view.isOpened(); }
public void openAndRequestActive() { if (!topComponent.isOpened()) { topComponent.open(); } topComponent.requestActive(); }
@Override public void performAction() { TopComponent tc = ClassViewTopComponent.findDefault(); if (!tc.isOpened()) { tc.open(); Preferences ps = NbPreferences.forModule(ClassViewTopComponent.class); ps.putBoolean(ClassViewTopComponent.OPENED_PREFERENCE, true); // NOI18N } tc.requestActive(); }
/** Closes this <code>TopComponent</code> in current workspace. * <em>Node:</em> Currently workspaces are not supported. The method has the same effect * like {@link #close()}. * @deprecated Use {@link #close()} instead. */ public final boolean close (Workspace workspace) { if(!isOpened()) { return true; } if(canClose()) { WindowManager.getDefault().topComponentClose(this); return true; } else { return false; } }
/** Closes this <code>TopComponent</code> in current workspace. * <em>Node:</em> Currently workspaces are not supported. The method has the same effect * like {@link #close()}. * @deprecated Use {@link #close()} instead. */ public final boolean close (Workspace workspace) { if(!isOpened()) { return true; } if(canClose()) { WindowManager.getDefault().topComponentClose(this); return true; } else { return false; } }
private TopComponent dockInternalFrame(JInternalFrame internalFrame) { TopComponent topComponent = closeInternalFrame(internalFrame, true); Mode mode = WindowManager.getDefault().findMode("editor"); mode.dockInto(topComponent); if (!topComponent.isOpened()) { topComponent.open(); } return topComponent; }
/** * Updates the state of DOM Tree view. This method can be called * from event-dispatch thread only. */ private void updateDomTC0() { synchronized (this) { TopComponentGroup group = getDOMTCGroup(); Page inspectedPage = PageInspector.getDefault().getPage(); if (inspectedPage == null) { group.close(); } else { TopComponent tc = WindowManager.getDefault().findTopComponent(DomTC.ID); boolean wasOpened = tc.isOpened(); group.open(); if (!wasOpened && tc.isOpened()) { tc.requestVisible(); } } } }
private List<FacesModel> getVisibleModels() { List<FacesModel> visibleModels = new ArrayList<FacesModel>(); for(Mode mode : WindowManager.getDefault().getModes()) { TopComponent tc = mode.getSelectedTopComponent(); if(tc != null && tc.isOpened() && isMultiViewTopComponent(tc)){ TopComponent topComponent = getSelectedMultiView(tc); if(topComponent != null && isDesignerTopComponent(topComponent)) { // DataObject dObj = topComponent.getActivatedNodes()[0].getLookup().lookup(DataObject.class); // XXX #131996 Defend against possible NPE's. org.openide.nodes.Node[] activatedNodes = topComponent.getActivatedNodes(); if (activatedNodes == null || activatedNodes.length == 0) { info(new NullPointerException("TopComponent doesn't have any activated nodes, topComponent=" + topComponent + ", nodes=" + activatedNodes)); // NOI18N continue; } DataObject dObj = activatedNodes[0].getLookup().lookup(DataObject.class); if (dObj == null) { info(new NullPointerException("Activated node from top component" + " doesn't contain DataObject in its first activated node lookup, topComponent=" + topComponent + ", node=" + activatedNodes[0])); // NOI18N continue; } visibleModels.add((FacesModel)getModel(dObj.getPrimaryFile())); } } } return visibleModels; }
@Override public void run() { if (component != null) { if (!component.isOpened()) { component.open(); component.requestActive(); } else if (!component.isVisible()) { component.requestActive(); } else { component.close(); } } } });
private void runServer(String path, final boolean serverDebug, final boolean clientDebug) { TopComponent outputWindow = getOutputWindow(); if (!outputWindow.isOpened()) { outputWindow.open(); } outputWindow.requestActive(); outputWindow.toFront(); RailsServerManager server = project.getLookup().lookup(RailsServerManager.class); if (server != null) { server.setDebug(serverDebug); server.setClientDebug(clientDebug); // use the url from project config if no path is specified if (path == null || "".equals(path)) { //NOI18N String url = project.evaluator().getProperty(RailsProjectProperties.RAILS_URL); if (url != null) { path = url; } } server.showUrl(path); } }
if (qbp != null) { TopComponent qb = qbp.qb; if (!qb.isOpened()) { qb.open();
if (containsUnkownNode) { TopComponent tc = WindowManager.getDefault().findTopComponent(DomTC.ID); if (tc.isOpened()) { key = "CSSStylesSelectionPanel.selectInDOMTree"; // NOI18N } else {
if (topComponent.isOpened()) { topComponent.close();