public final class TreeBuilder<T> extends BasicBuilder<T>
Tell the builder the features you'd like the tree to have (or not have), call build(), and the builder will take care of putting one together for you.
The builder takes care of ensuring that it conforms to UI standards, and does the common work of things like adding the scrollpane, making the tree key press navigable.
T is the type of item in one node of the tree.
BasicBuilder.Instructions
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTION_CMD_CONTEXT
The action command given to the context listener on action performed
|
static java.lang.String |
ACTION_CMD_DOUBLE_CLICK
The action command given to the double click listener on action performed
|
instructions
Constructor and Description |
---|
TreeBuilder() |
Modifier and Type | Method and Description |
---|---|
BuiltTree<T> |
build()
Create and return the class containing the built UI for the specified table.
|
protected BasicBuilder.Instructions |
createInstructions() |
TreeBuilder |
selectionMode(int selectionMode)
Set the selection mode of the tree, by default the mode is single selection
|
void |
setContextListener(java.awt.event.ActionListener actionListener)
set the listener to be called when the user performs the action to display the context menu.
|
void |
setExpandTip(boolean expandTip)
Set whether the tree cells will expand to show clipped content when the mouse cursor moves over them.
|
void |
setModel(javax.swing.tree.TreeModel model) |
void |
setRenderer(javax.swing.tree.TreeCellRenderer renderer) |
void |
setVisibleRows(int visibleRows)
Set the preferred number of visible rows
|
buildToolbar, setActions, setActionsSecondary, setActionsSecondary, setCheckable, setDoubleClickListener, setEmptyText, setEmptyTextLarge, setLabel, setResizable, setRollover, setSelection, setSelectionEnabledAction, setSelectionEnabledComponent, setTitlebar, setToolbarComponents
public static final java.lang.String ACTION_CMD_CONTEXT
public static final java.lang.String ACTION_CMD_DOUBLE_CLICK
protected BasicBuilder.Instructions createInstructions()
createInstructions
in class BasicBuilder<T>
public BuiltTree<T> build()
public void setModel(javax.swing.tree.TreeModel model)
public void setExpandTip(boolean expandTip)
expandTip
- set false to turn off the expand tip abilitypublic void setContextListener(java.awt.event.ActionListener actionListener)
public TreeBuilder selectionMode(int selectionMode)
selectionMode
- a TreeSelectionModel constantpublic void setVisibleRows(int visibleRows)
visibleRows
- the number of visible rowspublic void setRenderer(javax.swing.tree.TreeCellRenderer renderer)