java.lang.Object
com.iamsoft.util.ui.javafx.table.TableColumnUtil
Miscellaneous utility methods related to TableView.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addHideActionToColumns
(javafx.collections.ObservableList<? extends javafx.scene.control.TableColumnBase<?, ?>> pColumns) static <S> List
<javafx.scene.control.TableColumn<S, ?>> static <S,
T> javafx.scene.control.TableColumn <S, T> cast
(javafx.scene.control.TableColumnBase<?, ?> pColumn) static <S> javafx.scene.control.TableCell
<S, String> createTableCell
(BiFunction<String, Double, String> pTruncateFunction) Creates a table cell which supports custom truncation strategy.static <S,
T> javafx.scene.control.cell.CheckBoxTableCell <S, T> static <S,
T> javafx.collections.ObservableList <javafx.scene.control.TableColumn<S, T>> excisedRootColumnList
(javafx.collections.ObservableList<javafx.scene.control.TableColumn<S, T>> pColumns) New list that, if there is exactly one top-level column and it has 1 or more children, contains the children of 'root' col.static javafx.scene.control.TreeTableColumn.SortType
fromTableColumnSortType
(javafx.scene.control.TableColumn.SortType pSortType) static javafx.scene.control.TableColumn.SortType
getSortType
(javafx.scene.control.TableColumnBase<?, ?> pColumn) static BiFunction
<String, Double, String> getTruncateFunction
(javafx.scene.control.TableColumnBase<?, ?> pColumn) static void
setSortType
(javafx.scene.control.TableColumnBase<?, ?> pColumn, javafx.scene.control.TableColumn.SortType pSortType) static void
setSortType
(javafx.scene.control.TableColumnBase<?, ?> pColumn, javafx.scene.control.TreeTableColumn.SortType pSortType) static void
setTruncateFunction
(javafx.scene.control.TableColumnBase<?, ?> pColumn, BiFunction<String, Double, String> pFunction) static <L extends javafx.scene.control.Labeled>
LsetUnfocusable
(L pLabel) static void
syncColWidths
(javafx.collections.ObservableList<? extends javafx.scene.control.TableColumn<?, ?>> pColumns) Keep column widths in sync for a single set of columns.static javafx.scene.control.TableColumn.SortType
toTableColumnSortType
(javafx.scene.control.TreeTableColumn.SortType pSortType) static <S,
T extends javafx.scene.control.TableColumnBase<S, ?>>
List<javafx.scene.control.TableColumnBase<?, ?>> static <S,
T> javafx.util.Callback <javafx.scene.control.TableColumn.CellDataFeatures<S, T>, javafx.beans.value.ObservableValue<T>> valueFactory
(javafx.scene.control.TableColumn<S, T> pTableColumn) Callback that accounts for columns with mutating value factories.
-
Method Details
-
syncColWidths
public static void syncColWidths(javafx.collections.ObservableList<? extends javafx.scene.control.TableColumn<?, ?>> pColumns) Keep column widths in sync for a single set of columns. -
valueFactory
public static <S,T> javafx.util.Callback<javafx.scene.control.TableColumn.CellDataFeatures<S,T>, valueFactoryjavafx.beans.value.ObservableValue<T>> (javafx.scene.control.TableColumn<S, T> pTableColumn) Callback that accounts for columns with mutating value factories.- Type Parameters:
S
- The TableView type.T
- The TableColumn type.- See Also:
-
excisedRootColumnList
public static <S,T> javafx.collections.ObservableList<javafx.scene.control.TableColumn<S,T>> excisedRootColumnList(javafx.collections.ObservableList<javafx.scene.control.TableColumn<S, T>> pColumns) New list that, if there is exactly one top-level column and it has 1 or more children, contains the children of 'root' col. If argument list doesn't meet these criteria, it is used as a delegate.- Type Parameters:
S
- The TableView type.T
- The TableColumn type.
-
addHideActionToColumns
public static void addHideActionToColumns(javafx.collections.ObservableList<? extends javafx.scene.control.TableColumnBase<?, ?>> pColumns) -
createUnfocusableCheckBoxTableCell
public static <S,T> javafx.scene.control.cell.CheckBoxTableCell<S,T> createUnfocusableCheckBoxTableCell() -
setUnfocusable
public static <L extends javafx.scene.control.Labeled> L setUnfocusable(L pLabel) -
createTableCell
public static <S> javafx.scene.control.TableCell<S,String> createTableCell(BiFunction<String, Double, String> pTruncateFunction) Creates a table cell which supports custom truncation strategy.- Parameters:
pTruncateFunction
- A function, which will be used to truncate the text inside the cell if it doesn't fit. The function accepts the text to be truncated and the width of the cell and returns the truncated text.
-
getTruncateFunction
public static BiFunction<String,Double, getTruncateFunctionString> (javafx.scene.control.TableColumnBase<?, ?> pColumn) -
setTruncateFunction
public static void setTruncateFunction(javafx.scene.control.TableColumnBase<?, ?> pColumn, BiFunction<String, Double, String> pFunction) -
getSortType
public static javafx.scene.control.TableColumn.SortType getSortType(javafx.scene.control.TableColumnBase<?, ?> pColumn) -
setSortType
public static void setSortType(javafx.scene.control.TableColumnBase<?, ?> pColumn, javafx.scene.control.TreeTableColumn.SortType pSortType) -
setSortType
public static void setSortType(javafx.scene.control.TableColumnBase<?, ?> pColumn, javafx.scene.control.TableColumn.SortType pSortType) -
fromTableColumnSortType
public static javafx.scene.control.TreeTableColumn.SortType fromTableColumnSortType(javafx.scene.control.TableColumn.SortType pSortType) -
toTableColumnSortType
public static javafx.scene.control.TableColumn.SortType toTableColumnSortType(javafx.scene.control.TreeTableColumn.SortType pSortType) -
cast
-
cast
public static <S,T> javafx.scene.control.TableColumn<S,T> cast(javafx.scene.control.TableColumnBase<?, ?> pColumn) -
upcast
-