|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
org.openide.windows.TopComponent
org.openide.windows.CloneableTopComponent
A top component which may be cloned. Typically cloning is harmless, i.e. the data contents (if any) of the component are the same, and the new component is merely a different presentation. Also, a list of all cloned components is kept.
Nested Class Summary | |
static class |
CloneableTopComponent.Ref
Keeps track of a group of sister clones. |
Nested classes inherited from class org.openide.windows.TopComponent |
TopComponent.Cloneable, TopComponent.NodeName, TopComponent.Registry |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
static CloneableTopComponent.Ref |
EMPTY
Empty clone-sister list. |
Fields inherited from class org.openide.windows.TopComponent |
CLOSE_EACH, CLOSE_LAST, PERSISTENCE_ALWAYS, PERSISTENCE_NEVER, PERSISTENCE_ONLY_OPENED |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
CloneableTopComponent()
Create a cloneable top component. |
Method Summary | |
boolean |
canClose(Workspace workspace,
boolean last)
Called when this component is about to close. |
Object |
clone()
Clone the top component and register the clone. |
TopComponent |
cloneComponent()
Clone the top component and register the clone. |
CloneableTopComponent |
cloneTopComponent()
Clone the top component and register the clone. |
protected boolean |
closeLast()
Called when the last component in a clone group is closing. |
protected void |
componentClosed()
Overrides superclass method, adds unregistering from references. |
protected CloneableTopComponent |
createClonedObject()
Called from clone() to actually create a new component from this one. |
CloneableTopComponent.Ref |
getReference()
Get a list of all components which are clone-sisters of this one. |
void |
readExternal(ObjectInput oi)
Deserialize this top component. |
void |
setReference(CloneableTopComponent.Ref another)
Changes the reference to which this components belongs. |
void |
writeExternal(ObjectOutput oo)
Serialize this top component. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final CloneableTopComponent.Ref EMPTY
Constructor Detail |
public CloneableTopComponent()
Method Detail |
public final Object clone()
public final CloneableTopComponent cloneTopComponent()
public final TopComponent cloneComponent()
cloneComponent
in interface TopComponent.Cloneable
protected CloneableTopComponent createClonedObject()
clone()
to actually create a new component from this one.
The default implementation only clones the object by calling Object.clone()
.
Subclasses may leave this as is, assuming they have no special needs for the cloned
data besides copying it from one object to the other. If they do, the superclass
method should be called, and the returned object modified appropriately.
public final CloneableTopComponent.Ref getReference()
public final void setReference(CloneableTopComponent.Ref another)
another
- the new reference this component should belongprotected void componentClosed()
componentClosed
in class TopComponent
CloneableTopComponent.Ref
public boolean canClose(Workspace workspace, boolean last)
If this is the last component in its clone group, then
closeLast()
is called to clean up.
canClose
in class TopComponent
workspace
- the workspace on which we are about to close or
null which means that component will be closed
on all workspaces where it is opened (CLOSE_EACH mode)last
- true if this is last workspace where top component is
opened, false otherwise. If close operation is set to
CLOSE_EACH, then this param is always true
true
if there are still clone sisters left, or this was the last in its group
but closeLast()
returned true
protected boolean closeLast()
true
.
Subclasses may specify some hooks to run.
true
if the component is ready to be
closed, false
to cancelpublic void readExternal(ObjectInput oi) throws IOException, ClassNotFoundException
TopComponent
readExternal
in interface Externalizable
readExternal
in class TopComponent
oi
- the stream to deserialize from
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput oo) throws IOException
TopComponent
writeExternal
in interface Externalizable
writeExternal
in class TopComponent
oo
- the stream to serialize to
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |