Module is.codion.swing.common.ui
Interface TreeBuilder
- All Superinterfaces:
ComponentBuilder<JTree,,TreeBuilder> Supplier<JTree>
A builder for JTree.
The tree selects the row under the mouse before a JPopupMenu is shown, so that the popup menu actions
apply to what was clicked, where a JTree leaves the selection as is: the row, unless already selected,
and nothing below the last row, clearing the selection.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic TreeBuilder.ModelStepbuilder()cellRenderer(TreeCellRenderer cellRenderer) doubleClick(Action doubleClick) Performs the given action on a double-click with the left mouse button on a selected node, the first click selecting it, if the action is enabled.dragEnabled(boolean dragEnabled) editable(boolean editable) expandsSelectedPaths(boolean expandsSelectedPaths) invokesStopCellEditing(boolean invokesStopCellEditing) largeModel(boolean largeModel) rootVisible(boolean rootVisible) rowHeight(int rowHeight) scrollsOnExpand(boolean scrollsOnExpand) selectionMode(int selectionMode) showsRootHandles(boolean showsRootHandles) toggleClickCount(int toggleClickCount) treeExpansionListener(TreeExpansionListener treeExpansionListener) treeSelectionListener(TreeSelectionListener treeSelectionListener) treeWillExpandListener(TreeWillExpandListener treeWillExpandListener) Sets the UI before any other setting, since a look and feel may adjust what is set while its own UI is installed, such as removing the default icons of aDefaultTreeCellRenderer.visibleRowCount(int visibleRowCount) Methods inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
ancestorListener, background, border, build, build, clientProperty, componentListener, componentOrientation, enabled, enabled, focusable, focusable, focusCycleRoot, focusListener, font, font, foreground, get, hierarchyListener, keyEvent, keyListener, label, label, label, maximumHeight, maximumSize, maximumWidth, minimumHeight, minimumSize, minimumWidth, mouseListener, mouseMotionListener, mouseWheelListener, name, onBuild, onSetVisible, opaque, popupControl, popupControls, popupControls, popupMenu, preferredHeight, preferredSize, preferredWidth, propertyChangeListener, propertyChangeListener, scrollPane, toolTipText, toolTipText, transferFocusOnEnter, transferFocusOnEnter, transferHandler, visible, visible
-
Method Details
-
ui
Sets the UI before any other setting, since a look and feel may adjust what is set while its own UI is installed, such as removing the default icons of aDefaultTreeCellRenderer.- Parameters:
ui- the tree UI- Returns:
- this builder instance
- See Also:
-
rootVisible
- Parameters:
rootVisible- true if the root node should be visible- Returns:
- this builder instance
- See Also:
-
showsRootHandles
- Parameters:
showsRootHandles- true if root handles should be shown- Returns:
- this builder instance
- See Also:
-
cellRenderer
- Parameters:
cellRenderer- the cell renderer- Returns:
- this builder instance
- See Also:
-
dragEnabled
- Parameters:
dragEnabled- true if drag should be enabled- Returns:
- this builder instance
- See Also:
-
dropMode
- Parameters:
dropMode- the drop mode- Returns:
- this builder instance
- See Also:
-
editable
- Parameters:
editable- true if the tree should be editable- Returns:
- this builder instance
- See Also:
-
expandsSelectedPaths
- Parameters:
expandsSelectedPaths- true if selected paths should be expanded- Returns:
- this builder instance
- See Also:
-
invokesStopCellEditing
- Parameters:
invokesStopCellEditing- true if stop cell editing should be invoked on selection change- Returns:
- this builder instance
- See Also:
-
rowHeight
- Parameters:
rowHeight- the row height- Returns:
- this builder instance
- See Also:
-
scrollsOnExpand
- Parameters:
scrollsOnExpand- true if the tree should scroll on expand- Returns:
- this builder instance
- See Also:
-
toggleClickCount
- Parameters:
toggleClickCount- the number of clicks required to toggle a node- Returns:
- this builder instance
- See Also:
-
visibleRowCount
- Parameters:
visibleRowCount- the number of visible rows- Returns:
- this builder instance
- See Also:
-
largeModel
- Parameters:
largeModel- the large model value- Returns:
- this builder instance
- See Also:
-
selectionMode
- Parameters:
selectionMode- the selection mode- Returns:
- this builder instance
- See Also:
-
doubleClick
Performs the given action on a double-click with the left mouse button on a selected node, the first click selecting it, if the action is enabled. TheActionEventsource is theMouseEvent.- Parameters:
doubleClick- the action to perform on a double-click- Returns:
- this builder instance
-
treeExpansionListener
- Parameters:
treeExpansionListener- the tree expansion listener to add- Returns:
- this builder instance
- See Also:
-
treeWillExpandListener
- Parameters:
treeWillExpandListener- the tree will expand listener to add- Returns:
- this builder instance
- See Also:
-
treeSelectionListener
- Parameters:
treeSelectionListener- the tree selection listener to add- Returns:
- this builder instance
- See Also:
-
builder
- Returns:
- a builder for a component
-