NextApp Echo3 Extras
v3.0.b4

nextapp.echo.extras.app
Class Tree

java.lang.Object
  extended by nextapp.echo.app.Component
      extended by nextapp.echo.extras.app.Tree
All Implemented Interfaces:
java.io.Serializable, nextapp.echo.app.RenderIdSupport

public class Tree
extends nextapp.echo.app.Component

A control that displays a set of hierarchical data as an outline. Each row in the tree can have a number of columns, so this tree implementation is in fact a tree table.

See Also:
Serialized Form

Field Summary
static java.lang.String ACTION_LISTENERS_CHANGED_PROPERTY
           
static java.lang.String AUTO_CREATE_COLUMNS_FROM_MODEL_CHANGED_PROPERTY
           
static java.lang.String CELL_RENDERER_CHANGED_PROPERTY
           
static java.lang.String COLUMN_MODEL_CHANGED_PROPERTY
           
static java.lang.String COLUMN_WIDTH_CHANGED_PROPERTY
           
static java.lang.String DEFAULT_HEADER_RENDERER_CHANGED_PROPERTY
           
static java.lang.String DEFAULT_RENDERER_CHANGED_PROPERTY
           
static java.lang.String EXPAND_ACTION
           
static java.lang.String EXPANSION_STATE_CHANGED_PROPERTY
           
static int HEADER_ROW
           
static java.lang.String INPUT_ACTION
           
static int LINE_STYLE_DOTTED
           
static int LINE_STYLE_NONE
           
static int LINE_STYLE_SOLID
           
static java.lang.String MODEL_CHANGED_PROPERTY
           
static java.lang.String PROPERTY_ACTION_COMMAND
           
static java.lang.String PROPERTY_BORDER
           
static java.lang.String PROPERTY_HEADER_VISIBLE
           
static java.lang.String PROPERTY_INSETS
           
static java.lang.String PROPERTY_LINE_STYLE
           
static java.lang.String PROPERTY_NODE_CLOSED_BOTTOM_ICON
           
static java.lang.String PROPERTY_NODE_CLOSED_ICON
           
static java.lang.String PROPERTY_NODE_OPEN_BOTTOM_ICON
           
static java.lang.String PROPERTY_NODE_OPEN_ICON
           
static java.lang.String PROPERTY_ROLLOVER_BACKGROUND
           
static java.lang.String PROPERTY_ROLLOVER_BACKGROUND_IMAGE
           
static java.lang.String PROPERTY_ROLLOVER_BORDER
           
static java.lang.String PROPERTY_ROLLOVER_ENABLED
           
static java.lang.String PROPERTY_ROLLOVER_FONT
           
static java.lang.String PROPERTY_ROLLOVER_FOREGROUND
           
static java.lang.String PROPERTY_ROOT_VISIBLE
           
static java.lang.String PROPERTY_SELECTION_BACKGROUND
           
static java.lang.String PROPERTY_SELECTION_BACKGROUND_IMAGE
           
static java.lang.String PROPERTY_SELECTION_BORDER
           
static java.lang.String PROPERTY_SELECTION_ENABLED
           
static java.lang.String PROPERTY_SELECTION_FONT
           
static java.lang.String PROPERTY_SELECTION_FOREGROUND
           
static java.lang.String PROPERTY_SHOWS_ROOT_HANDLE
           
static java.lang.String PROPERTY_WIDTH
           
static java.lang.String SELECTION_CHANGED_PROPERTY
           
static java.lang.String SELECTION_MODE_CHANGED_PROPERTY
           
static java.lang.String SELECTION_MODEL_CHANGED_PROPERTY
           
 
Fields inherited from class nextapp.echo.app.Component
CHILD_VISIBLE_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY, FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
Tree()
          Constructs a new Tree with a default tree model.
Tree(TreeModel model)
          Constructs a new Tree with the specified model.
Tree(TreeModel model, TreeColumnModel columnModel)
          Constructs a new Tree with the specified model.
 
Method Summary
 void addActionListener(nextapp.echo.app.event.ActionListener l)
          Adds an ActionListener to the Tree.
 void addTreeExpansionListener(TreeExpansionListener l)
          Adds a TreeExpansionListener to the Tree.
 void collapse(TreePath path)
          Collapse the node identified by the given path.
 void collapseAll()
          Collapse all nodes in the tree.
protected  void collapseAll(TreePath path)
          Collapse the node identified by the given path and all nodes below it.
 void createDefaultColumnsFromModel()
          Creates a TableColumnModel based on the TableModel.
 void dispose()
           
 void expand(TreePath path)
          Expand the node identified by the given path.
 void expandAll()
          Expand all nodes in the tree.
protected  void expandAll(TreePath path)
          Expand the node identified by the given path, and all nodes below it.
protected  void fireExpansionStateUpdate(TreePath treePath, boolean newState)
          Notifies all TreeExpansionListeners that the expansion state has changed.
 java.lang.String getActionCommand()
          Returns the action command which will be provided in ActionEvents fired by this Tree.
 nextapp.echo.app.Border getBorder()
          Returns the Border.
 TreeCellRenderer getCellRenderer()
          Retrieves the TreeCellRenderer used to render values contained in the tree.
 TreeColumnModel getColumnModel()
          Returns the TreeColumnModel describing this tree's columns.
 nextapp.echo.app.Component getComponent(int row, int column)
          Returns the component that is rendered at the given location.
 nextapp.echo.app.Component getComponent(TreePath path, int column)
          Returns the component that is rendered for the tree column of the given path.
 TreeCellRenderer getDefaultHeaderRenderer()
          Returns the default TreeCellRenderer used to render header cells.
 TreeCellRenderer getDefaultRenderer(java.lang.Class columnClass)
          Returns the default TreeCellRenderer for the specified column class.
 nextapp.echo.app.Insets getInsets()
          Returns the default cell insets.
 int getLineStyle()
          Retrieves the line style that is used to render the lines that connect the nodes.
 TreeModel getModel()
          Returns the TreeModel being visualized by this Tree.
 nextapp.echo.app.ImageReference getNodeClosedBottomIcon()
          Retrieves the icon that is rendered for closed bottom nodes.
 nextapp.echo.app.ImageReference getNodeClosedIcon()
          Retrieves the icon that is rendered for closed nodes.
 nextapp.echo.app.ImageReference getNodeOpenBottomIcon()
          Retrieves the icon that is rendered for opened bottom nodes.
 nextapp.echo.app.ImageReference getNodeOpenIcon()
          Retrieves the icon that is rendered for opened nodes.
 TreePath getPathForRow(int row)
           
 nextapp.echo.app.Color getRolloverBackground()
          Return the rollover background color displayed when the mouse is within the bounds of a row.
 nextapp.echo.app.FillImage getRolloverBackgroundImage()
          Return the rollover background image displayed when the mouse is within the bounds of a row.
 nextapp.echo.app.Border getRolloverBorder()
          Return the rollover border displayed when the mouse is within the bounds of a row.
 nextapp.echo.app.Font getRolloverFont()
          Return the rollover font displayed when the mouse is within the bounds of a row.
 nextapp.echo.app.Color getRolloverForeground()
          Return the rollover foreground color displayed when the mouse is within the bounds of a row.
 int getRowForPath(TreePath path)
          Returns the index of the row the path is currently rendered to.
 nextapp.echo.app.Color getSelectionBackground()
          Returns the row selection background color.
 nextapp.echo.app.FillImage getSelectionBackgroundImage()
          Returns the row selection background image.
 nextapp.echo.app.Border getSelectionBorder()
          Returns the row selection border.
 nextapp.echo.app.Font getSelectionFont()
          Returns the row selection font.
 nextapp.echo.app.Color getSelectionForeground()
          Returns the row selection foreground color.
 TreeSelectionModel getSelectionModel()
          Returns the row selection model.
 nextapp.echo.app.Extent getWidth()
          Returns the overall width of the tree.
 void init()
           
 boolean isAutoCreateColumnsFromModel()
          Determines whether the TableColumnModel will be created automatically from the TreeModel.
 boolean isExpanded(int row)
           
 boolean isExpanded(TreePath treePath)
           
 boolean isHeaderVisible()
          Determines if the tree header is visible.
 boolean isRolloverEnabled()
          Determines if rollover effects are enabled.
 boolean isRootVisible()
          Returns true if the root node of the tree is displayed.
 boolean isSelectionEnabled()
          Determines if selection is enabled.
 boolean isShowsRootHandle()
          Determines whether the handle of the root node should be shown.
 void processInput(java.lang.String inputName, java.lang.Object inputValue)
           
 void removeActionListener(nextapp.echo.app.event.ActionListener l)
          Removes an ActionListener from the Tree.
 void removeTreeExpansionListener(TreeExpansionListener l)
          Removes a TreeExpansionListener from the Tree.
 void setActionCommand(java.lang.String newValue)
          Sets the action command which will be provided in ActionEvents fired by this Tree.
 void setAutoCreateColumnsFromModel(boolean newValue)
          Sets whether the TableColumnModel will be created automatically from the TableModel.
 void setBorder(nextapp.echo.app.Border newValue)
          Sets the Border.
 void setCellRenderer(TreeCellRenderer newValue)
          Sets the TreeCellRenderer used to render values contained in the tree.
 void setColumnModel(TreeColumnModel newValue)
          Sets the TreeColumnModel describing this tree's columns.
 void setDefaultHeaderRenderer(TreeCellRenderer newValue)
          Sets the default TreeCellRenderer used to render header cells.
 void setDefaultRenderer(java.lang.Class columnClass, TreeCellRenderer newValue)
          Sets the default TreeCellRenderer for the specified column class.
 void setExpandedState(TreePath treePath, boolean state)
          Set the expansion state for the given tree path.
 void setHeaderVisible(boolean newValue)
          Sets the visibility state of the tree header.
 void setInsets(nextapp.echo.app.Insets newValue)
          Sets the default cell insets.
 void setLineStyle(int newValue)
          Sets the line style that is used to render the lines that connect the nodes.
 void setModel(TreeModel newValue)
          Sets the TreeModel being visualized.
 void setNodeClosedBottomIcon(nextapp.echo.app.ImageReference newValue)
          Sets the icon that is rendered for closed bottom nodes.
 void setNodeClosedIcon(nextapp.echo.app.ImageReference newValue)
          Sets the icon that is rendered for closed nodes.
 void setNodeOpenBottomIcon(nextapp.echo.app.ImageReference newValue)
          Sets the icon that is rendered for opened bottom nodes.
 void setNodeOpenIcon(nextapp.echo.app.ImageReference newValue)
          Sets the icon that is rendered for opened nodes.
 void setRolloverBackground(nextapp.echo.app.Color newValue)
          Sets the rollover background color displayed when the mouse is within the bounds of a row.
 void setRolloverBackgroundImage(nextapp.echo.app.FillImage newValue)
          Sets the rollover background image displayed when the mouse is within the bounds of a row.
 void setRolloverBorder(nextapp.echo.app.Border newValue)
          Sets the rollover border displayed when the mouse is within the bounds of a row.
 void setRolloverEnabled(boolean newValue)
          Sets whether rollover effects are enabled when the mouse cursor is within the bounds of a row.
 void setRolloverFont(nextapp.echo.app.Font newValue)
          Sets the rollover font displayed when the mouse is within the bounds of a row.
 void setRolloverForeground(nextapp.echo.app.Color newValue)
          Sets the rollover foreground color displayed when the mouse is within the bounds of a row.
 void setRootVisible(boolean newValue)
          Determines whether or not the root node from the TreeModel is visible.
 void setSelectionBackground(nextapp.echo.app.Color newValue)
          Sets the row selection background color.
 void setSelectionBackgroundImage(nextapp.echo.app.FillImage newValue)
          Sets the row selection background image.
 void setSelectionBorder(nextapp.echo.app.Border newValue)
          Sets the row selection border.
 void setSelectionEnabled(boolean newValue)
          Sets whether selection is enabled.
 void setSelectionFont(nextapp.echo.app.Font newValue)
          Sets the row selection font.
 void setSelectionForeground(nextapp.echo.app.Color newValue)
          Sets the row selection foreground color.
 void setSelectionModel(TreeSelectionModel newValue)
          Sets the row selection model.
 void setShowsRootHandle(boolean newValue)
          Determines whether the handle of the root node should be shown.
 void setWidth(nextapp.echo.app.Extent newValue)
          Sets the overall width of the tree.
 void validate()
           
 
Methods inherited from class nextapp.echo.app.Component
add, add, addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, get, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndex, getLayoutData, getLayoutDirection, getLocale, getLocalStyle, getParent, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidChild, isValidParent, isVisible, remove, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, set, setBackground, setComponents, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndex, setLayoutData, setLayoutDirection, setLocale, setRenderId, setStyle, setStyleName, setVisible, verifyInput, visibleIndexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_ACTION_COMMAND

public static final java.lang.String PROPERTY_ACTION_COMMAND
See Also:
Constant Field Values

PROPERTY_BORDER

public static final java.lang.String PROPERTY_BORDER
See Also:
Constant Field Values

PROPERTY_HEADER_VISIBLE

public static final java.lang.String PROPERTY_HEADER_VISIBLE
See Also:
Constant Field Values

PROPERTY_INSETS

public static final java.lang.String PROPERTY_INSETS
See Also:
Constant Field Values

PROPERTY_LINE_STYLE

public static final java.lang.String PROPERTY_LINE_STYLE
See Also:
Constant Field Values

PROPERTY_NODE_CLOSED_ICON

public static final java.lang.String PROPERTY_NODE_CLOSED_ICON
See Also:
Constant Field Values

PROPERTY_NODE_CLOSED_BOTTOM_ICON

public static final java.lang.String PROPERTY_NODE_CLOSED_BOTTOM_ICON
See Also:
Constant Field Values

PROPERTY_NODE_OPEN_ICON

public static final java.lang.String PROPERTY_NODE_OPEN_ICON
See Also:
Constant Field Values

PROPERTY_NODE_OPEN_BOTTOM_ICON

public static final java.lang.String PROPERTY_NODE_OPEN_BOTTOM_ICON
See Also:
Constant Field Values

PROPERTY_ROLLOVER_BACKGROUND

public static final java.lang.String PROPERTY_ROLLOVER_BACKGROUND
See Also:
Constant Field Values

PROPERTY_ROLLOVER_BACKGROUND_IMAGE

public static final java.lang.String PROPERTY_ROLLOVER_BACKGROUND_IMAGE
See Also:
Constant Field Values

PROPERTY_ROLLOVER_BORDER

public static final java.lang.String PROPERTY_ROLLOVER_BORDER
See Also:
Constant Field Values

PROPERTY_ROLLOVER_ENABLED

public static final java.lang.String PROPERTY_ROLLOVER_ENABLED
See Also:
Constant Field Values

PROPERTY_ROLLOVER_FONT

public static final java.lang.String PROPERTY_ROLLOVER_FONT
See Also:
Constant Field Values

PROPERTY_ROLLOVER_FOREGROUND

public static final java.lang.String PROPERTY_ROLLOVER_FOREGROUND
See Also:
Constant Field Values

PROPERTY_ROOT_VISIBLE

public static final java.lang.String PROPERTY_ROOT_VISIBLE
See Also:
Constant Field Values

PROPERTY_SELECTION_BACKGROUND

public static final java.lang.String PROPERTY_SELECTION_BACKGROUND
See Also:
Constant Field Values

PROPERTY_SELECTION_BACKGROUND_IMAGE

public static final java.lang.String PROPERTY_SELECTION_BACKGROUND_IMAGE
See Also:
Constant Field Values

PROPERTY_SELECTION_BORDER

public static final java.lang.String PROPERTY_SELECTION_BORDER
See Also:
Constant Field Values

PROPERTY_SELECTION_ENABLED

public static final java.lang.String PROPERTY_SELECTION_ENABLED
See Also:
Constant Field Values

PROPERTY_SELECTION_FONT

public static final java.lang.String PROPERTY_SELECTION_FONT
See Also:
Constant Field Values

PROPERTY_SELECTION_FOREGROUND

public static final java.lang.String PROPERTY_SELECTION_FOREGROUND
See Also:
Constant Field Values

PROPERTY_SHOWS_ROOT_HANDLE

public static final java.lang.String PROPERTY_SHOWS_ROOT_HANDLE
See Also:
Constant Field Values

PROPERTY_WIDTH

public static final java.lang.String PROPERTY_WIDTH
See Also:
Constant Field Values

EXPAND_ACTION

public static final java.lang.String EXPAND_ACTION
See Also:
Constant Field Values

INPUT_ACTION

public static final java.lang.String INPUT_ACTION
See Also:
Constant Field Values

ACTION_LISTENERS_CHANGED_PROPERTY

public static final java.lang.String ACTION_LISTENERS_CHANGED_PROPERTY
See Also:
Constant Field Values

AUTO_CREATE_COLUMNS_FROM_MODEL_CHANGED_PROPERTY

public static final java.lang.String AUTO_CREATE_COLUMNS_FROM_MODEL_CHANGED_PROPERTY
See Also:
Constant Field Values

CELL_RENDERER_CHANGED_PROPERTY

public static final java.lang.String CELL_RENDERER_CHANGED_PROPERTY
See Also:
Constant Field Values

COLUMN_MODEL_CHANGED_PROPERTY

public static final java.lang.String COLUMN_MODEL_CHANGED_PROPERTY
See Also:
Constant Field Values

COLUMN_WIDTH_CHANGED_PROPERTY

public static final java.lang.String COLUMN_WIDTH_CHANGED_PROPERTY
See Also:
Constant Field Values

DEFAULT_HEADER_RENDERER_CHANGED_PROPERTY

public static final java.lang.String DEFAULT_HEADER_RENDERER_CHANGED_PROPERTY
See Also:
Constant Field Values

DEFAULT_RENDERER_CHANGED_PROPERTY

public static final java.lang.String DEFAULT_RENDERER_CHANGED_PROPERTY
See Also:
Constant Field Values

EXPANSION_STATE_CHANGED_PROPERTY

public static final java.lang.String EXPANSION_STATE_CHANGED_PROPERTY
See Also:
Constant Field Values

MODEL_CHANGED_PROPERTY

public static final java.lang.String MODEL_CHANGED_PROPERTY
See Also:
Constant Field Values

SELECTION_CHANGED_PROPERTY

public static final java.lang.String SELECTION_CHANGED_PROPERTY
See Also:
Constant Field Values

SELECTION_MODEL_CHANGED_PROPERTY

public static final java.lang.String SELECTION_MODEL_CHANGED_PROPERTY
See Also:
Constant Field Values

SELECTION_MODE_CHANGED_PROPERTY

public static final java.lang.String SELECTION_MODE_CHANGED_PROPERTY
See Also:
Constant Field Values

LINE_STYLE_NONE

public static final int LINE_STYLE_NONE
See Also:
Constant Field Values

LINE_STYLE_SOLID

public static final int LINE_STYLE_SOLID
See Also:
Constant Field Values

LINE_STYLE_DOTTED

public static final int LINE_STYLE_DOTTED
See Also:
Constant Field Values

HEADER_ROW

public static final int HEADER_ROW
See Also:
Constant Field Values
Constructor Detail

Tree

public Tree()
Constructs a new Tree with a default tree model.


Tree

public Tree(TreeModel model)
Constructs a new Tree with the specified model.

If the model has a root node, it will be expanded by default.

Parameters:
model - the model

Tree

public Tree(TreeModel model,
            TreeColumnModel columnModel)
Constructs a new Tree with the specified model.

If the model has a root node, it will be expanded by default.

Parameters:
model - the model
Method Detail

addActionListener

public void addActionListener(nextapp.echo.app.event.ActionListener l)
Adds an ActionListener to the Tree. ActionListeners will be invoked when the user selects a row.

Parameters:
l - the ActionListener to add

collapse

public void collapse(TreePath path)
Collapse the node identified by the given path. Any nodes below it will not be collapsed, so, if this node is expanded all nodes below this node that have the expanded state will be rendered expanded.

Parameters:
path - the path to collapse

collapseAll

public void collapseAll()
Collapse all nodes in the tree.


collapseAll

protected void collapseAll(TreePath path)
Collapse the node identified by the given path and all nodes below it.

Parameters:
path - the path to collapse

createDefaultColumnsFromModel

public void createDefaultColumnsFromModel()
Creates a TableColumnModel based on the TableModel. This method is invoked automatically when the TableModel's structure changes if the autoCreateColumnsFromModel flag is set.


expand

public void expand(TreePath path)
Expand the node identified by the given path.

Parameters:
path - the path to expand

expandAll

public void expandAll()
Expand all nodes in the tree.


expandAll

protected void expandAll(TreePath path)
Expand the node identified by the given path, and all nodes below it.

Parameters:
path - the path to expand

getActionCommand

public java.lang.String getActionCommand()
Returns the action command which will be provided in ActionEvents fired by this Tree.

Returns:
the action command

getBorder

public nextapp.echo.app.Border getBorder()
Returns the Border.

Returns:
the border

getCellRenderer

public TreeCellRenderer getCellRenderer()
Retrieves the TreeCellRenderer used to render values contained in the tree. The value of this property may be null, in which case the tree should revert to using its default cell renderer.

Returns:
the cell renderer

getColumnModel

public TreeColumnModel getColumnModel()
Returns the TreeColumnModel describing this tree's columns.

Returns:
the column model

getDefaultHeaderRenderer

public TreeCellRenderer getDefaultHeaderRenderer()
Returns the default TreeCellRenderer used to render header cells. The default header renderer will be used in the event that a TreeColumn does not provide a specific header renderer.

Returns:
the TreeCellRenderer

getDefaultRenderer

public TreeCellRenderer getDefaultRenderer(java.lang.Class columnClass)
Returns the default TreeCellRenderer for the specified column class. The default renderer will be used in the event that a TreeColumn does not provide a specific renderer.

Parameters:
columnClass - the column Class
Returns:
the TreeCellRenderer

getInsets

public nextapp.echo.app.Insets getInsets()
Returns the default cell insets.

Returns:
the default cell insets

dispose

public void dispose()
Overrides:
dispose in class nextapp.echo.app.Component
See Also:
Component.dispose()

init

public void init()
Overrides:
init in class nextapp.echo.app.Component
See Also:
Component.init()

getModel

public TreeModel getModel()
Returns the TreeModel being visualized by this Tree.

Returns:
the model

processInput

public void processInput(java.lang.String inputName,
                         java.lang.Object inputValue)
Overrides:
processInput in class nextapp.echo.app.Component
See Also:
Component.processInput(java.lang.String, java.lang.Object)

setAutoCreateColumnsFromModel

public void setAutoCreateColumnsFromModel(boolean newValue)
Sets whether the TableColumnModel will be created automatically from the TableModel.

Parameters:
newValue - true if the TableColumnModel should be created automatically from the TableModel
See Also:
isAutoCreateColumnsFromModel()

setActionCommand

public void setActionCommand(java.lang.String newValue)
Sets the action command which will be provided in ActionEvents fired by this Tree.

Parameters:
newValue - the new action command

setBorder

public void setBorder(nextapp.echo.app.Border newValue)
Sets the Border.

Parameters:
newValue - the new border

setCellRenderer

public void setCellRenderer(TreeCellRenderer newValue)
Sets the TreeCellRenderer used to render values contained in the tree. The value of this property may be null, in which case the tree should revert to using its default cell renderer.

Parameters:
newValue - the new cell renderer

setColumnModel

public void setColumnModel(TreeColumnModel newValue)
Sets the TreeColumnModel describing this tree's columns.

Parameters:
newValue - the new column model

setDefaultHeaderRenderer

public void setDefaultHeaderRenderer(TreeCellRenderer newValue)
Sets the default TreeCellRenderer used to render header cells. The default header renderer will be used in the event that a TreeColumn does not provide a specific header renderer.

Parameters:
newValue - the TreeCellRenderer

setDefaultRenderer

public void setDefaultRenderer(java.lang.Class columnClass,
                               TreeCellRenderer newValue)
Sets the default TreeCellRenderer for the specified column class. The default renderer will be used in the event that a TreeColumn does not provide a specific renderer.

Parameters:
columnClass - the column Class
newValue - the TreeCellRenderer

setExpandedState

public void setExpandedState(TreePath treePath,
                             boolean state)
Set the expansion state for the given tree path. When a tree path is expanded, all parent paths will be expanded too.

Parameters:
treePath - the path to expand or collapse
state - the new expansion state

setHeaderVisible

public void setHeaderVisible(boolean newValue)
Sets the visibility state of the tree header.

Parameters:
newValue - true if the header should be displayed

setInsets

public void setInsets(nextapp.echo.app.Insets newValue)
Sets the default cell insets.

Parameters:
newValue - the new default cell insets

fireExpansionStateUpdate

protected void fireExpansionStateUpdate(TreePath treePath,
                                        boolean newState)
Notifies all TreeExpansionListeners that the expansion state has changed.

Fires a PropertyChangeEvent for the EXPANSION_STATE_CHANGED_PROPERTY with value null for old and new value.

Parameters:
treePath - the path to fire the expansion event for
newState - the new expansion state for the given path

isAutoCreateColumnsFromModel

public boolean isAutoCreateColumnsFromModel()
Determines whether the TableColumnModel will be created automatically from the TreeModel. If this flag is set, changes to the TreeModel will automatically cause the TableColumnModel to be re-created. This flag is true by default unless a TableColumnModel is specified in the constructor.

Returns:
true if the TableColumnModel will be created automatically from the TreeModel

isExpanded

public boolean isExpanded(int row)
Parameters:
row - the row to get the expanded state for
Returns:
true if the tree path on the given row is expanded, false if not
Throws:
java.lang.IndexOutOfBoundsException - when the given row is invalid

isExpanded

public boolean isExpanded(TreePath treePath)
Parameters:
treePath - the tree path to get the expanded state for
Returns:
true if the given tree path is expanded, false if not

isHeaderVisible

public boolean isHeaderVisible()
Determines if the tree header is visible.

Returns:
the header visibility state

isRolloverEnabled

public boolean isRolloverEnabled()
Determines if rollover effects are enabled.

Returns:
true if rollover effects are enabled
See Also:
setRolloverEnabled(boolean)

isRootVisible

public boolean isRootVisible()
Returns true if the root node of the tree is displayed.

Returns:
true if the root node of the tree is displayed
See Also:
setRootVisible(boolean)

isSelectionEnabled

public boolean isSelectionEnabled()
Determines if selection is enabled.

Returns:
true if selection is enabled
See Also:
setSelectionEnabled(boolean)

isShowsRootHandle

public boolean isShowsRootHandle()
Determines whether the handle of the root node should be shown.

Returns:
true if the root handle should be visible.
See Also:
setShowsRootHandle(boolean)

getPathForRow

public TreePath getPathForRow(int row)
Parameters:
row - the row to get the path for
Returns:
the TreePath that is rendered on the given row.
Throws:
java.lang.IndexOutOfBoundsException - when row is invalid.

getRowForPath

public int getRowForPath(TreePath path)
Returns the index of the row the path is currently rendered to.

Parameters:
path - the path
Returns:
the row index, or -1 if the path is not visible

getRolloverBackground

public nextapp.echo.app.Color getRolloverBackground()
Return the rollover background color displayed when the mouse is within the bounds of a row.

Returns:
the color

getRolloverBackgroundImage

public nextapp.echo.app.FillImage getRolloverBackgroundImage()
Return the rollover background image displayed when the mouse is within the bounds of a row.

Returns:
the background image

getRolloverBorder

public nextapp.echo.app.Border getRolloverBorder()
Return the rollover border displayed when the mouse is within the bounds of a row.

Returns:
the font

getRolloverFont

public nextapp.echo.app.Font getRolloverFont()
Return the rollover font displayed when the mouse is within the bounds of a row.

Returns:
the font

getRolloverForeground

public nextapp.echo.app.Color getRolloverForeground()
Return the rollover foreground color displayed when the mouse is within the bounds of a row.

Returns:
the color

getSelectionBackground

public nextapp.echo.app.Color getSelectionBackground()
Returns the row selection background color.

Returns:
the background color

getSelectionBackgroundImage

public nextapp.echo.app.FillImage getSelectionBackgroundImage()
Returns the row selection background image.

Returns:
the background image

getSelectionBorder

public nextapp.echo.app.Border getSelectionBorder()
Returns the row selection border.

Returns:
the border

getSelectionFont

public nextapp.echo.app.Font getSelectionFont()
Returns the row selection font.

Returns:
the font

getSelectionForeground

public nextapp.echo.app.Color getSelectionForeground()
Returns the row selection foreground color.

Returns:
the foreground color

getSelectionModel

public TreeSelectionModel getSelectionModel()
Returns the row selection model.

Returns:
the selection model

getWidth

public nextapp.echo.app.Extent getWidth()
Returns the overall width of the tree. This property supports Extents with fixed or percentile units.

Returns:
the width

getComponent

public nextapp.echo.app.Component getComponent(int row,
                                               int column)
Returns the component that is rendered at the given location.

Parameters:
row - the row the component is rendered in
column - the column the component is rendered in
Returns:
the component, or null if the location does not exist, or the component for the location is not yet rendered.

getComponent

public nextapp.echo.app.Component getComponent(TreePath path,
                                               int column)
Returns the component that is rendered for the tree column of the given path.

Parameters:
path - the path the component is rendered for
column - the column the component is rendered in
Returns:
the component, or null if the location does not exist, or the component for the location is not yet rendered.

getLineStyle

public int getLineStyle()
Retrieves the line style that is used to render the lines that connect the nodes.

Returns:
the line style, one of the following values:
  • LINE_STYLE_SOLID
  • LINE_STYLE_DOTTED

getNodeClosedIcon

public nextapp.echo.app.ImageReference getNodeClosedIcon()
Retrieves the icon that is rendered for closed nodes. The default icon is a + sign.

Returns:
the icon

getNodeClosedBottomIcon

public nextapp.echo.app.ImageReference getNodeClosedBottomIcon()
Retrieves the icon that is rendered for closed bottom nodes. The default icon is a + sign.

Returns:
the icon

getNodeOpenIcon

public nextapp.echo.app.ImageReference getNodeOpenIcon()
Retrieves the icon that is rendered for opened nodes. The default icon is a - sign.

Returns:
the icon

getNodeOpenBottomIcon

public nextapp.echo.app.ImageReference getNodeOpenBottomIcon()
Retrieves the icon that is rendered for opened bottom nodes. The default icon is a - sign.

Returns:
the icon

removeActionListener

public void removeActionListener(nextapp.echo.app.event.ActionListener l)
Removes an ActionListener from the Tree. ActionListeners will be invoked when the user selects a row.

Parameters:
l - the ActionListener to remove

setModel

public void setModel(TreeModel newValue)
Sets the TreeModel being visualized.

If the root node is not null, it will be expanded automatically.

Parameters:
newValue - the new model (may not be null)

setLineStyle

public void setLineStyle(int newValue)
Sets the line style that is used to render the lines that connect the nodes.

Parameters:
newValue - the line style, one of the following values:
  • LINE_STYLE_NONE
  • LINE_STYLE_SOLID
  • LINE_STYLE_DOTTED

setNodeClosedIcon

public void setNodeClosedIcon(nextapp.echo.app.ImageReference newValue)
Sets the icon that is rendered for closed nodes. The default icon is a + sign.

Parameters:
newValue - the icon

setNodeClosedBottomIcon

public void setNodeClosedBottomIcon(nextapp.echo.app.ImageReference newValue)
Sets the icon that is rendered for closed bottom nodes. The default icon is a + sign.

Parameters:
newValue - the icon

setNodeOpenIcon

public void setNodeOpenIcon(nextapp.echo.app.ImageReference newValue)
Sets the icon that is rendered for opened nodes. The default icon is a - sign.

Parameters:
newValue - the icon

setNodeOpenBottomIcon

public void setNodeOpenBottomIcon(nextapp.echo.app.ImageReference newValue)
Sets the icon that is rendered for opened bottom nodes. The default icon is a - sign.

Parameters:
newValue - the icon

setRolloverBackground

public void setRolloverBackground(nextapp.echo.app.Color newValue)
Sets the rollover background color displayed when the mouse is within the bounds of a row.

Parameters:
newValue - the new Color

setRolloverBackgroundImage

public void setRolloverBackgroundImage(nextapp.echo.app.FillImage newValue)
Sets the rollover background image displayed when the mouse is within the bounds of a row.

Parameters:
newValue - the new background image

setRolloverBorder

public void setRolloverBorder(nextapp.echo.app.Border newValue)
Sets the rollover border displayed when the mouse is within the bounds of a row.

Parameters:
newValue - the new background image

setRolloverEnabled

public void setRolloverEnabled(boolean newValue)
Sets whether rollover effects are enabled when the mouse cursor is within the bounds of a row. Rollover properties have no effect unless this property is set to true. The default value is false.

Parameters:
newValue - true if rollover effects should be enabled

setRolloverFont

public void setRolloverFont(nextapp.echo.app.Font newValue)
Sets the rollover font displayed when the mouse is within the bounds of a row.

Parameters:
newValue - the new Font

setRolloverForeground

public void setRolloverForeground(nextapp.echo.app.Color newValue)
Sets the rollover foreground color displayed when the mouse is within the bounds of a row.

Parameters:
newValue - the new Color

setRootVisible

public void setRootVisible(boolean newValue)
Determines whether or not the root node from the TreeModel is visible.

Parameters:
newValue - true if the root node of the tree is to be displayed.
See Also:
isRootVisible()

setSelectionBackground

public void setSelectionBackground(nextapp.echo.app.Color newValue)
Sets the row selection background color.

Parameters:
newValue - the new background color

setSelectionBackgroundImage

public void setSelectionBackgroundImage(nextapp.echo.app.FillImage newValue)
Sets the row selection background image.

Parameters:
newValue - the new background image

setSelectionBorder

public void setSelectionBorder(nextapp.echo.app.Border newValue)
Sets the row selection border.

Parameters:
newValue - the new border

setSelectionEnabled

public void setSelectionEnabled(boolean newValue)
Sets whether selection is enabled.

Parameters:
newValue - true to enable selection

setSelectionForeground

public void setSelectionForeground(nextapp.echo.app.Color newValue)
Sets the row selection foreground color.

Parameters:
newValue - the new foreground color

setSelectionFont

public void setSelectionFont(nextapp.echo.app.Font newValue)
Sets the row selection font.

Parameters:
newValue - the new font

setSelectionModel

public void setSelectionModel(TreeSelectionModel newValue)
Sets the row selection model. The selection model may not be null.

Parameters:
newValue - the new selection model

setShowsRootHandle

public void setShowsRootHandle(boolean newValue)
Determines whether the handle of the root node should be shown.

Parameters:
newValue - true if the root handle should be visible.
See Also:
isShowsRootHandle()

setWidth

public void setWidth(nextapp.echo.app.Extent newValue)
Sets the overall width of the tree. This property supports Extents with fixed or percentile units.

Parameters:
newValue - the new width

validate

public void validate()
Overrides:
validate in class nextapp.echo.app.Component
See Also:
Component.validate()

addTreeExpansionListener

public void addTreeExpansionListener(TreeExpansionListener l)
Adds a TreeExpansionListener to the Tree. TreeExpansionListeners will be invoked when the expansion state of a node changes.

Parameters:
l - the TreeExpansionListener to add

removeTreeExpansionListener

public void removeTreeExpansionListener(TreeExpansionListener l)
Removes a TreeExpansionListener from the Tree. TreeExpansionListeners will be invoked when the expansion state of a node changes.

Parameters:
l - the TreeExpansionListener to remove

NextApp Echo3 Extras
v3.0.b4