|
|||||||||||
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
Embeddable visual component to be displayed in the IDE. This is the basic unit of display in the IDE--windows should not be created directly, but rather use this class. A top component may correspond to a single window, but may also be a tab (e.g.) in a window. It may be docked or undocked, have selected nodes, supply actions, etc. Important serialization note: Serialization of this TopComponent is designed in a way that it's not desired to override writeReplace method. If you would like to resolve to something, please implement readResolve() method directly on your top component.
Nested Class Summary | |
static interface |
TopComponent.Cloneable
Each top component that wishes to be cloned should implement this interface, so CloneAction can check it and call the cloneComponent method. |
static class |
TopComponent.NodeName
This class provides the connection between the node name and a name of the component. |
static interface |
TopComponent.Registry
Registry of all top components. |
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 int |
CLOSE_EACH
Deprecated. XXX Do not use. It is redundant since workspaces are not supported anymore. |
static int |
CLOSE_LAST
Deprecated. XXX Do not use. It is redundant since workspaces are not supported anymore. |
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 | |
TopComponent()
Create a top component. |
Method Summary | |
void |
addNotify()
|
List |
availableModes(List modes)
Allows top component to specify list of modes into which can be docked by end user. |
boolean |
canClose()
XXX This method is called when this TopComponent is about to close. |
boolean |
canClose(Workspace workspace,
boolean last)
Deprecated. XXX Do not use anymore. Use instead. Both parameters are redundant since workspaces are not supported anymore. |
boolean |
close()
Closes this TopComponent . |
boolean |
close(Workspace workspace)
Deprecated. XXX Use close() instead. |
protected void |
closeNotify()
Deprecated. Use componentClosed() instead. |
protected void |
componentActivated()
Called when this component is activated. |
protected void |
componentClosed()
Called only when top component was closed so that now it is closed on all workspaces in the system. |
protected void |
componentDeactivated()
Called when this component is deactivated. |
protected void |
componentHidden()
Called when TopComponent was hidden. |
protected void |
componentOpened()
Called only when top component was closed on all workspaces before and now is opened for the first time on some workspace. |
protected void |
componentShowing()
Called when TopComponent is about to be shown. |
AccessibleContext |
getAccessibleContext()
|
Action[] |
getActions()
Gets the actions which will appear in the popup menu of this component. |
org.openide.nodes.Node[] |
getActivatedNodes()
Get the set of activated nodes in this component. |
int |
getCloseOperation()
Deprecated. XXX Do not use. It is redundant since workspaces are not supported anymore. |
String |
getDisplayName()
XXX Gets localized dipslay name of this TopComponent . |
org.openide.util.HelpCtx |
getHelpCtx()
Get the help context for this component. |
Image |
getIcon()
|
String |
getID()
Returns unique permanent TopComponent ID. |
org.openide.util.Lookup |
getLookup()
Gets lookup which represents context of this component. |
static TopComponent.Registry |
getRegistry()
Getter for class that allows obtaining of information about components. |
org.openide.util.actions.SystemAction[] |
getSystemActions()
Deprecated. Use getActions() instead. |
org.openide.awt.UndoRedo |
getUndoRedo()
Get the undo/redo support for this component. |
boolean |
isOpened()
Indicates whether this TopComponent is opened. |
boolean |
isOpened(Workspace workspace)
Deprecated. XXX Use isOpened() instead. |
void |
open()
Shows this TopComponent . |
void |
open(Workspace workspace)
Deprecated. XXX Use open() instead. |
protected void |
openNotify()
Deprecated. Use componentOpened() instead. |
protected String |
preferredID()
Subclasses are encouraged to override this method to provide preferred value for unique TopComponent Id returned by getID. |
protected boolean |
processKeyBinding(KeyStroke ks,
KeyEvent e,
int condition,
boolean pressed)
Overrides superclass method, adds possible additional handling of global keystrokes in case this TopComoponent is ancestor of focused component. |
void |
readExternal(ObjectInput in)
Deserialize this top component. |
void |
requestActive()
XXX Activates this TopComponet |
void |
requestFocus()
Deprecated. XXX Use requestActive() instead. This method should have been preserved
for focus management only but not activation of TopComponent inside window system. |
void |
requestVisible()
Selects this TopComponent , if it is opened, but does not activate it
unless it is in active mode already. |
void |
setActivatedNodes(org.openide.nodes.Node[] activatedNodes)
Set the set of activated nodes in this component. |
void |
setCloseOperation(int closeOperation)
Deprecated. XXX Do not use. It is redundant since workspaces are not supported anymore. |
void |
setDisplayName(String displayName)
XXX Sets localized display name of this TopComponent . |
void |
setIcon(Image icon)
Set the icon of this top component. |
void |
setName(String name)
Set the name of this top component. |
void |
setToolTipText(String toolTip)
Sets toolTip for this TopComponent , adds notification
about the change to its WindowManager.TopComponentManager . |
void |
writeExternal(ObjectOutput out)
Serialize this top component. |
protected Object |
writeReplace()
Delegates instance of replacer class to be serialized instead of top component itself. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int CLOSE_EACH
close()
is called.
This is appropriate for top components such as Editor panes which
the user expects to really close (and prompt to save) when closed
in any
public static final int CLOSE_LAST
close()
.
Appropriate for components containing no user data, for which closing
the component is only likely to result from the user's wanting to remove
it from active view (on the current workspace).
Constructor Detail |
public TopComponent()
Method Detail |
public static final TopComponent.Registry getRegistry()
public final org.openide.nodes.Node[] getActivatedNodes()
public final void setActivatedNodes(org.openide.nodes.Node[] activatedNodes)
public org.openide.awt.UndoRedo getUndoRedo()
public void open()
TopComponent
.
Note: This method only makes it visible, but does not
activates it.
requestActive()
public void open(Workspace workspace)
open()
instead.
TopComponent
in current workspace.
Node: Currently workspaces are not supported. The method has the same effect
like open()
.
public final boolean isOpened()
TopComponent
is opened.
public final boolean isOpened(Workspace workspace)
isOpened()
instead.
TopComponent
is opened in current workspace.
Node: Currently workspaces are not supported. The method has the same effect
like isOpened()
.
public void addNotify()
public final boolean close()
TopComponent
.
public final boolean close(Workspace workspace)
close()
instead.
TopComponent
in current workspace.
Node: Currently workspaces are not supported. The method has the same effect
like close()
.
public boolean canClose()
TopComponent
is about to close.
Allows subclasses to decide if TopComponent
is ready to close.
public boolean canClose(Workspace workspace, boolean last)
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
protected void openNotify()
componentOpened()
instead.
protected void closeNotify()
componentClosed()
instead.
public org.openide.util.actions.SystemAction[] getSystemActions()
getActions()
instead.
public Action[] getActions()
Subclasses are encouraged to override this method to specify their own sets of actions.
Remember to call the super method when overriding and add your actions to the superclass' ones (in some order), because the default implementation provides support for standard component actions like save, close, and clone.
public final void setCloseOperation(int closeOperation)
closeOperation
- one of CLOSE_EACH
or CLOSE_LAST
IllegalArgumentException
- if an unrecognized close mode was suppliedclose()
public final int getCloseOperation()
CLOSE_EACH
or CLOSE_LAST
protected String preferredID()
public final String getID()
protected void componentOpened()
protected void componentClosed()
protected void componentShowing()
TopComponent
is about to be shown.
Shown here means the component is selected or resides in it own cell
in container in its Mode
. The container is visible and not minimized.
Note: component is considered to be shown, even its container window is overlapped by another window.
protected void componentHidden()
TopComponent
was hidden. Nore:
Note: Beside typical situations when component is hidden,
it is considered to be hidden even in that case
the component is in Mode
container hierarchy,
the cointainer is visible, not minimized,
but the component is neither selected nor in its own cell,
i.e. it has it's own tab, but is not the selected one.
protected void componentActivated()
protected void componentDeactivated()
public void requestFocus()
requestActive()
instead. This method should have been preserved
for focus management only but not activation of TopComponent
inside window system.
opened
first
if it is not already.
Subclasses should override this method to transfer focus to desired
focusable component. TopComponent
itself is not focusable.
See for example org.openide.text.CloneableEditor#requestFocus
.
public final void requestActive()
TopComponet if it is opened.
- Since:
- XXX
public void requestVisible()
TopComponent
, if it is opened, but does not activate it
unless it is in active mode already.
public void setName(String name)
name
- the new display namepublic final void setDisplayName(String displayName)
TopComponent
.
public final String getDisplayName()
TopComponent
.
null
if there is nonepublic void setToolTipText(String toolTip)
TopComponent
, adds notification
about the change to its WindowManager.TopComponentManager
.
public void setIcon(Image icon)
icon
- New components' icon.public Image getIcon()
public org.openide.util.HelpCtx getHelpCtx()
getHelpCtx
in interface org.openide.util.HelpCtx.Provider
public List availableModes(List modes)
So for example, by returning empty list, top component refuses to be docked anywhere.
Default implementation allows docking anywhere by returning input list unchanged.
modes
- list of Mode
which represent all modes of current
workspace, can contain nulls. Items are structured in logical groups
separated by null entries. Input array also contains special constant modes for docking into newly created frames. Their names are "SingleNewMode", "MultiNewMode", "SplitNewMode", can be used for their recognition. Please note that names and existence of special modes can change in future releases.
Mode
which are available for dock, can contain nullsprotected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed)
TopComoponent
is ancestor of focused component.
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
out
- the stream to serialize to
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
in
- the stream to deserialize from
IOException
ClassNotFoundException
protected Object writeReplace() throws ObjectStreamException
ObjectStreamException
public AccessibleContext getAccessibleContext()
getAccessibleContext
in interface Accessible
public org.openide.util.Lookup getLookup()
getActivatedNodes
method and result of this component ActionMap
delegate.
getLookup
in interface org.openide.util.Lookup.Provider
ContextAwareAction
,
Utilities.actionsToPopup(Action[], Lookup)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |