ctc = allEditors.getArbitraryComponent(); return (Pane)ctc; Enumeration en = allEditors.getComponents(); while(en.hasMoreElements()) { ctc = (CloneableTopComponent)en.nextElement();
/** Unregister the component. If this is the last asks if it is * allowed to unregister it. * * @param c the component to unregister * @return true if the component agreed to be unregister */ private final boolean unregister (CloneableTopComponent c) { int componentCount; synchronized(LOCK) { if(!componentSet.contains(c)) { return true; } componentCount = componentSet.size(); } if (componentCount > 1 || c.closeLast()) { removeComponent(c); return true; } else { return false; } }
Enumeration en = allEditors.getComponents();
Enumeration en = allEditors.getComponents();
Enumeration en = allEditors.getComponents (); while (en.hasMoreElements ()) { CloneableTopComponent ctc = (CloneableTopComponent)en.nextElement ();
Enumeration en = allEditors.getComponents (); while (en.hasMoreElements ()) { CloneableTopComponent ctc = (CloneableTopComponent)en.nextElement ();
if (allEditors.isEmpty ()) { return true;
if (allEditors.isEmpty ()) { return true;
ctc = allEditors.getArbitraryComponent(); return (Pane)ctc; Enumeration en = allEditors.getComponents(); while(en.hasMoreElements()) { ctc = (CloneableTopComponent)en.nextElement();
ctc = allEditors.getArbitraryComponent(); Enumeration en = allEditors.getComponents();
/** 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; } } }
/** Unregister the component. If this is the last asks if it is * allowed to unregister it. * * @param c the component to unregister * @return true if the component agreed to be unregister */ private final boolean unregister (CloneableTopComponent c) { int componentCount; synchronized(LOCK) { if(!componentSet.contains(c)) { return true; } componentCount = componentSet.size(); } if (componentCount > 1 || c.closeLast()) { removeComponent(c); return true; } else { return false; } }
public Object run () { //synchronized (allEditors) { synchronized (getLock()) { // user canceled the action if (ask && !canClose ()) { return Boolean.FALSE; } java.util.Enumeration en = allEditors.getComponents (); while (en.hasMoreElements ()) { TopComponent c = (TopComponent)en.nextElement (); if (!c.close ()) { return Boolean.FALSE; } } } return Boolean.TRUE; } });
/** Updates titles of all editors. */ protected void updateTitles () { Enumeration en = allEditors.getComponents (); while (en.hasMoreElements()) { CloneableTopComponent o = (CloneableTopComponent)en.nextElement(); Pane e = (Pane)o.getClientProperty(PROP_PANE); if (e == null && o instanceof Pane) { e = (Pane)o; } if (e != null) { e.updateName(); } else { throw new IllegalStateException("No reference to Pane. Please file a bug against openide/text"); } } }
/** Updates titles of all editors. */ protected void updateTitles () { Enumeration en = allEditors.getComponents (); while (en.hasMoreElements()) { CloneableTopComponent o = (CloneableTopComponent)en.nextElement(); Pane e = (Pane)o.getClientProperty(PROP_PANE); if (e == null && o instanceof Pane) { e = (Pane)o; } if (e != null) { e.updateName(); } else { throw new IllegalStateException("No reference to Pane. Please file a bug against openide/text"); } } }
public Object run () { //synchronized (allEditors) { synchronized (getLock()) { // user canceled the action if (ask && !canClose ()) { return Boolean.FALSE; } java.util.Enumeration en = allEditors.getComponents (); while (en.hasMoreElements ()) { TopComponent c = (TopComponent)en.nextElement (); if (!c.close ()) { return Boolean.FALSE; } } } return Boolean.TRUE; } });
/** Updates titles of all editors. */ protected void updateTitles() { Enumeration en = allEditors.getComponents(); while (en.hasMoreElements()) { CloneableTopComponent o = (CloneableTopComponent) en.nextElement(); Pane e = (Pane) o.getClientProperty(PROP_PANE); if ((e == null) && o instanceof Pane) { e = (Pane) o; } if (e != null) { e.updateName(); } else { throw new IllegalStateException("No reference to Pane. Please file a bug against openide/text"); } } }
/** Get a list of all components which are clone-sisters of this one. * * @return the clone registry for this component's group */ public synchronized final Ref getReference () { if (ref == null) { ref = new Ref (this); } return ref; }
/** Get a list of all components which are clone-sisters of this one. * * @return the clone registry for this component's group */ public synchronized final Ref getReference () { if (ref == null) { ref = new Ref (this); } return ref; }