java.lang.Object
com.iamsoft.util.ui.javafx.TreeTableViewUtil
Miscellaneous utility methods related to TreeTableView.
- See Also:
-
TreeTableView
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddCtrlShiftSelectionRangeMode(javafx.scene.control.TreeTableView<?> pTreeTableView) Support Ctrl-Shift selection.static <S> voidcheckPositions(javafx.scene.control.TreeTableView<S> pTable, javafx.scene.control.TreeTablePosition<S, ?> pFromPos, javafx.scene.control.TreeTablePosition<S, ?> pToPos) static List<org.controlsfx.control.action.Action>configureCopyAccelerators(javafx.scene.control.TreeTableView<?> pTreeTableView) Configure Ctrl-C and Ctrl-Shift-C keyboard shortcuts.static voidcopy(javafx.scene.control.TreeTableView<?> pTreeTableView) Copy selected treetable rows to clipboard.static <T> javafx.scene.control.TreeTableRow<T>createTreeTableRow(javafx.scene.control.TreeTableView<T> pTreeTable) Can be used as a workaround for TreeTableView: graphic of TreeItem is not show/hidden correctly after collapsing/expanding tree .static voidensureRowIsVisible(javafx.scene.control.TreeTableView<?> pTable, int pRow) static <T> javafx.collections.ObservableList<T>getExpandedItems(javafx.scene.control.TreeTableView<T> pTreeTableView) static <T> javafx.collections.ObservableList<T>getExpandedItems(javafx.scene.control.TreeTableView<T> pTreeTableView, boolean pUpdateLater) static <S> javafx.scene.control.TreeTablePosition<S,?> getFirstCellPos(javafx.scene.control.TreeTableView<S> pTable) Returns the first cell or row position, depending on whether cell selection is enabled, ornullif the table is empty or has no columns.static intgetFirstVisibleRow(javafx.scene.control.TreeTableView<?> pTable) Returns the first visible row or-1if there are no visible rows.static <S> javafx.scene.control.TreeTablePosition<S,?> getLastCellPos(javafx.scene.control.TreeTableView<S> pTable) Returns the last cell or row position, depending on whether cell selection is enabled, ornullif the table is empty or has no columns.static <T> javafx.collections.ObservableList<javafx.scene.control.TreeItem<T>>getSelectedItems(javafx.scene.control.TreeTableView<T> pTreeTable) static <S> javafx.scene.control.TreeTablePosition<S,?> nextPosition(javafx.scene.control.TreeTableView<S> pTable, javafx.scene.control.TreeTablePosition<S, ?> pPos) Returns the position of the next cell ornullif there is no next cell.static <S> Stream<javafx.scene.control.TreeTablePosition<S,?>> positionStream(javafx.scene.control.TreeTableView<S> pTable, javafx.scene.control.TreeTablePosition<S, ?> pFromPos, javafx.scene.control.TreeTablePosition<S, ?> pToPos) Returns a stream of positions frompFromPos(inclusive) topToPos(inclusive).static <S> javafx.scene.control.TreeTablePosition<S,?> prevPosition(javafx.scene.control.TreeTableView<S> pTable, javafx.scene.control.TreeTablePosition<S, ?> pPos) Returns the position of the previous cell ornullif there is no previous cell or if the specified position isnull.static <T> voidselect(javafx.scene.control.TreeTableView<T> pTable, List<javafx.scene.control.TreeItem<T>> pTreeItems) Selects the specified tree items and ensures that the first one is visible.static <T> voidselectPosition(javafx.scene.control.TreeTableView<T> pTable, javafx.scene.control.TreeTablePosition<T, ?> pPos) Selects the specified cell/row and ensures that it's visible.static voidselectRow(javafx.scene.control.TreeTableView<?> pTable, int pRow) Selects the specified row and ensures that it's visible.static StringtoString(javafx.scene.control.TreeTableView<?> pTreeTableView) Export selected rows to a string.
-
Method Details
-
toString
Export selected rows to a string. If necessary, this method could be adjusted to facilitate copying selected cells, the entire table, etc. TODO: consider using CSV util to handle escapes, etc. -
copy
public static void copy(javafx.scene.control.TreeTableView<?> pTreeTableView) Copy selected treetable rows to clipboard.- See Also:
-
configureCopyAccelerators
public static List<org.controlsfx.control.action.Action> configureCopyAccelerators(javafx.scene.control.TreeTableView<?> pTreeTableView) Configure Ctrl-C and Ctrl-Shift-C keyboard shortcuts. -
addCtrlShiftSelectionRangeMode
public static void addCtrlShiftSelectionRangeMode(javafx.scene.control.TreeTableView<?> pTreeTableView) Support Ctrl-Shift selection. -
getExpandedItems
public static <T> javafx.collections.ObservableList<T> getExpandedItems(javafx.scene.control.TreeTableView<T> pTreeTableView) -
getExpandedItems
public static <T> javafx.collections.ObservableList<T> getExpandedItems(javafx.scene.control.TreeTableView<T> pTreeTableView, boolean pUpdateLater) -
checkPositions
public static <S> void checkPositions(javafx.scene.control.TreeTableView<S> pTable, javafx.scene.control.TreeTablePosition<S, ?> pFromPos, javafx.scene.control.TreeTablePosition<S, ?> pToPos) - Throws:
IllegalArgumentException- if any of the specified positions isnull, or if an invalid position is specified as an argument, or if one of the specified positions is row based and the other is not.
-
positionStream
public static <S> Stream<javafx.scene.control.TreeTablePosition<S,?>> positionStream(javafx.scene.control.TreeTableView<S> pTable, javafx.scene.control.TreeTablePosition<S, ?> pFromPos, javafx.scene.control.TreeTablePosition<S, ?> pToPos) Returns a stream of positions frompFromPos(inclusive) topToPos(inclusive). IfpFromPosis greater thanpToPos, the elements in the stream are provided in backward order.- Throws:
IllegalArgumentException- if any of the specified positions isnull, or if an invalid position is specified as an argument, or if one of the specified positions is row based and the other is not.
-
getFirstCellPos
public static <S> javafx.scene.control.TreeTablePosition<S,?> getFirstCellPos(javafx.scene.control.TreeTableView<S> pTable) Returns the first cell or row position, depending on whether cell selection is enabled, ornullif the table is empty or has no columns. -
getLastCellPos
public static <S> javafx.scene.control.TreeTablePosition<S,?> getLastCellPos(javafx.scene.control.TreeTableView<S> pTable) Returns the last cell or row position, depending on whether cell selection is enabled, ornullif the table is empty or has no columns. -
prevPosition
public static <S> javafx.scene.control.TreeTablePosition<S,?> prevPosition(javafx.scene.control.TreeTableView<S> pTable, javafx.scene.control.TreeTablePosition<S, ?> pPos) Returns the position of the previous cell ornullif there is no previous cell or if the specified position isnull. -
nextPosition
public static <S> javafx.scene.control.TreeTablePosition<S,?> nextPosition(javafx.scene.control.TreeTableView<S> pTable, javafx.scene.control.TreeTablePosition<S, ?> pPos) Returns the position of the next cell ornullif there is no next cell. If the specified position isnulland the table is not empty and there is at least one column in the table, the first cell is returned. -
selectPosition
public static <T> void selectPosition(javafx.scene.control.TreeTableView<T> pTable, javafx.scene.control.TreeTablePosition<T, ?> pPos) Selects the specified cell/row and ensures that it's visible. The method does nothing if any of the arguments isnull. -
selectRow
public static void selectRow(javafx.scene.control.TreeTableView<?> pTable, int pRow) Selects the specified row and ensures that it's visible. -
select
public static <T> void select(javafx.scene.control.TreeTableView<T> pTable, List<javafx.scene.control.TreeItem<T>> pTreeItems) Selects the specified tree items and ensures that the first one is visible. -
ensureRowIsVisible
public static void ensureRowIsVisible(javafx.scene.control.TreeTableView<?> pTable, int pRow) -
getFirstVisibleRow
public static int getFirstVisibleRow(javafx.scene.control.TreeTableView<?> pTable) Returns the first visible row or-1if there are no visible rows. -
getSelectedItems
public static <T> javafx.collections.ObservableList<javafx.scene.control.TreeItem<T>> getSelectedItems(javafx.scene.control.TreeTableView<T> pTreeTable) -
createTreeTableRow
public static <T> javafx.scene.control.TreeTableRow<T> createTreeTableRow(javafx.scene.control.TreeTableView<T> pTreeTable) Can be used as a workaround for TreeTableView: graphic of TreeItem is not show/hidden correctly after collapsing/expanding tree .
-