|
org.openide.explorer 6.28.2 | |||||||||
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
javax.swing.JScrollPane
org.openide.explorer.view.TreeView
org.openide.explorer.view.ContextTreeView
public class ContextTreeView
A view displaying tree of Node
s but not showing its leaf nodes.
Works well together (e.g. sharing one ExplorerManager
) with ListView
.
This class is a view
to use it properly you need to add it into a component which implements
ExplorerManager.Provider
. Good examples of that can be found
in ExplorerUtils
. Then just use
ExplorerManager.Provider.getExplorerManager()
call to get the ExplorerManager
and control its state.
There can be multiple views
under one container implementing ExplorerManager.Provider
. Select from
range of predefined ones or write your own:
BeanTreeView
- shows a tree of nodesContextTreeView
- shows a tree of nodes without leaf nodesListView
- shows a list of nodesIconView
- shows a rows of nodes with bigger iconsChoiceView
- creates a combo box based on the explored nodesTreeTableView
- shows tree of nodes together with a set of their Node.Property
MenuView
- can create a JMenu
structure based on structure of Node
s
All of these views use ExplorerManager.find(java.awt.Component)
to walk up the AWT hierarchy and locate the
ExplorerManager
to use as a controler. They attach as listeners to
it and also call its setter methods to update the shared state based on the
user action. Not all views make sence together, but for example
ContextTreeView
and ListView
were designed to complement
themselves and behaves like windows explorer. The PropertySheetView
for example should be able to work with any other view.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JScrollPane |
---|
JScrollPane.AccessibleJScrollPane, JScrollPane.ScrollBar |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class org.openide.explorer.view.TreeView |
---|
tree |
Fields inherited from class javax.swing.JScrollPane |
---|
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport |
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 | |
---|---|
ContextTreeView()
Constructor. |
Method Summary | |
---|---|
protected NodeTreeModel |
createModel()
Create model. |
protected boolean |
selectionAccept(Node[] nodes)
Called when explorer manager is about to change the current selection. |
protected void |
selectionChanged(Node[] nodes,
ExplorerManager man)
Called to allow subclasses to define the behaviour when a node(s) are selected in the tree. |
protected void |
showPath(TreePath path)
Expand the given path and makes it visible. |
protected void |
showSelection(TreePath[] paths)
Shows selection to reflect the current state of the selection in the explorer. |
protected boolean |
useExploredContextMenu()
Permit use of explored contexts. |
Methods inherited from class org.openide.explorer.view.TreeView |
---|
addNotify, collapseNode, expandAll, expandNode, getAllowedDragActions, getAllowedDropActions, getInsets, getSelectionMode, isDefaultActionEnabled, isDragSource, isDropTarget, isExpanded, isPopupAllowed, isRootVisible, removeNotify, requestFocus, requestFocusInWindow, setAllowedDragActions, setAllowedDropActions, setAutoWaitCursor, setDefaultActionAllowed, setDragSource, setDropTarget, setPopupAllowed, setRootVisible, setSelectionMode, setUseSubstringInQuickSearch, updateUI, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ContextTreeView()
Method Detail |
---|
protected boolean selectionAccept(Node[] nodes)
TreeView
selectionAccept
in class TreeView
nodes
- the nodes to select
protected void selectionChanged(Node[] nodes, ExplorerManager man) throws PropertyVetoException
TreeView
selectionChanged
in class TreeView
nodes
- the selected nodesman
- explorer manager to work on (change nodes to it)
PropertyVetoException
- if the change cannot be done by the explorer
(the exception is silently consumed)protected void showPath(TreePath path)
showPath
in class TreeView
path
- the pathprotected void showSelection(TreePath[] paths)
showSelection
in class TreeView
paths
- array of paths that should be selectedprotected boolean useExploredContextMenu()
useExploredContextMenu
in class TreeView
true
alwaysprotected NodeTreeModel createModel()
createModel
in class TreeView
|
org.openide.explorer 6.28.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |