|
|
Package com.dassault_systemes.catjdialog |
Class CATTree
|
Class Hierarchy |
java.lang.Object | +-com.dassault_systemes.catjdialog.CATCallbackSource | +-com.dassault_systemes.catjdialog.CATDialog | +-com.dassault_systemes.catjdialog.CATTree
Class Location |
Class Description |
public class CATTree
The tree graphical component.
All Implemented Interfaces: CATIMenuProvider CATIMenuFirer
Field Summary |
Constructor Summary |
CATTree(CATDialog iParent, String iName) |
Method Summary |
Field Detail |
Constructor Detail |
CATTree(CATDialog iParent, String iName)Creates a tree with the specified parent and name.
iParent
iName
Method Detail |
void setModelURL(String iModelURL)Sets the tree model URL.
The expected format is: <model classname>@<arg1>,<arg2>,...
<model classname>
must have a constructor with the following signature:
void <Constructor>(CATDialog iDialog, String[] iArgs)
Note: This method allows to set the tree model inline in the XMLDlg file.
Example: <Tree Name="MyTree" ModelURL="com.mypackage.MyKeyTreeModel@myarg"...
iModelURL
null
value empties this tree.String getModelURL()Returns the tree model URL (if any).
setModelURL()
.void setDisplayRoot(boolean iDisplay)Sets whether or not the root node is displayed. By default it is displayed.
iDisplay
true
, the root node is displayed; otherwise it is hidden.boolean getDisplayRoot()Returns whether or not the root node is displayed.
true
if the root node is displayed; false
otherwise.void setScrollable(boolean iScollable)Enables/disables the tree scroll. By default it is enabled.
When the scroll is enabled, scrollbars are only displayed when necessary (condition is "available area < tree size")
iScollable
true
, the scroll is enabled; otherwise it is disabled.boolean getScrollable()Determines whether the scroll is enabled or not.
true
if the scroll is enabled; false
otherwise.void setMinRows(int iMinRows)Set the minimum visible rows. Default is 13.
This is used to "ensure" a minimum height for rendering the tree.
iMinRows
int getMinRows()Returns the minimum visible rows.
void setMinWidth(int iMinWidth)Set the minimum width (in characters) of the tree. Default is 26.
This is used to "ensure" a minimum width for rendering the tree
iMinWidth
int getMinWidth()Returns the minimum width (in characters).
boolean getMultipleSelection()Determines whether multiple selection is enabled or not. Default is disabled (false).
true
if multiple selection is enabled; false
otherwise.void setMultipleSelection(boolean iMultiple)Enables/disables multipe selection. Default is disabled.
iMultiple
true
, multiple selection is enabled; otherwise it is disabled.void unselectAll()Unselects all tree nodes.
Runs both for single and multiple selection.
boolean hasMenu()Determines whether this tree has a contextual menu.
This checks that the tree model is of type CATKeyTreeModelCtxMenuEx or CATKeyPathTreeModelCtxMenuEx
true
if this tree has a menu, false
otherwise.CATMenuModel getMenu(Object iContext)Returns the menu model defining the tree contextual menu (may be null).
Invokes the menu from the tree model.
iContext
CATMenuNotification getMenuNotification()Returns the menu notification.
This notification is sent when a contextual menu command is triggered.
CATTreeExpandNotification getExpandNotification()Returns the expand notification.
This notification is sent when a tree node is expanded.
Note: this notification is only published for very specific
needs. Trees should not have special behavior on expand.
CATNotification getSelectionNotification()Returns the selection notification.
This notification is sent when the tree selection changes.
CATTreeCommandNotification getCommandNotification()Returns the menu notification.
This notification is sent when a contextual menu command is triggered.
void setKeyModel(CATKeyTreeModel iModel)Sets the key tree model. A null value unsets the tree model.
iModel
CATKeyTreeModel getKeyModel()Returns the key tree model (may be null).
null
value means either this tree has no tree model, or it has a keypath tree model.void collapseKey(String iKey)Collapses a tree node.
This is reserved when using a tree model of type CATKeyTreeModel.
iKey
void expandKey(String iKey)Expands a tree node.
This is reserved when using a tree model of type CATKeyTreeModel.
iKey
boolean isKeyExpanded(String iKey)Determines whether a tree node is expanded.
This is reserved when using a tree model of type CATKeyTreeModel.
iKey
true
if the node is expanded; false
otherwise.boolean isKeySelected(String iKey)Determines whether a tree node is selected or not.
This is reserved when using a tree model of type CATKeyTreeModel.
iKey
true
if the node is selected; false
otherwise.void selectKey(String iKey)Selects a tree node.
This is reserved when using a tree model of type CATKeyTreeModel.
In single selection mode, calling this method updates the selection,
In multiple selection mode, calling this method adds the key to the selection.
iKey
void unselectKey(String iKey)Unselects a tree node.
This is reserved when using a tree model of type CATKeyTreeModel.
In single selection mode, calling this method updates the selection,
In multiple selection mode, calling this method removes the key from the selection.
iKey
void setSelectedKeys(String[] iKeys)Selects a bunch of tree nodes (a null value unselects all nodes).
This is reserved when using a tree model of type CATKeyTreeModel in multiple selection mode.
Calling this method replaces the current selection with the specified one.
iKeys
String getSelectedKey()Returns the selected tree node key (may be null).
This is reserved when using a tree model of type CATKeyTreeModel in single selection mode.
String[] getSelectedKeys()Returns the selected tree nodes keys (may be null).
This is reserved when using a tree model of type CATKeyTreeModel in multiple selection mode.
void setKeyPathModel(CATKeyPathTreeModel iModel)Sets the key-path tree model. A null value unsets the tree model.
iModel
CATKeyPathTreeModel getKeyPathModel()Returns the key-path tree model (may be null).
null
value means either this tree has no tree model, or it has a key tree model.void collapseKeyPath(String[] iKeyPath)Collapses a tree node.
This is reserved when using a tree model of type CATKeyPathTreeModel.
iKeyPath
void expandKeyPath(String[] iKeyPath)Expands a tree node.
This is reserved when using a tree model of type CATKeyPathTreeModel.
iKeyPath
boolean isKeyPathExpanded(String[] iKeyPath)Determines whether a tree node is expanded.
This is reserved when using a tree model of type CATKeyPathTreeModel.
iKeyPath
true
if the node is expanded; false
otherwise.boolean isKeyPathSelected(String[] iKeyPath)Determines whether a tree node is selected or not.
This is reserved when using a tree model of type CATKeyPathTreeModel.
iKeyPath
true
if the node is selected; false
otherwise.void selectKeyPath(String[] iKeyPath)Selects a tree node.
This is reserved when using a tree model of type CATKeyPathTreeModel.
In single selection mode, calling this method updates the selection,
In multiple selection mode, calling this method adds the key to the selection.
iKeyPath
void unselectKeyPath(String[] iKeyPath)Unselects a tree node.
This is reserved when using a tree model of type CATKeyPathTreeModel.
In single selection mode, calling this method updates the selection,
In multiple selection mode, calling this method removes the key from the selection.
iKeyPath
void setSelectedKeyPaths(String[][] iKeyPaths)Selects a bunch of tree nodes (a null value unselects all nodes).
This is reserved when using a tree model of type CATKeyPathTreeModel in multiple selection mode.
Calling this method replaces the current selection with the specified one.
iKeyPaths
String[] getSelectedKeyPath()Returns the selected tree node key (may be null).
This is reserved when using a tree model of type CATKeyPathTreeModel in single selection mode.
String[][] getSelectedKeyPaths()Returns the selected tree nodes keys (may be null).
This is reserved when using a tree model of type CATKeyPathTreeModel in multiple selection mode.