public class TreeViewBehavior<T> extends BehaviorBase<TreeView<T>>
Modifier and Type | Field and Description |
---|---|
private boolean |
isShiftDown
State and Functions *
|
private boolean |
isShortcutDown |
private java.lang.Runnable |
onFocusNextRow |
private java.lang.Runnable |
onFocusPreviousRow |
private java.lang.Runnable |
onMoveToFirstCell |
private java.lang.Runnable |
onMoveToLastCell |
private Callback<java.lang.Boolean,java.lang.Integer> |
onScrollPageDown |
private Callback<java.lang.Boolean,java.lang.Integer> |
onScrollPageUp |
private java.lang.Runnable |
onSelectNextRow |
private java.lang.Runnable |
onSelectPreviousRow |
private ListChangeListener<java.lang.Integer> |
selectedIndicesListener |
private boolean |
selectionChanging |
private ChangeListener<MultipleSelectionModel<TreeItem<T>>> |
selectionModelListener |
protected static java.util.List<KeyBinding> |
TREE_VIEW_BINDINGS
Setup KeyBindings *
|
private WeakListChangeListener<java.lang.Integer> |
weakSelectedIndicesListener |
private WeakChangeListener<MultipleSelectionModel<TreeItem<T>>> |
weakSelectionModelListener |
IS_TOUCH_SUPPORTED, TRAVERSAL_BINDINGS, TRAVERSE_DOWN, TRAVERSE_LEFT, TRAVERSE_NEXT, TRAVERSE_PREVIOUS, TRAVERSE_RIGHT, TRAVERSE_UP
Constructor and Description |
---|
TreeViewBehavior(TreeView<T> control) |
Modifier and Type | Method and Description |
---|---|
private void |
alsoSelectNextRow() |
private void |
alsoSelectPreviousRow() |
protected void |
callAction(java.lang.String name)
Called to invoke the action associated with the given name.
|
protected void |
callActionForEvent(KeyEvent e)
Invokes the appropriate action for this key event.
|
private void |
cancelEdit() |
private void |
clearSelection() |
private void |
clearSelectionOutsideRange(int start,
int end) |
private void |
collapseRow() |
(package private) static <T> void |
collapseRow(MultipleSelectionModel<TreeItem<T>> sm,
TreeItem<T> root,
boolean isShowRoot) |
private void |
discontinuousSelectAllToFirstRow() |
private void |
discontinuousSelectAllToLastRow() |
private void |
discontinuousSelectNextRow() |
private void |
discontinuousSelectPageDown() |
private void |
discontinuousSelectPageUp() |
private void |
discontinuousSelectPreviousRow()
Discontinuous Selection *
|
void |
dispose()
Called by a Skin when the Skin is disposed.
|
private void |
edit() |
private void |
expandAll() |
(package private) static <T> void |
expandAll(TreeItem<T> root) |
private static <T> void |
expandChildren(TreeItem<T> node) |
private void |
expandRow() |
(package private) static <T> void |
expandRow(MultipleSelectionModel<TreeItem<T>> sm,
Callback<TreeItem<T>,java.lang.Integer> getIndex) |
private void |
focusFirstRow() |
private void |
focusLastRow() |
private void |
focusNextRow() |
private void |
focusPageDown() |
private void |
focusPageUp() |
private void |
focusPreviousRow() |
private int |
getAnchor() |
private boolean |
hasAnchor() |
protected java.lang.String |
matchActionForEvent(KeyEvent e)
Given a key event, this method will find the matching action name, or null if there
is not one.
|
void |
mousePressed(MouseEvent e)
Invoked by a Skin when the body of the control has been pressed by
the mouse.
|
private void |
scrollDown() |
private void |
scrollUp() |
private void |
selectAll() |
private void |
selectAllPageDown() |
private void |
selectAllPageUp() |
private void |
selectAllToFirstRow() |
private void |
selectAllToFocus(boolean setAnchorToFocusIndex) |
private void |
selectAllToLastRow() |
private void |
selectFirstRow() |
private void |
selectLastRow() |
private void |
selectNextRow() |
private void |
selectPreviousRow() |
private void |
setAnchor(int anchor) |
void |
setOnFocusNextRow(java.lang.Runnable r) |
void |
setOnFocusPreviousRow(java.lang.Runnable r) |
void |
setOnMoveToFirstCell(java.lang.Runnable r) |
void |
setOnMoveToLastCell(java.lang.Runnable r) |
void |
setOnScrollPageDown(Callback<java.lang.Boolean,java.lang.Integer> c) |
void |
setOnScrollPageUp(Callback<java.lang.Boolean,java.lang.Integer> c) |
void |
setOnSelectNextRow(java.lang.Runnable r) |
void |
setOnSelectPreviousRow(java.lang.Runnable r) |
private void |
toggleFocusOwnerSelection() |
contextMenuRequested, focusChanged, getControl, mouseDragged, mouseEntered, mouseExited, mouseReleased, traverse, traverseDown, traverseLeft, traverseNext, traversePrevious, traverseRight, traverseUp
protected static final java.util.List<KeyBinding> TREE_VIEW_BINDINGS
private boolean isShiftDown
private boolean isShortcutDown
private Callback<java.lang.Boolean,java.lang.Integer> onScrollPageUp
private Callback<java.lang.Boolean,java.lang.Integer> onScrollPageDown
private java.lang.Runnable onSelectPreviousRow
private java.lang.Runnable onSelectNextRow
private java.lang.Runnable onMoveToFirstCell
private java.lang.Runnable onMoveToLastCell
private java.lang.Runnable onFocusPreviousRow
private java.lang.Runnable onFocusNextRow
private boolean selectionChanging
private final ListChangeListener<java.lang.Integer> selectedIndicesListener
private final ChangeListener<MultipleSelectionModel<TreeItem<T>>> selectionModelListener
private final WeakListChangeListener<java.lang.Integer> weakSelectedIndicesListener
private final WeakChangeListener<MultipleSelectionModel<TreeItem<T>>> weakSelectionModelListener
protected java.lang.String matchActionForEvent(KeyEvent e)
BehaviorBase
matchActionForEvent
in class BehaviorBase<TreeView<T>>
e
- The key event. Must not be null.protected void callAction(java.lang.String name)
BehaviorBase
When a KeyEvent is handled, it is first passed through callActionForEvent which resolves which "action" should be executed based on the key event. This action is indicated by name. This name is then passed to this function which is responsible for invoking the right function based on the name.
callAction
in class BehaviorBase<TreeView<T>>
protected void callActionForEvent(KeyEvent e)
BehaviorBase
callActionForEvent
in class BehaviorBase<TreeView<T>>
e
- The key event. Must not be null.public void setOnScrollPageUp(Callback<java.lang.Boolean,java.lang.Integer> c)
public void setOnScrollPageDown(Callback<java.lang.Boolean,java.lang.Integer> c)
public void setOnSelectPreviousRow(java.lang.Runnable r)
public void setOnSelectNextRow(java.lang.Runnable r)
public void setOnMoveToFirstCell(java.lang.Runnable r)
public void setOnMoveToLastCell(java.lang.Runnable r)
public void setOnFocusPreviousRow(java.lang.Runnable r)
public void setOnFocusNextRow(java.lang.Runnable r)
public void dispose()
BehaviorBase
dispose
in class BehaviorBase<TreeView<T>>
private void setAnchor(int anchor)
private int getAnchor()
private boolean hasAnchor()
public void mousePressed(MouseEvent e)
BehaviorBase
mousePressed
in class BehaviorBase<TreeView<T>>
e
- the mouse eventprivate void clearSelection()
private void scrollUp()
private void scrollDown()
private void focusFirstRow()
private void focusLastRow()
private void focusPreviousRow()
private void focusNextRow()
private void focusPageUp()
private void focusPageDown()
private void alsoSelectPreviousRow()
private void alsoSelectNextRow()
private void clearSelectionOutsideRange(int start, int end)
private void selectPreviousRow()
private void selectNextRow()
private void selectFirstRow()
private void selectLastRow()
private void selectAllToFirstRow()
private void selectAllToLastRow()
private void selectAll()
private void selectAllPageUp()
private void selectAllPageDown()
private void selectAllToFocus(boolean setAnchorToFocusIndex)
private void expandRow()
private void expandAll()
private void collapseRow()
static <T> void expandRow(MultipleSelectionModel<TreeItem<T>> sm, Callback<TreeItem<T>,java.lang.Integer> getIndex)
static <T> void expandAll(TreeItem<T> root)
private static <T> void expandChildren(TreeItem<T> node)
static <T> void collapseRow(MultipleSelectionModel<TreeItem<T>> sm, TreeItem<T> root, boolean isShowRoot)
private void cancelEdit()
private void edit()
private void toggleFocusOwnerSelection()
private void discontinuousSelectPreviousRow()
private void discontinuousSelectNextRow()
private void discontinuousSelectPageUp()
private void discontinuousSelectPageDown()
private void discontinuousSelectAllToFirstRow()
private void discontinuousSelectAllToLastRow()