|
|
|||||
| 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)
Creates a tree with the specified parent and name. |
| Method Summary |
| public void | collapseKey(String iKey)
Collapses a tree node. |
| public void | collapseKeyPath(String[] iKeyPath)
Collapses a tree node. |
| public void | expandKey(String iKey)
Expands a tree node. |
| public void | expandKeyPath(String[] iKeyPath)
Expands a tree node. |
| public CATTreeCommandNotification | getCommandNotification()
Returns the menu notification. |
| public boolean | getDisplayRoot()
Returns whether or not the root node is displayed. |
| public CATTreeExpandNotification | getExpandNotification()
Returns the expand notification. |
| public CATKeyTreeModel | getKeyModel()
Returns the key tree model (may be null). |
| public CATKeyPathTreeModel | getKeyPathModel()
Returns the key-path tree model (may be null). |
| public CATMenuModel | getMenu(Object iContext)
Returns the menu model defining the tree contextual menu (may be null). |
| public CATMenuNotification | getMenuNotification()
Returns the menu notification. |
| public int | getMinRows()
Returns the minimum visible rows. |
| public int | getMinWidth()
Returns the minimum width (in characters). |
| public String | getModelURL()
Returns the tree model URL (if any). |
| public boolean | getMultipleSelection()
Determines whether multiple selection is enabled or not. |
| public boolean | getScrollable()
Determines whether the scroll is enabled or not. |
| public String | getSelectedKey()
Returns the selected tree node key (may be null). |
| public String[] | getSelectedKeyPath()
Returns the selected tree node key (may be null). |
| public String[][] | getSelectedKeyPaths()
Returns the selected tree nodes keys (may be null). |
| public String[] | getSelectedKeys()
Returns the selected tree nodes keys (may be null). |
| public CATNotification | getSelectionNotification()
Returns the selection notification. |
| public boolean | hasMenu()
Determines whether this tree has a contextual menu. |
| public boolean | isKeyExpanded(String iKey)
Determines whether a tree node is expanded. |
| public boolean | isKeyPathExpanded(String[] iKeyPath)
Determines whether a tree node is expanded. |
| public boolean | isKeyPathSelected(String[] iKeyPath)
Determines whether a tree node is selected or not. |
| public boolean | isKeySelected(String iKey)
Determines whether a tree node is selected or not. |
| public void | selectKey(String iKey)
Selects a tree node. |
| public void | selectKeyPath(String[] iKeyPath)
Selects a tree node. |
| public void | setDisplayRoot(boolean iDisplay)
Sets whether or not the root node is displayed. |
| public void | setKeyModel(CATKeyTreeModel iModel)
Sets the key tree model. |
| public void | setKeyPathModel(CATKeyPathTreeModel iModel)
Sets the key-path tree model. |
| public void | setMinRows(int iMinRows)
Set the minimum visible rows. |
| public void | setMinWidth(int iMinWidth)
Set the minimum width (in characters) of the tree. |
| public void | setModelURL(String iModelURL)
Sets the tree model URL. |
| public void | setMultipleSelection(boolean iMultiple)
Enables/disables multipe selection. |
| public void | setScrollable(boolean iScollable)
Enables/disables the tree scroll. |
| public void | setSelectedKeyPaths(String[][] iKeyPaths)
Selects a bunch of tree nodes (a null value unselects all nodes). |
| public void | setSelectedKeys(String[] iKeys)
Selects a bunch of tree nodes (a null value unselects all nodes). |
| public void | unselectAll()
Unselects all tree nodes. |
| public void | unselectKey(String iKey)
Unselects a tree node. |
| public void | unselectKeyPath(String[] iKeyPath)
Unselects a tree node. |
| Field Detail |
| Constructor Detail |
CATTree(CATDialog iParent, String iName)
Creates a tree with the specified parent and name.
iParentiName| Method Detail |
public void collapseKey(String iKey)
Collapses a tree node.
This is reserved when using a tree model of type CATKeyTreeModel.
iKey
public void collapseKeyPath(String[] iKeyPath)
Collapses a tree node.
This is reserved when using a tree model of type CATKeyPathTreeModel.
iKeyPath
public void expandKey(String iKey)
Expands a tree node.
This is reserved when using a tree model of type CATKeyTreeModel.
iKey
public void expandKeyPath(String[] iKeyPath)
Expands a tree node.
This is reserved when using a tree model of type CATKeyPathTreeModel.
iKeyPath
public CATTreeCommandNotification getCommandNotification()
Returns the menu notification.
This notification is sent when a contextual menu command is triggered.
public boolean getDisplayRoot()
Returns whether or not the root node is displayed.
true if the root node is displayed; false otherwise.
public 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.
public 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.
public 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.
public CATMenuModel getMenu(Object iContext)
Returns the menu model defining the tree contextual menu (may be null).
Invokes the menu from the tree model.
iContext
public CATMenuNotification getMenuNotification()
Returns the menu notification.
This notification is sent when a contextual menu command is triggered.
public int getMinRows()
Returns the minimum visible rows.
public int getMinWidth()
Returns the minimum width (in characters).
public String getModelURL()
Returns the tree model URL (if any).
setModelURL().
public boolean getMultipleSelection()
Determines whether multiple selection is enabled or not. Default is disabled (false).
true if multiple selection is enabled; false otherwise.
public boolean getScrollable()
Determines whether the scroll is enabled or not.
true if the scroll is enabled; false otherwise.
public 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.
public 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.
public 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.
public 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.
public CATNotification getSelectionNotification()
Returns the selection notification.
This notification is sent when the tree selection changes.
public 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.
public boolean isKeyExpanded(String iKey)
Determines whether a tree node is expanded.
This is reserved when using a tree model of type CATKeyTreeModel.
iKeytrue if the node is expanded; false otherwise.
public boolean isKeyPathExpanded(String[] iKeyPath)
Determines whether a tree node is expanded.
This is reserved when using a tree model of type CATKeyPathTreeModel.
iKeyPathtrue if the node is expanded; false otherwise.
public boolean isKeyPathSelected(String[] iKeyPath)
Determines whether a tree node is selected or not.
This is reserved when using a tree model of type CATKeyPathTreeModel.
iKeyPathtrue if the node is selected; false otherwise.
public boolean isKeySelected(String iKey)
Determines whether a tree node is selected or not.
This is reserved when using a tree model of type CATKeyTreeModel.
iKeytrue if the node is selected; false otherwise.
public 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
public 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
public void setDisplayRoot(boolean iDisplay)
Sets whether or not the root node is displayed. By default it is displayed.
iDisplaytrue, the root node is displayed; otherwise it is hidden.
public void setKeyModel(CATKeyTreeModel iModel)
Sets the key tree model. A null value unsets the tree model.
iModel
public void setKeyPathModel(CATKeyPathTreeModel iModel)
Sets the key-path tree model. A null value unsets the tree model.
iModel
public 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
public 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
public 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"...
iModelURLnull value empties this tree.
public void setMultipleSelection(boolean iMultiple)
Enables/disables multipe selection. Default is disabled.
iMultipletrue, multiple selection is enabled; otherwise it is disabled.
public 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")
iScollabletrue, the scroll is enabled; otherwise it is disabled.
public 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
public 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
public void unselectAll()
Unselects all tree nodes.
Runs both for single and multiple selection.
public 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
public 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