@Override public void open() { boolean wasNull = getClientProperty( "TopComponentAllowDockAnywhere" ) == null; //NOI18N super.open(); if( wasNull ) { //since we don't define a mode to dock this editor to, the window //system thinks we're an uknown component allowed to dock anywhere //but editor windows can dock into editor modes only, so let's clear //the 'special' flag putClientProperty( "TopComponentAllowDockAnywhere", null); //NOI18N } }
/** always open this top component in our special mode, if * no mode for this component is specified yet */ @Override public void open() { // do not open this component if this is dummy browser if (null != browserComponent && browserComponent.getBrowserComponent() == null) { return; } setDisplayName( getDefaultDisplayName() ); // behave like superclass super.open(); }
/** Simply open for an editor. */ protected final CloneableTopComponent openCloneableTopComponent() { //synchronized (allEditors) { synchronized (getLock()) { CloneableTopComponent ret = allEditors.getArbitraryComponent (); if(ret != null) { ret.open(); return ret; } else { // no opened editor String msg = messageOpening (); if (msg != null) { StatusDisplayer.getDefault().setStatusText(msg); } CloneableTopComponent editor = createCloneableTopComponent (); editor.setReference (allEditors); editor.open(); msg = messageOpened (); if (msg == null) { msg = ""; // NOI18N } StatusDisplayer.getDefault().setStatusText(msg); return editor; } } }
/** Simply open for an editor. */ protected final CloneableTopComponent openCloneableTopComponent() { //synchronized (allEditors) { synchronized (getLock()) { CloneableTopComponent ret = allEditors.getArbitraryComponent (); if(ret != null) { ret.open(); return ret; } else { // no opened editor String msg = messageOpening (); if (msg != null) { StatusDisplayer.getDefault().setStatusText(msg); } CloneableTopComponent editor = createCloneableTopComponent (); editor.setReference (allEditors); editor.open(); msg = messageOpened (); if (msg == null) { msg = ""; // NOI18N } StatusDisplayer.getDefault().setStatusText(msg); return editor; } } }
/** Overrides superclass version. Opens top component only if * it is in valid state. * (Editor top component may become invalid after deserialization).<br> * Also tries to open all other top components which are docked * in editor mode on given workspace, but not visible.<br> */ public void open(Workspace workspace) { if(discard()) { ErrorManager.getDefault().log(ErrorManager.WARNING, "Can not open " + this + " component," // NOI18N + " its support environment is not valid" // NOI18N + " [support=" + support + ", env=" // NOI18N + (support == null ? null : support.env()) + "]"); // NOI18N } else { Workspace realWorkspace = (workspace == null) ? WindowManager.getDefault().getCurrentWorkspace() : workspace; dockIfNeeded(realWorkspace); super.open(workspace); } }
/** Overrides superclass version. Opens top component only if * it is in valid state. * (Editor top component may become invalid after deserialization).<br> * Also tries to open all other top components which are docked * in editor mode on given workspace, but not visible.<br> */ public void open(Workspace workspace) { if(discard()) { ErrorManager.getDefault().log(ErrorManager.WARNING, "Can not open " + this + " component," // NOI18N + " its support environment is not valid" // NOI18N + " [support=" + support + ", env=" // NOI18N + (support == null ? null : support.env()) + "]"); // NOI18N } else { Workspace realWorkspace = (workspace == null) ? WindowManager.getDefault().getCurrentWorkspace() : workspace; dockIfNeeded(realWorkspace); super.open(workspace); } }
ce.getComponent ().open();
ce.getComponent ().open();