public class IlpViewRenderer extends IlpAbstractTreeViewRenderer
IlpTreeView
.
This class shows all the properties that can be customized in the tree view using cascading style sheets.
The CSS configuration can be applied to the tree view, using
IlpTreeView.setStyleSheets(java.lang.String[])
.
To customize the tree view configuration programmatically,
use IlpTreeView
.
This class is a CSS stylable JavaBean. It can be configured as follows in a CSS file:
View { selectionLookAndFeel : Highlight; background: white; scrollsOnExpand: false; }
Constructor and Description |
---|
IlpViewRenderer() |
Modifier and Type | Method and Description |
---|---|
Color |
getBackground()
Returns the view background color.
|
TreeCellRenderer |
getCellRenderer()
Returns the
TreeCellRenderer that is used to draw each cell. |
String |
getCSSID()
Returns the CSS identifier of this renderer.
|
boolean |
getExpandsSelectedPaths()
Returns the property that denotes whether the paths are automatically
expanded when selected or not.
|
int |
getRowHeight()
Returns the height of each cell in pixels.
|
boolean |
getScrollsOnExpand()
Returns the
scrollsOnExpand property that determines whether
the tree scrolls to show previously hidden children. |
int |
getSelectionLookAndFeel()
Returns the way the selection is rendered/manipulated by the end-user.
|
boolean |
getShowsRootHandles()
Returns the value of the
showsRootHandles property that
specifies whether the node handles should be displayed. |
int |
getToggleClickCount()
Returns the click count to toggle the expand/collapse state of
the tree nodes.
|
IlpTreeView |
getView()
Access to the tree view
|
boolean |
isRootVisible()
Returns
true if the root node of the tree is displayed. |
void |
reset()
Resets all the settings of this renderer.
|
void |
setBackground(Color v)
Sets the view background color.
|
void |
setCellRenderer(TreeCellRenderer v)
Sets the
TreeCellRenderer that is used to draw each cell. |
void |
setExpandsSelectedPaths(boolean v)
Configures the
expandsSelectedPaths property. |
void |
setRootVisible(boolean v)
Sets the property that denotes whether the root node of the tree is
displayed or not.
|
void |
setRowHeight(int v)
Sets the height of each cell in pixels.
|
void |
setScrollsOnExpand(boolean v)
Sets the
scrollsOnExpand property that determines whether
the tree scrolls to show previously hidden children. |
void |
setSelectionLookAndFeel(int v)
Sets the way the selection is rendered/manipulated by the end-user.
|
void |
setShowsRootHandles(boolean v)
Sets the value of the
showsRootHandles property that
specifies whether the node handles should be displayed. |
void |
setToggleClickCount(int v)
Sets the click count to toggle the expand/collapse state of
the tree nodes.
|
attach, detach, getContext, getViewSupport, isRendererEnabled, setRendererEnabled
public IlpTreeView getView()
public String getCSSID()
getCSSID
in class IlpAbstractTreeViewRenderer
public boolean isRootVisible()
true
if the root node of the tree is displayed.true
if the root node of the tree is displayed.public void setRootVisible(boolean v)
v
- Root visibility.public boolean getShowsRootHandles()
showsRootHandles
property that
specifies whether the node handles should be displayed.
The default value of this property depends on the constructor used to create the tree view. Some look and feels do not support handles and ignore this property.
public void setShowsRootHandles(boolean v)
showsRootHandles
property that
specifies whether the node handles should be displayed.
The default value of this property depends on the constructor used to create the tree view. Some look and feels do not support handles and ignore this property.
v
- Root handle visibility.public boolean getScrollsOnExpand()
scrollsOnExpand
property that determines whether
the tree scrolls to show previously hidden children.public void setScrollsOnExpand(boolean v)
scrollsOnExpand
property that determines whether
the tree scrolls to show previously hidden children.
If this property is true
, when a node is expanded the tree
scrolls to make the maximum number of children visible. In some look and
feels, trees do not need to scroll when expanded; those look and feels
ignore this property.
By default this property is true
.
v
- Indicates whether the tree should scroll to show hidden children.public int getSelectionLookAndFeel()
IlpTreeView.HIGHLIGHT_SELECTION_LOOK_AND_FEEL
,
IlpTreeView.CHECKBOX_SELECTION_LOOK_AND_FEEL
.public void setSelectionLookAndFeel(int v)
This method is provided as a convenient way to set the selection rendering properties.
v
- One of:
IlpTreeView.HIGHLIGHT_SELECTION_LOOK_AND_FEEL
,
IlpTreeView.CHECKBOX_SELECTION_LOOK_AND_FEEL
.public TreeCellRenderer getCellRenderer()
TreeCellRenderer
that is used to draw each cell.public void setCellRenderer(TreeCellRenderer v)
TreeCellRenderer
that is used to draw each cell.public boolean getExpandsSelectedPaths()
public void setExpandsSelectedPaths(boolean v)
expandsSelectedPaths
property.
When true
, any time the selection is changed, the tree path
parents are expanded to make them visible.
When false
, when the selection changes the nodes parents
are not made visible. This is useful to maintain paths that are not always
visible in the selection model.
Note: A node is said to be visible when all its parent nodes are expanded. This does not mean that the node is currently in the visible area of the tree.
public int getRowHeight()
If the specified value is less than or equal to zero, the current cell renderer is queried for the height of each row.
public void setRowHeight(int v)
If the specified value is less than or equal to zero, the current cell renderer is queried for the height of each row.
v
- Height of the tree row.public Color getBackground()
public void setBackground(Color v)
v
- Background color.public int getToggleClickCount()
public void setToggleClickCount(int v)
v
- Number of click counts to toggle the expand/collapse
state of tree nodes.public void reset()
reset
in class IlpAbstractTreeViewRenderer
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.