public class IlvExplorerView extends IlvTreeView
IlvDataContainerDocument
,
Serialized FormJPanel.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 explorer view.
|
static String |
DEFAULT_SETTINGS_TYPE
Type of settings element providing the settings for the tree views.
|
static String |
INSERT_FILE_CMD
Action command key for the action that inserts a new file.
|
static String |
INSERT_FOLDER_CMD
Action command key for the action that inserts a new folder.
|
static String |
INSERT_PROJECT_CMD
Action command key for the action that inserts a new project.
|
static String |
OPEN_PROJECT_NODE_CMD
Action command key for the action that opens the selected
data container nodes.
|
static String |
REMOVE_NODE_CMD
Action command key for the action that removes a node from the
data container visualized by the explorer view.
|
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 |
---|---|
|
IlvExplorerView()
Constructs a new
IlvExplorerView . |
protected |
IlvExplorerView(String settingsType,
String defaultSettingsName)
Constructs an explorer view that reads its settings from a settings element
with the specified
settingsType . |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
Invoked when an action occurs.
|
protected boolean |
canOpenNodes(Object[] nodes)
Determines whether the selected
nodes of the data container
associated with this explorer view can be opened. |
protected boolean |
canRemoveDataContainerNode(Object parent,
Object node)
Determines whether the specified data container
node can be
removed. |
protected boolean |
canRemoveNodes(Object[] nodes)
Determines whether the specified data container
nodes can
be removed from their data container. |
protected boolean |
canRemoveTreeNode(TreeNode treeNode)
Determines whether the specified
treeNode can be removed
from this explorer view. |
protected TreeCellRenderer |
createTreeCellRenderer(JTree tree)
Creates a tree cell renderer for the explorer view.
|
IlvDataContainer |
getDataContainer()
Returns the data container associated with this explorer view.
|
protected Object |
getDataContainerNode(Object treeNode)
Returns the data container node associated with the specified
treeNode or null . |
protected String |
getNewFolderName(Object parent)
Gets a name for a new folder to be created.
|
protected Icon |
getNodeIcon(Object node,
boolean expanded)
Returns an icon for the tree node associated with the specified data
container
node . |
protected String |
getNodeText(Object node)
Gets the text for the tree node associated with the specified data
container
node . |
protected void |
initializeTree(JTree tree)
Invoked by the
initializeView(ilog.views.appframe.docview.IlvDocument) method after the
IlvTreeView.createTree() method has been called, for initializing the
newly created tree . |
protected void |
initializeView(IlvDataContainer dataContainer)
Initializes the explorer view with the specified data container.
|
void |
initializeView(IlvDocument document)
Initializes the tree view with the specified document.
|
protected Object[] |
insertNewFiles(Object parent)
Inserts a new file reference into the specified data container
parent
node. |
protected Object |
insertNewFolder(Object parent)
Inserts a new folder into the specified data container
parent
node. |
protected Object[] |
insertNewProject(Object parent)
Inserts a new project reference into the specified data container
parent
node. |
boolean |
isProcessingAction(String command)
Determines whether the explorer view is able to perform the action
with the specified
command key in its
actionPerformed(java.awt.event.ActionEvent) method. |
protected void |
nodeDoubleClicked(MouseEvent e,
TreeNode treeNode,
Object userData)
Invoked when a tree node has been double-clicked in the explorer view.
|
protected void |
nodeRightClicked(MouseEvent e,
TreeNode treeNode,
Object node)
Invoked when a tree node has been right-clicked in the explorer view.
|
protected boolean |
openNodes(Object[] nodes)
Opens the selected
nodes of
the data container associated with this explorer view. |
protected void |
readSettings(IlvSettingsElement settingsElement)
Reads the settings of the tree view.
|
protected boolean |
removeNodes(Object[] nodes)
Removes the selected data container
nodes from
the data container associated with this explorer view. |
boolean |
updateAction(Action action)
Invoked by the application for updating the state of the specified
action . |
protected void |
writeSettings(IlvSettingsElement settingsElement)
Writes the settings of the tree view.
|
addTree, createTree, getProperty, getTree, setProperty, setTree, viewClosed, viewClosing
addActionHandler, close, getApplication, getDocument, getSettings, getSettingsElement, getSettingsName, getSettingsQuery, getSettingsType, getViewContainer, isStaticView, receiveMessage, registerMappings, removeActionHandler, setApplication, setDocument, setSettings, setSettingsElement, setSettingsName, setSettingsQuery, setViewContainer
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
public static final String INSERT_FOLDER_CMD
public static final String INSERT_FILE_CMD
public static final String INSERT_PROJECT_CMD
public static final String REMOVE_NODE_CMD
public static final String OPEN_PROJECT_NODE_CMD
protected IlvExplorerView(String settingsType, String defaultSettingsName)
settingsType
.settingsType
- The type of the settings element providing 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 IlvExplorerView()
IlvExplorerView
.public void initializeView(IlvDocument document)
DOCUMENT_PROPERTY
of the view.initializeView
in interface IlvDocumentView
initializeView
in class IlvTreeView
document
- The document to initialize the content of the tree view from.protected void initializeView(IlvDataContainer dataContainer)
dataContainer
- The data container to initialize the explorer view from.protected void initializeTree(JTree tree)
initializeView(ilog.views.appframe.docview.IlvDocument)
method after the
IlvTreeView.createTree()
method has been called, for initializing the
newly created tree
. A new selection listener is added
to the specified tree
.initializeTree
in class IlvTreeView
tree
- The tree to initialize.public IlvDataContainer getDataContainer()
IlvDataContainerProvider
interface.null
if the document
of the view does not implement the
IlvDataContainerProvider
interface.IlvDataContainerProvider
,
IlvDataContainerDocument
protected Icon getNodeIcon(Object node, boolean expanded)
node
.node
- The data container node to associate an icon with.expanded
- The expanded state to get the icon for.
If true
, the icon for the expanded state is required;
if false
, the icon for the collapsed state is required.null
.protected String getNodeText(Object node)
node
.protected TreeCellRenderer createTreeCellRenderer(JTree tree)
createTreeCellRenderer
in class IlvTreeView
IlvTreeView.createTree()
protected void readSettings(IlvSettingsElement settingsElement)
readSettings
in class IlvPanelView
settingsElement
- The root settings element that contains the
settings for this tree view.protected void writeSettings(IlvSettingsElement settingsElement)
writeSettings
in class IlvPanelView
settingsElement
- The root settings element to write the settings to.protected void nodeDoubleClicked(MouseEvent e, TreeNode treeNode, Object userData)
userData
.nodeDoubleClicked
in class IlvTreeView
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
.IlvTreeView.initializeTree(javax.swing.JTree)
protected void nodeRightClicked(MouseEvent e, TreeNode treeNode, Object node)
node
.nodeRightClicked
in class IlvTreeView
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.node
- The node of the associated data container that corresponds to
the specified treeNode
.IlvDataContainer.getCategory(java.lang.Object)
public boolean isProcessingAction(String command)
command
key in its
actionPerformed(java.awt.event.ActionEvent)
method.isProcessingAction
in interface ActionHandler
isProcessingAction
in class IlvPanelView
command
- The command key of the action.true
if the tree view performs the specified
action; false
otherwise.public boolean updateAction(Action action)
action
.updateAction
in interface ActionHandler
updateAction
in class IlvPanelView
action
- The action to update.true
if the listener has updated the state of the
action; false
otherwise.public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
actionPerformed
in class IlvPanelView
e
- The action event.protected Object insertNewFolder(Object parent)
parent
node. This method is invoked when processing the action with the
command key INSERT_FOLDER_CMD
.
By default, a new folder name is requested from the user by invoking
the method getNewFolderName(java.lang.Object)
.
If a name has been selected, it is used for inserting a new folder
into the specified parent
node.
parent
- The data container parent node to insert a new folder into.null
otherwise.getNewFolderName(java.lang.Object)
,
IlvProjectDataContainer.insertFolder(java.lang.Object, java.lang.String, int)
protected Object[] insertNewFiles(Object parent)
parent
node. This method is invoked when processing the action with the
command key INSERT_FILE_CMD
.
By default, a file chooser is displayed, asking the user to select
one or several pathnames. If at least one pathname has been selected,
the corresponding file references are added to the specified parent
by invoking the method IlvProjectDataContainer.insertFileReference(Object, java.net.URL, int)
of the associated data container.
parent
- The data container parent node to insert new file references
into.null
otherwise.IlvProjectDataContainer.insertFileReference(Object, java.net.URL, int)
protected Object[] insertNewProject(Object parent)
parent
node. This method is invoked when processing the action with the
command key INSERT_PROJECT_CMD
.
By default, a file chooser is displayed, asking the user to select
one or several pathnames. If at least one pathname has been selected,
the corresponding file references are added to the specified parent
by invoking the method IlvProjectDataContainer.insertFileReference(Object, java.net.URL, int)
of the associated data container.
parent
- The data container parent node to insert the new project reference
into.null
otherwise.IlvWorkspaceDataContainer.addFileProjectReference(Object, String, int)
protected boolean removeNodes(Object[] nodes)
nodes
from
the data container associated with this explorer view.
This method is invoked when processing the action with the
command key REMOVE_NODE_CMD
.nodes
- The data container nodes to remove.true
if the specified nodes could be removed from
the data container associated with this explorer view; false
otherwise.IlvProjectDataContainer.canRemove(Object, Object)
,
IlvDefaultDataContainer.removeNode(Object, Object)
,
canRemoveNodes(java.lang.Object[])
protected boolean canRemoveNodes(Object[] nodes)
nodes
can
be removed from their data container.
This method is called when updating the state of the action with the
command key REMOVE_NODE_CMD
. By default, the method
IlvDataContainer.canRemove(Object, Object)
is called for all the specified nodes. If it returns false
for at least one node, false
will be returned. Otherwise, the
method returns true
.nodes
- The nodes to remove.true
if the specified nodes can be removed from the
associated data container; false
otherwise.IlvDefaultDataContainer.removeNode(Object, Object)
protected boolean openNodes(Object[] nodes)
nodes
of
the data container associated with this explorer view.
This method is invoked when processing the action with the
command key OPEN_PROJECT_NODE_CMD
.nodes
- The data container nodes to open.true
if the specified nodes could be opened;
false
otherwise.IlvDataContainerDocument.openDocument(Object)
,
IlvDataContainerDocument.canOpenDocument(Object)
,
canOpenNodes(java.lang.Object[])
protected boolean canOpenNodes(Object[] nodes)
nodes
of the data container
associated with this explorer view can be opened.
This method is called when updating the state of the action with the
command key OPEN_PROJECT_NODE_CMD
. By default, the method
IlvDataContainerDocument.canOpenDocument(Object)
is called for all the specified nodes. If it returns false
for at least one node, false
will be returned. Otherwise, the
method returns true
.
nodes
- The nodes to open.true
if the specified nodes can be opened;
false
otherwise.openNodes(java.lang.Object[])
,
IlvDataContainerDocument.canOpenDocument(Object)
protected String getNewFolderName(Object parent)
parent
- The parent node of the new folder to create.protected boolean canRemoveTreeNode(TreeNode treeNode)
treeNode
can be removed
from this explorer view. By default, the method canRemoveDataContainerNode(java.lang.Object, java.lang.Object)
is called with the corresponding data container nodes as the parameters.protected Object getDataContainerNode(Object treeNode)
treeNode
or null
.getDataContainer()
protected boolean canRemoveDataContainerNode(Object parent, Object node)
node
can be
removed. By default, the method IlvDataContainer.canRemove(java.lang.Object, java.lang.Object)
of the data container of the view is called with the parameters of this
method as the parameters.parent
- The parent node of the node to remove.node
- The node to remove.getDataContainer()
,
IlvDataContainer.canRemove(java.lang.Object, java.lang.Object)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.