public abstract class TableViewBehaviorBase<C extends Control,T,TC extends TableColumnBase<T,?>> extends BehaviorBase<C>
Modifier and Type | Field and Description |
---|---|
protected boolean |
isShiftDown |
protected boolean |
isShortcutDown
*
Internal fields *
*
|
protected ListChangeListener<TablePositionBase> |
selectedCellsListener |
protected boolean |
selectionChanging |
protected static List<KeyBinding> |
TABLE_VIEW_BINDINGS
*
Setup key bindings *
*
|
protected WeakListChangeListener<TablePositionBase> |
weakSelectedCellsListener |
IS_TOUCH_SUPPORTED, TRAVERSAL_BINDINGS
Constructor and Description |
---|
TableViewBehaviorBase(C control)
*
Constructors *
*
|
TableViewBehaviorBase(C control,
List<KeyBinding> bindings) |
Modifier and Type | Method and Description |
---|---|
protected void |
activate() |
protected void |
alsoSelectLeftCell() |
protected void |
alsoSelectNext() |
protected void |
alsoSelectPrevious() |
protected void |
alsoSelectRightCell() |
protected void |
callAction(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.
|
protected void |
cancelEdit() |
protected void |
clearSelection() |
protected void |
clearSelectionOutsideRange(int start,
int end,
TableColumnBase<T,?> column) |
protected void |
discontinuousSelectAllToFirstRow() |
protected void |
discontinuousSelectAllToLastRow() |
protected void |
discontinuousSelectNextColumn() |
protected void |
discontinuousSelectNextRow() |
protected void |
discontinuousSelectPageDown() |
protected void |
discontinuousSelectPageUp() |
protected void |
discontinuousSelectPreviousColumn() |
protected void |
discontinuousSelectPreviousRow()
Discontinuous Selection *
|
protected abstract void |
editCell(int row,
TableColumnBase tc)
Begins the edit process in the underlying control for the given row/column
position.
|
protected void |
focusFirstRow() |
protected void |
focusLastRow() |
protected void |
focusLeftCell() |
protected void |
focusNextRow() |
protected void |
focusPageDown() |
protected void |
focusPageUp() |
protected void |
focusPreviousRow() |
protected void |
focusRightCell() |
protected TablePositionBase |
getAnchor()
Will return the current anchor position.
|
protected TableColumnBase |
getColumn(int index) |
protected TableColumnBase |
getColumn(TableColumnBase tc,
int delta) |
protected abstract TablePositionBase |
getFocusedCell()
Returns the focused cell from the focus model of the underlying control.
|
protected abstract TableFocusModel |
getFocusModel()
Returns the focus model for the underlying UI control (which must extend
from TableFocusModel).
|
protected abstract int |
getItemCount()
Returns the number of items in the underlying data model.
|
protected abstract ObservableList<? extends TablePositionBase> |
getSelectedCells()
Returns an observable list of all cells that are currently selected in
the selection model of the underlying control.
|
protected abstract TableSelectionModel<T> |
getSelectionModel()
Returns the selection model for the underlying UI control (which must extend
from TableSelectionModel).
|
protected abstract TablePositionBase<TC> |
getTablePosition(int row,
TableColumnBase<T,?> tc)
Creates a TablePositionBase instance using the underlying controls
concrete implementation for the given row/column intersection.
|
protected abstract TableColumnBase |
getVisibleLeafColumn(int index)
Returns the column at the given index in the visible leaf columns list of
the underlying control.
|
protected abstract ObservableList<? extends TableColumnBase> |
getVisibleLeafColumns()
Returns an observable list of all visible leaf columns in the underlying
control.
|
protected abstract int |
getVisibleLeafIndex(TableColumnBase tc)
Returns the position of the given table column in the visible leaf columns
list of the underlying control.
|
protected boolean |
hasAnchor()
Returns true if there is an anchor set, and false if not anchor is set.
|
protected boolean |
isRTL() |
void |
mousePressed(MouseEvent e)
Invoked by a Skin when the body of the control has been pressed by
the mouse.
|
protected void |
scrollDown() |
protected void |
scrollUp() |
protected void |
selectAll() |
protected void |
selectAllPageDown() |
protected void |
selectAllPageUp() |
protected void |
selectAllToFirstRow() |
protected void |
selectAllToFocus(boolean setAnchorToFocusIndex) |
protected void |
selectAllToLastRow() |
protected void |
selectCell(int rowDiff,
int columnDiff) |
protected void |
selectFirstRow() |
protected void |
selectLastRow() |
protected void |
selectLeftCell() |
protected void |
selectNextRow() |
protected void |
selectPreviousRow() |
protected void |
selectRightCell() |
protected void |
setAnchor(int row,
TableColumnBase col)
*
Public API *
*
|
protected void |
setAnchor(TablePositionBase tp)
Call to record the current anchor position
|
void |
setOnFocusNextRow(Runnable r) |
void |
setOnFocusPreviousRow(Runnable r) |
void |
setOnMoveToFirstCell(Runnable r) |
void |
setOnMoveToLastCell(Runnable r) |
void |
setOnScrollPageDown(Callback<Boolean,Integer> c) |
void |
setOnScrollPageUp(Callback<Boolean,Integer> c) |
void |
setOnSelectLeftCell(Runnable r) |
void |
setOnSelectNextRow(Runnable r) |
void |
setOnSelectPreviousRow(Runnable r) |
void |
setOnSelectRightCell(Runnable r) |
protected void |
toggleFocusOwnerSelection() |
protected void |
updateCellHorizontalSelection(int delta,
Runnable defaultAction) |
protected void |
updateCellVerticalSelection(int delta,
Runnable defaultAction) |
protected void |
updateRowSelection(int delta) |
contextMenuRequested, dispose, focusChanged, getControl, matchActionForEvent, mouseDragged, mouseEntered, mouseExited, mouseReleased, traverse, traverseDown, traverseLeft, traverseNext, traversePrevious, traverseRight, traverseUp
protected static final List<KeyBinding> TABLE_VIEW_BINDINGS
protected boolean isShortcutDown
protected boolean isShiftDown
protected boolean selectionChanging
protected final ListChangeListener<TablePositionBase> selectedCellsListener
protected final WeakListChangeListener<TablePositionBase> weakSelectedCellsListener
public TableViewBehaviorBase(C control)
public TableViewBehaviorBase(C control, List<KeyBinding> bindings)
protected void callAction(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<C extends Control>
protected void callActionForEvent(KeyEvent e)
BehaviorBase
callActionForEvent
in class BehaviorBase<C extends Control>
e
- The key event. Must not be null.protected void setAnchor(TablePositionBase tp)
protected TablePositionBase getAnchor()
protected boolean hasAnchor()
protected abstract int getItemCount()
protected abstract TableFocusModel getFocusModel()
protected abstract TableSelectionModel<T> getSelectionModel()
protected abstract ObservableList<? extends TablePositionBase> getSelectedCells()
protected abstract TablePositionBase getFocusedCell()
protected abstract int getVisibleLeafIndex(TableColumnBase tc)
protected abstract TableColumnBase getVisibleLeafColumn(int index)
protected abstract void editCell(int row, TableColumnBase tc)
protected abstract ObservableList<? extends TableColumnBase> getVisibleLeafColumns()
protected abstract TablePositionBase<TC> getTablePosition(int row, TableColumnBase<T,?> tc)
protected void setAnchor(int row, TableColumnBase col)
public void setOnFocusPreviousRow(Runnable r)
public void setOnFocusNextRow(Runnable r)
public void setOnSelectPreviousRow(Runnable r)
public void setOnSelectNextRow(Runnable r)
public void setOnMoveToFirstCell(Runnable r)
public void setOnMoveToLastCell(Runnable r)
public void setOnSelectRightCell(Runnable r)
public void setOnSelectLeftCell(Runnable r)
public void mousePressed(MouseEvent e)
BehaviorBase
mousePressed
in class BehaviorBase<C extends Control>
e
- the mouse eventprotected boolean isRTL()
protected void scrollUp()
protected void scrollDown()
protected void focusFirstRow()
protected void focusLastRow()
protected void focusPreviousRow()
protected void focusNextRow()
protected void focusLeftCell()
protected void focusRightCell()
protected void focusPageUp()
protected void focusPageDown()
protected void clearSelection()
protected void clearSelectionOutsideRange(int start, int end, TableColumnBase<T,?> column)
protected void alsoSelectPrevious()
protected void alsoSelectNext()
protected void alsoSelectLeftCell()
protected void alsoSelectRightCell()
protected void updateRowSelection(int delta)
protected void updateCellVerticalSelection(int delta, Runnable defaultAction)
protected void updateCellHorizontalSelection(int delta, Runnable defaultAction)
protected TableColumnBase getColumn(int index)
protected TableColumnBase getColumn(TableColumnBase tc, int delta)
protected void selectFirstRow()
protected void selectLastRow()
protected void selectPreviousRow()
protected void selectNextRow()
protected void selectLeftCell()
protected void selectRightCell()
protected void selectCell(int rowDiff, int columnDiff)
protected void cancelEdit()
protected void activate()
protected void selectAllToFocus(boolean setAnchorToFocusIndex)
protected void selectAll()
protected void selectAllToFirstRow()
protected void selectAllToLastRow()
protected void selectAllPageUp()
protected void selectAllPageDown()
protected void toggleFocusOwnerSelection()
protected void discontinuousSelectPreviousRow()
protected void discontinuousSelectNextRow()
protected void discontinuousSelectPreviousColumn()
protected void discontinuousSelectNextColumn()
protected void discontinuousSelectPageUp()
protected void discontinuousSelectPageDown()
protected void discontinuousSelectAllToFirstRow()
protected void discontinuousSelectAllToLastRow()
Copyright © 2020. All rights reserved.