public class IlvTreeView extends IlvPanelView
JTree
.JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_SETTINGS_NAME
Default attribute name for selecting the settings element that provides
the settings of the tree view.
|
static String |
DEFAULT_SETTINGS_TYPE
Type of settings element providing the settings for the tree views.
|
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
ACTIVE_PROPERTY, ACTIVE_VIEW_NAME, APPLICATION_PROPERTY, CLOSABLE_PROPERTY, CLOSING_VIEW_MSG, DOCUMENT_PROPERTY, SETTINGS_ELEMENT_PROPERTY, STATIC_VIEW_PROPERTY, VIEW_CONTAINER_PROPERTY
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Modifier | Constructor and Description |
---|---|
|
IlvTreeView()
Constructs an
IlvTreeView component. |
protected |
IlvTreeView(String settingsType,
String defaultSettingsName)
Constructs a tree view that reads its settings from a settings element
with the specified
settingsType . |
Modifier and Type | Method and Description |
---|---|
protected void |
addTree(JTree tree)
Invoked after the tree associated with this view has been created, for
adding it to the panel view.
|
protected JTree |
createTree()
Factory method invoked to create a
JTree to add to the
panel view. |
protected TreeCellRenderer |
createTreeCellRenderer(JTree tree)
Factory method that creates a tree renderer for the specified
tree . |
Object |
getProperty(String key)
Returns the client property of the tree with the specified key.
|
JTree |
getTree()
Returns the
JTree instance associated with this view. |
protected void |
initializeTree(JTree tree)
Invoked by the
initializeView(ilog.views.appframe.docview.IlvDocument) method after the
createTree() method has been called, for initializing the
newly created tree . |
void |
initializeView(IlvDocument document)
Initializes the tree view with the specified document.
|
protected void |
nodeDoubleClicked(MouseEvent e,
TreeNode treeNode,
Object userData)
Invoked when a tree node has been double-clicked in the tree view.
|
protected void |
nodeRightClicked(MouseEvent e,
TreeNode treeNode,
Object userData)
Invoked when a tree node has been right-clicked in the tree view.
|
Object |
setProperty(String key,
Object value)
Sets one of the client properties of this tree, using the associated key.
|
void |
setTree(JTree tree)
Associates the specified
tree with this tree view. |
void |
viewClosed()
Invoked after the view has been closed.
|
void |
viewClosing()
Invoked before the view closes.
|
actionPerformed, addActionHandler, close, getApplication, getDocument, getSettings, getSettingsElement, getSettingsName, getSettingsQuery, getSettingsType, getViewContainer, isProcessingAction, isStaticView, readSettings, receiveMessage, registerMappings, removeActionHandler, setApplication, setDocument, setSettings, setSettingsElement, setSettingsName, setSettingsQuery, setViewContainer, updateAction, writeSettings
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, 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, 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, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, removePropertyChangeListener
public static final String DEFAULT_SETTINGS_TYPE
public static final String DEFAULT_SETTINGS_NAME
protected IlvTreeView(String settingsType, String defaultSettingsName)
settingsType
.settingsType
- The type of the settings element that provides the settings
for the tree view.defaultSettingsName
- The default name used to select the settings
element that provides the settings for this tree view.IlvPanelView.getSettingsType()
,
IlvPanelView.getSettingsName()
public IlvTreeView()
IlvTreeView
component.public void initializeView(IlvDocument document)
DOCUMENT_PROPERTY
of the view.
By default, this method makes sure that a JTree
instance has been
created for the view. If not, the factory createTree()
method
will be called.
initializeView
in interface IlvDocumentView
initializeView
in class IlvPanelView
document
- The document to initialize the content of the tree view from.protected JTree createTree()
JTree
to add to the
panel view. By default, a JTree
instance is returned.JTree
instance.initializeView(ilog.views.appframe.docview.IlvDocument)
,
initializeTree(javax.swing.JTree)
protected void initializeTree(JTree tree)
initializeView(ilog.views.appframe.docview.IlvDocument)
method after the
createTree()
method has been called, for initializing the
newly created tree
. By default, a mouse listener is added to
the tree for linking the double-click and right-click events to
the methods nodeDoubleClicked(java.awt.event.MouseEvent, javax.swing.tree.TreeNode, java.lang.Object)
and
nodeRightClicked(java.awt.event.MouseEvent, javax.swing.tree.TreeNode, java.lang.Object)
respectively.
This method is invoked once after a new tree has been created. The
initialization of the tree content according to the data of the document
of this view should be performed when overriding the
initializeView(ilog.views.appframe.docview.IlvDocument)
method.
tree
- The tree to initialize.protected void addTree(JTree tree)
BorderLayout
is set to the panel view and the tree is added to the panel with the
BorderLayout.CENTER
constraint.tree
- The tree to add to the panel view.initializeView(ilog.views.appframe.docview.IlvDocument)
,
createTree()
public JTree getTree()
JTree
instance associated with this view.setTree(javax.swing.JTree)
public void setTree(JTree tree)
tree
with this tree view.
The previous tree of the view is removed from the panel. Then,
the methods initializeTree(javax.swing.JTree)
and addTree(javax.swing.JTree)
are
called respectively for associating the specified tree
with the view.tree
- The new tree of the tree view.getTree()
,
initializeTree(javax.swing.JTree)
,
addTree(javax.swing.JTree)
public void viewClosing()
viewClosing
in interface IlvDocumentView
viewClosing
in class IlvPanelView
viewClosed()
public void viewClosed()
viewClosed
in interface IlvDocumentView
viewClosed
in class IlvPanelView
viewClosing()
protected TreeCellRenderer createTreeCellRenderer(JTree tree)
tree
. This method is called after the method
createTree()
has been called for setting a tree cell renderer to
the new tree. The newly created tree renderer must not be set to the tree, since
this is done automatically.createTree()
public Object setProperty(String key, Object value)
PropertyChangeEvent
will be sent to
property change listeners.setProperty
in interface IlvPropertyManager
setProperty
in class IlvPanelView
key
- The non-null
property key.value
- An Object
value. If it is equal to
null
, the property with the specified key will be removed.getProperty(java.lang.String)
,
JComponent.putClientProperty(java.lang.Object, java.lang.Object)
public Object getProperty(String key)
getProperty
in interface IlvPropertyManager
getProperty
in class IlvPanelView
key
- The non-null
property key.null
if the specified property was not found.setProperty(java.lang.String, java.lang.Object)
,
JComponent.getClientProperty(java.lang.Object)
protected void nodeDoubleClicked(MouseEvent e, TreeNode treeNode, Object userData)
e
- The mouse event that originated the call to this method.treeNode
- The tree node.userData
- The user data associated with this node or
null
.initializeTree(javax.swing.JTree)
protected void nodeRightClicked(MouseEvent e, TreeNode treeNode, Object userData)
userData
.e
- The mouse event that originated the call to this method. Parameters
of this event can be used for displaying a pop-up menu.treeNode
- The tree node.userData
- The user data associated with this node or
null
.initializeTree(javax.swing.JTree)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.