|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--org.openide.windows.TopComponent | +--org.openide.explorer.ExplorerPanel
Simple top component capable of displaying an Explorer.
Holds one instance of ExplorerManager
and
implements ExplorerManager.Provider
to allow child components to share
the same explorer manager.
Uses BorderLayout
by default.
Pays attention to the selected nodes and explored context as indicated by the manager.
Cut/copy/paste actions are sensitive to the activation state of the component.
It is up to you to add a view and other UI apparatus to the panel.
Inner classes inherited from class org.openide.windows.TopComponent |
TopComponent.Cloneable, TopComponent.NodeName, TopComponent.Registry |
Inner classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent |
Fields inherited from class org.openide.windows.TopComponent |
CLOSE_EACH, CLOSE_LAST |
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 | |
ExplorerPanel()
Default constructor. |
|
ExplorerPanel(ExplorerManager manager)
Initialize the explorer panel with the provided manager. |
Method Summary | |
boolean |
canClose(Workspace workspace,
boolean last)
This method is called when top component is about to close. |
protected void |
componentActivated()
Called when this component is activated. |
protected void |
componentDeactivated()
Called when this component is deactivated. |
ExplorerManager |
getExplorerManager()
Get the explorer manager. |
HelpCtx |
getHelpCtx()
Get context help for an explorer window. |
static HelpCtx |
getHelpCtx(Node[] sel,
HelpCtx def)
Utility method to get context help from a node selection. |
static boolean |
isConfirmDelete()
Are deletions confirmed on all Explorer panels? |
void |
open()
Show the component on current workspace. |
void |
open(Workspace workspace)
Show the component on given workspace. |
void |
readExternal(ObjectInput oi)
Reads the manager. |
void |
requestFocus()
Request focus for the window holding this top component. |
static void |
setConfirmDelete(boolean confirmDelete)
Set whether deletions should have to be confirmed on all Explorer panels. |
protected void |
updateTitle()
Called when the explored context changes. |
void |
writeExternal(ObjectOutput oo)
Stores the manager |
Methods inherited from class org.openide.windows.TopComponent |
close, close, closeNotify, getAccessibleContext, getActivatedNodes, getCloseOperation, getIcon, getRegistry, getSystemActions, getUndoRedo, isOpened, isOpened, openNotify, requestVisible, setActivatedNodes, setCloseOperation, setIcon, setName, writeReplace |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ExplorerPanel(ExplorerManager manager)
explorer
- the explorer manager to usepublic ExplorerPanel()
Method Detail |
public void requestFocus()
TopComponent
opened
first
if it is not already.requestFocus
in class TopComponent
public void open()
TopComponent
open
in class TopComponent
org.openide.windows.TopComponent
TopComponent.requestFocus()
public void open(Workspace workspace)
TopComponent
open
in class TopComponent
org.openide.windows.TopComponent
workspace
- Workspace on which component should be opened.
Parameter can be null -> means current workspace.TopComponent.requestFocus()
public boolean canClose(Workspace workspace, boolean last)
TopComponent
canClose
in class TopComponent
org.openide.windows.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 truepublic ExplorerManager getExplorerManager()
ExplorerManager.Provider
getExplorerManager
in interface ExplorerManager.Provider
org.openide.explorer.ExplorerManager.Provider
protected void componentActivated()
TopComponent
componentActivated
in class TopComponent
protected void componentDeactivated()
TopComponent
componentDeactivated
in class TopComponent
protected void updateTitle()
public HelpCtx getHelpCtx()
getHelpCtx
in class TopComponent
getHelpCtx(Node[],HelpCtx)
public static HelpCtx getHelpCtx(Node[] sel, HelpCtx def)
sel
- a list of nodes to search for help indef
- the default help to use if they have none or do not agreepublic static void setConfirmDelete(boolean confirmDelete)
confirmDelete
- true
to confirm, false
to delete at oncepublic static boolean isConfirmDelete()
true
if they must be confirmedpublic void writeExternal(ObjectOutput oo) throws IOException
writeExternal
in class TopComponent
org.openide.windows.TopComponent
out
- the stream to serialize topublic void readExternal(ObjectInput oi) throws IOException, ClassNotFoundException
SafeException
in case
the manager cannot be loaded correctly but the stream is still uncorrupted.readExternal
in class TopComponent
org.openide.windows.TopComponent
in
- the stream to deserialize from
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |