public class OutlineView extends JScrollPane
Explorer view displaying nodes in a tree table.
Related documentation:
JScrollPane.AccessibleJScrollPane, JScrollPane.ScrollBar
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
OutlineView()
Creates a new instance of TableView
|
OutlineView(String nodesColumnLabel)
Creates a new instance of TableView
|
Modifier and Type | Method and Description |
---|---|
void |
add(Component comp,
Object constraints) |
void |
addNotify()
Initializes the component and lookup explorer manager.
|
void |
addPropertyColumn(String name,
String displayName)
Adds a property column which will match any property with the passed
name.
|
void |
addPropertyColumn(String name,
String displayName,
String description)
Adds a property column which will match any property with the passed
name.
|
void |
addTreeExpansionListener(TreeExpansionListener l) |
void |
collapseNode(Node n)
Collapses the tree under given node.
|
protected org.netbeans.swing.outline.OutlineModel |
createOutlineModel(NodeTreeModel treeModel,
org.netbeans.swing.outline.RowModel rowModel,
String label)
This method allows plugging own OutlineModel to the OutlineView.
|
void |
expandNode(Node n)
Expands the node in the tree.
|
int |
getAllowedDragActions()
Actions constants comes from
DnDConstants . |
int |
getAllowedDropActions()
Actions constants comes from
DnDConstants . |
protected int |
getAllowedDropActions(Transferable t)
Actions constants from
DnDConstants . |
int |
getHorizontalScrollBarPolicy() |
Insets |
getInsets() |
NodePopupFactory |
getNodePopupFactory()
Getter for the current popup customizer factory.
|
org.netbeans.swing.outline.Outline |
getOutline()
Getter for the embedded table component.
|
int |
getTreeHorizontalScrollBarPolicy()
Returns the horizontal scroll bar policy value for the tree column.
|
boolean |
isDefaultActionAllowed()
Tells if double click invokes default action.
|
boolean |
isDragSource()
Drag support is enabled by default.
|
boolean |
isDropTarget()
Drop support is enabled by default.
|
boolean |
isExpanded(Node n)
Test whether a node is expanded in the tree or not
|
boolean |
isPopupAllowed()
Is it permitted to display a popup menu?
|
boolean |
isQuickSearchAllowed()
Test whether the quick search feature is enabled or not.
|
boolean |
isShowNodeIcons()
Test whether the node icons are shown.
|
void |
readSettings(Properties p,
String propertyPrefix)
Method allowing to read stored values.
|
void |
remove(Component comp) |
void |
removeNotify()
De-initializes listeners.
|
boolean |
removePropertyColumn(String name)
Remove the first property column for properties named
name |
void |
removeTreeExpansionListener(TreeExpansionListener l) |
void |
requestFocus()
Requests focus for the tree component.
|
boolean |
requestFocusInWindow()
Requests focus for the tree component.
|
void |
setAllowedDragActions(int actions)
Sets allowed actions for dragging
|
void |
setAllowedDropActions(int actions)
Sets allowed actions for dropping.
|
void |
setDefaultActionAllowed(boolean defaultActionAllowed)
Enable/disable double click to invoke default action.
|
void |
setDragSource(boolean state)
Enables/disables dragging support.
|
void |
setDropTarget(boolean state)
Enables/disables dropping support.
|
void |
setNodePopupFactory(NodePopupFactory newFactory)
Allows customization of the popup menus.
|
void |
setPopupAllowed(boolean value)
Enable/disable displaying popup menus on tree view items.
|
void |
setProperties(Node.Property[] newProperties)
Deprecated.
This method is here to enable easy replacement
of TreeTableView with OutlineView.
Use setPropertyColumns(), addPropertyColumn() and
removePropertyColumn() instead.
|
void |
setPropertyColumnAttribute(String columnName,
String attributeName,
Object value)
Set an attribute value for the property column
representing properties that have the passed programmatic (not display)
name.
|
void |
setPropertyColumnDescription(String columnName,
String description)
Set the description (table header tooltip) for the property column
representing properties that have the passed programmatic (not display)
name, or for the tree column.
|
void |
setPropertyColumns(String... namesAndDisplayNames)
Set all of the non-tree columns property names and display names.
|
void |
setQuickSearchAllowed(boolean allowedQuickSearch)
Set whether the quick search feature is enabled or not.
|
void |
setQuickSearchTableFilter(QuickSearchTableFilter quickSearchTableFilter,
boolean asynchronous)
Set a quick search filter.
|
void |
setShowNodeIcons(boolean showNodeIcons)
Turn node icon rendering on/off.
|
void |
setTreeHorizontalScrollBarPolicy(int policy)
Determines when the horizontal scrollbar appears in the tree column.
|
void |
setTreeSortable(boolean treeSortable)
Set the tree column as sortable
|
void |
writeSettings(Properties p,
String propertyPrefix)
Method allowing to store customization values.
|
createHorizontalScrollBar, createVerticalScrollBar, createViewport, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, getViewportBorderBounds, isValidateRoot, isWheelScrollingEnabled, paramString, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView, setWheelScrollingEnabled, updateUI
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public OutlineView()
public OutlineView(String nodesColumnLabel)
protected org.netbeans.swing.outline.OutlineModel createOutlineModel(NodeTreeModel treeModel, org.netbeans.swing.outline.RowModel rowModel, String label)
public int getTreeHorizontalScrollBarPolicy()
treeHorizontalScrollBarPolicy
propertyOutlineView.setTreeHorizontalScrollBarPolicy(int)
public void setTreeHorizontalScrollBarPolicy(int policy)
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS
policy
- one of the three values listed aboveIllegalArgumentException
- if policy
is not one of the legal values shown aboveOutlineView.getTreeHorizontalScrollBarPolicy()
public int getHorizontalScrollBarPolicy()
getHorizontalScrollBarPolicy
in class JScrollPane
public void requestFocus()
requestFocus
in class JComponent
public boolean requestFocusInWindow()
requestFocusInWindow
in class JComponent
public org.netbeans.swing.outline.Outline getOutline()
public boolean isPopupAllowed()
true
if so@Deprecated public void setProperties(Node.Property[] newProperties)
The passed set of properties are typically
prototypes - for a given Node's
property to be shown in a given column, that Node must have a Property
which equals()
one of the prototype properties. By default,
this means that the return values of the prototype property's getName()
and getValueType() must exactly match.
It is also possible to use the actual Property objects from one Node being shown, if they are available.
newProperties
- An array of prototype propertiespublic final void addPropertyColumn(String name, String displayName)
name
- The programmatic name of the propertydisplayName
- A localized display name for the property which can
be shown in the table headerpublic final void addPropertyColumn(String name, String displayName, String description)
name
- The programmatic name of the propertydisplayName
- A localized display name for the property which can
be shown in the table headerdescription
- The description which will be used as a tooltip in
the table headerpublic final boolean removePropertyColumn(String name)
name
name
- The programmatic name of the Property, i.e. the
return value of Property.getName()
public final void setPropertyColumnDescription(String columnName, String description)
columnName
- The programmatic name (Property.getName()) of the
column, or name of the tree columndescription
- Tooltip text for the column header for that columnpublic final void setPropertyColumns(String... namesAndDisplayNames)
namesAndDisplayNames
- An array, divisible by 2, of
programmatic name, display name, programmatic name, display name...public final void setPropertyColumnAttribute(String columnName, String attributeName, Object value) throws IllegalArgumentException
columnName
- The programmatic name (Property.getName()) of the
columnattributeName
- The name of the attribute that is to be setvalue
- The value of the attributeIllegalArgumentException
- if the column name is not found.public void setPopupAllowed(boolean value)
value
- true
to enablepublic void setDefaultActionAllowed(boolean defaultActionAllowed)
defaultActionAllowed
- Provide true
to enable#isDefaultActionAllowed()}
public boolean isDefaultActionAllowed()
true
if the default action is invoked, or false
when it's not.#setDefaultActionAllowed(boolean)}
public void setTreeSortable(boolean treeSortable)
treeSortable
- true
to make the tree column sortable,
false
otherwise. The tree column is sortable by default.public boolean isQuickSearchAllowed()
public void setQuickSearchAllowed(boolean allowedQuickSearch)
allowedQuickSearch
- true
if quick search shall be enabledpublic void setQuickSearchTableFilter(QuickSearchTableFilter quickSearchTableFilter, boolean asynchronous)
quickSearchTableFilter
- The quick search filterasynchronous
- When true
, the QuickSearchTableFilter
will be called asynchronously on a background thread. When false
,
the filter will be called in an event queue thread.public void addNotify()
addNotify
in class JComponent
public void readSettings(Properties p, String propertyPrefix)
public void writeSettings(Properties p, String propertyPrefix)
public void setNodePopupFactory(NodePopupFactory newFactory)
public NodePopupFactory getNodePopupFactory()
public void removeNotify()
removeNotify
in class JComponent
public boolean isDragSource()
public void setDragSource(boolean state)
state
- true enables dragging support, false disables it.public boolean isDropTarget()
public void setDropTarget(boolean state)
state
- true means drops into view are allowed,
false forbids any drops into this view.public int getAllowedDragActions()
DnDConstants
.
All actions (copy, move, link) are allowed by default.public void setAllowedDragActions(int actions)
actions
- new drag actions, using DnDConstants
public int getAllowedDropActions()
DnDConstants
.
All actions are allowed by default.protected int getAllowedDropActions(Transferable t)
DnDConstants
.t
- The transferable for which the allowed drop actions are requestedOutlineView.getAllowedDropActions()
.public void setAllowedDropActions(int actions)
actions
- new allowed drop actions, using DnDConstants
public void addTreeExpansionListener(TreeExpansionListener l)
public void removeTreeExpansionListener(TreeExpansionListener l)
public void collapseNode(Node n)
n
- node to collapsepublic void expandNode(Node n)
n
- nodepublic boolean isExpanded(Node n)
n
- the node to testpublic Insets getInsets()
getInsets
in class JComponent
public final void setShowNodeIcons(boolean showNodeIcons)
showNodeIcons
- whether to show node icons or not.public final boolean isShowNodeIcons()
true
when node icons are shown, false
otherwise.