/** Called when this component is about to close. * The default implementation just unregisters the clone from its clone list. * <p>If this is the last component in its clone group, then * {@link #closeLast} is called to clean up. * * @return <CODE>true</CODE> if there are still clone sisters left, or this was the last in its group * but {@link #closeLast} returned <code>true</code> */ public boolean canClose (Workspace workspace, boolean last) { if (last) { return getReference ().unregister (this); } return true; }
/** Called when this component is about to close. * The default implementation just unregisters the clone from its clone list. * <p>If this is the last component in its clone group, then * {@link #closeLast} is called to clean up. * * @return <CODE>true</CODE> if there are still clone sisters left, or this was the last in its group * but {@link #closeLast} returned <code>true</code> */ public boolean canClose (Workspace workspace, boolean last) { if (last) { return getReference ().unregister (this); } return true; }
/** Clone the top component and register the clone. * Simply calls createClonedObject () and registers the component to * Ref. * * @return the new cloneable top component */ public final CloneableTopComponent cloneTopComponent() { CloneableTopComponent top = createClonedObject (); // register the component if it has not been registered before top.setReference (getReference ()); return top; }
/** Clone the top component and register the clone. * Simply calls createClonedObject () and registers the component to * Ref. * * @return the new cloneable top component */ public final CloneableTopComponent cloneTopComponent() { CloneableTopComponent top = createClonedObject (); // register the component if it has not been registered before top.setReference (getReference ()); return top; }
/** Overrides superclass method, adds unregistering from references. * @see Ref */ protected void componentClosed() { super.componentClosed(); if(!isOpened()) { getReference().unregister(this); } }
/** Overrides superclass method, adds unregistering from references. * @see Ref */ protected void componentClosed() { super.componentClosed(); if(!isOpened()) { getReference().unregister(this); } }