Module com.iamsoft.util.ui
Package com.iamsoft.util.ui.javafx.table
Class TableFindSupportBase<T extends javafx.scene.control.Control,C extends javafx.scene.control.TableColumnBase>
java.lang.Object
com.iamsoft.util.ui.javafx.table.AbstractTableFindSupport
com.iamsoft.util.ui.javafx.table.TableFindSupportBase<T,C>
- Type Parameters:
T
- Table type.C
- Table column type.
- Direct Known Subclasses:
TableViewFindSupport
,TreeTableViewFindSupport
public abstract class TableFindSupportBase<T extends javafx.scene.control.Control,C extends javafx.scene.control.TableColumnBase>
extends AbstractTableFindSupport
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.BooleanProperty
javafx.beans.property.ObjectProperty<T>
javafx.beans.property.ReadOnlyProperty<javafx.scene.control.TableSelectionModel<?>>
javafx.beans.property.ObjectProperty<TableFindSupportBase<T,
C>.SearchFunction> javafx.beans.property.ReadOnlyProperty<javafx.scene.control.TablePositionBase<?>>
Note that the returned value isnull
if multiple items are selected.Properties inherited from class com.iamsoft.util.ui.javafx.table.AbstractTableFindSupport
cellFactoryFilter, cellFactory, columnFilter, disabled, errorMessage, findStrategy, lineWrap, matchCase, matchCount, nextBtnDisable, noOccurrences, prevBtnDisable, searchFieldBackgroundStyle, searchInProgress, searchProgress, searchResultInfo, searchResultMessage, searchResult, selectedMatchRange
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
protected class
Finds all occurrences in a background thread.protected class
Finds all occurrences in a background thread.protected final class
Used for finding occurrences in a text.Nested classes/interfaces inherited from class com.iamsoft.util.ui.javafx.table.AbstractTableFindSupport
AbstractTableFindSupport.FindStrategy, AbstractTableFindSupport.Range, AbstractTableFindSupport.SearchResult
-
Field Summary
FieldsFields inherited from class com.iamsoft.util.ui.javafx.table.AbstractTableFindSupport
FOUND_CELL_CLASS, FOUND_CELL_STYLE, FOUND_TEXT_CLASS, FOUND_TEXT_STYLE, SEARCH_FIELD_BACKGROUND_STYLE, SEARCH_FIELD_NOT_FOUND_BACKGROUND_STYLE, TABLE_VIEW_CSS, TREE_TABLE_VIEW_CSS
-
Constructor Summary
ConstructorsConstructorDescriptionTableFindSupportBase
(FindTextFieldSupport pFindTextFieldSupport) TableFindSupportBase
(FindTextFieldSupport pFindTextFieldSupport, T pTable, boolean pSearchInBackground) -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.BooleanProperty
protected void
protected TableFindSupportBase<T,
C>.FindTask abstract javafx.scene.control.TablePositionBase<?>
createTablePosition
(T pTable, int pRow, C pColumn) javafx.beans.property.ObjectProperty<T>
javafx.beans.property.ReadOnlyProperty<javafx.scene.control.TableSelectionModel<?>>
protected javafx.scene.control.TablePositionBase<?>
find
(T pTable, javafx.scene.control.TablePositionBase<?> pFromPos, javafx.scene.control.TablePositionBase<?> pToPos, String pFindText) protected javafx.scene.control.TablePositionBase<?>
findAndSelect
(T pTable, javafx.scene.control.TablePositionBase<?> pFromPos, javafx.scene.control.TablePositionBase<?> pToPos, String pFindText) protected javafx.scene.control.TablePositionBase<?>
protected javafx.scene.control.TablePositionBase<?>
protected javafx.scene.control.TablePositionBase<?>
protected javafx.scene.control.TablePositionBase<?>
findNextOccurrence
(boolean pBackwards) protected javafx.scene.control.TablePositionBase<?>
findNextOccurrence
(T pTable, boolean pBackwards) Same asfindNext(Control, boolean)
, but returnsnull
instead of throwingPatternSyntaxException
, if not in background mode.protected javafx.scene.control.TablePositionBase<?>
findNextOccurrence
(T pTable, javafx.scene.control.TablePositionBase<?> pFromPos, boolean pBackwards) Same asfindNext(Control, TablePositionBase, boolean)
, but returnsnull
instead of throwingPatternSyntaxException
, if not in background mode.protected void
protected List<javafx.beans.Observable>
boolean
Gets the value of the property autoSelect.abstract javafx.util.Callback<? extends javafx.scene.control.TableColumnBase<?,
?>, ? extends javafx.scene.control.IndexedCell<?>> getCellFactory
(C pColumn) protected Map<javafx.scene.control.TableColumnBase,
javafx.util.Callback> abstract javafx.collections.ObservableList<C>
getColumns
(T pTable) Gets the value of the property currentTable.javafx.scene.control.TableSelectionModel<?>
Gets the value of the property currentTableSelectionModel.static String
getDisplayText
(javafx.scene.control.TableColumnBase<?, ?> pColumn, Object pItem) protected final AbstractObservable.Exposed
javafx.beans.Observable
Gets an observable which fires events when the table selection changes because of an 'find' event - the previous/next buttons are clicked, selection change due to find string/type change, etc.abstract javafx.scene.control.TablePositionBase<?>
getFirstCellPos
(T pTable) Returns the first cell or row position, depending on whether cell selection is enabled, ornull
if the table is empty or has no columns.protected javafx.scene.control.TablePositionBase<?>
getFirstSelectedCell
(T pTable) int
getItemCount
(T pTable) abstract List<?>
abstract javafx.scene.control.TablePositionBase<?>
getLastCellPos
(T pTable) Returns the last cell or row position, depending on whether cell selection is enabled, ornull
if the table is empty or has no columns.Gets the value of the property searchFunction.javafx.collections.ObservableList<? extends javafx.scene.control.TablePositionBase>
abstract javafx.collections.ObservableList<? extends javafx.scene.control.TablePositionBase>
getSelectedCells
(T pTable) abstract javafx.scene.control.TableSelectionModel<?>
getSelectionModel
(T pTable) protected void
void
static void
installDefaultStyles
(TableFindSupportBase<?, ?> pFindSupport) protected boolean
protected <S extends javafx.scene.control.TableColumnBase>
booleanisMatchingCell
(javafx.scene.control.TablePositionBase<S> pPos, Function<String, Boolean> pIsMatch) protected boolean
isMatchingRow
(T pTable, int pRow, Function<String, Boolean> pIsMatch) boolean
isSearchable
(javafx.scene.control.TableColumnBase<?, ?> pColumn) abstract javafx.scene.control.TablePositionBase<?>
nextPosition
(T pTable, javafx.scene.control.TablePositionBase<?> pPos) Returns the position of the next cell ornull
if there is no next cell.abstract Stream<? extends javafx.scene.control.TablePositionBase<?>>
positionStream
(T pTable, javafx.scene.control.TablePositionBase<?> pFrom, javafx.scene.control.TablePositionBase<?> pTo) Returns a stream of positions frompFromPos
(inclusive) topToPos
(inclusive).abstract javafx.scene.control.TablePositionBase<?>
prevPosition
(T pTable, javafx.scene.control.TablePositionBase<?> pPos) Returns the position of the previous cell ornull
if there is no previous cell or if the specified position isnull
.javafx.beans.property.ObjectProperty<TableFindSupportBase<T,
C>.SearchFunction> protected final boolean
javafx.beans.property.ReadOnlyProperty<javafx.scene.control.TablePositionBase<?>>
Note that the returned value isnull
if multiple items are selected.protected javafx.scene.control.TablePositionBase<?>
selectNext
(boolean pBackwards) protected javafx.scene.control.TablePositionBase<?>
selectNext
(T pTable, boolean pBackwards) Returns the position of the selected cell/row, ornull
if no match occurs.protected abstract void
selectPosition
(T pTable, javafx.scene.control.TablePositionBase<?> pPos) Selects the specified cell/row and ensures that it's visible.void
setAutoSelect
(boolean pAutoSelect) Sets the value of the property autoSelect.abstract void
setCellFactory
(C pColumn, javafx.util.Callback<? extends javafx.scene.control.TableColumnBase<?, ?>, ? extends javafx.scene.control.IndexedCell<?>> pCellFactory) void
setCurrentTable
(T pCurrentTable) Sets the value of the property currentTable.static <V> void
setStringConverter
(javafx.scene.control.TableColumnBase<?, V> pColumn, Function<V, String> pConverter) protected String
toLowerCase
(String pFindText) protected void
protected abstract void
protected void
javafx.scene.control.TablePositionBase<?>
protected javafx.scene.control.TablePositionBase<?>
updateTableSelection
(T pTable) Methods inherited from class com.iamsoft.util.ui.javafx.table.AbstractTableFindSupport
cellFactoryFilterProperty, cellFactoryProperty, columnFilterProperty, disabledProperty, errorMessageProperty, findStrategyProperty, getCellFactory, getCellFactoryFilter, getColumnFilter, getErrorMessage, getFindStrategy, getFindTextFieldSupport, getFoundCellClass, getFoundCellStyle, getFoundTextClass, getFoundTextStyle, getLineWrap, getMatchCase, getMatchCount, getSearchField, getSearchFieldBackgroundStyle, getSearchProgress, getSearchResult, getSearchResultInfo, getSearchResultMessage, getSelectedMatchRange, getSelectedPosition, hasNoOccurrences, hasSearchInProgress, installStylesheet, isDisabled, lineWrapProperty, matchCaseProperty, matchCountProperty, matchCountWrapper, nextBtnDisable, nextBtnDisableProperty, noOccurrences, noOccurrencesProperty, prevBtnDisable, prevBtnDisableProperty, searchFieldBackgroundStyle, searchFieldBackgroundStyleProperty, searchInProgress, searchInProgressProperty, searchProgress, searchProgressProperty, searchResultInfo, searchResultInfoProperty, searchResultMessage, searchResultMessageProperty, searchResultProperty, selectedMatchRangeProperty, selectedMatchRangeWrapper, selectedPositionWrapper, selectNext, selectPrev, setCellFactory, setCellFactoryFilter, setColumnFilter, setDisabled, setErrorMessage, setFindStrategy, setFoundCellClass, setFoundCellStyle, setFoundTextClass, setFoundTextStyle, setLineWrap, setMatchCase, setSearchResult, setupSearchField, setupSearchFieldBackgroundStyle, setupSearchResultInfo, setupSearchResultMessage, updateSearchProgress, updateSelectedMatchRange
-
Property Details
-
autoSelect
public javafx.beans.property.BooleanProperty autoSelectProperty- See Also:
-
currentTable
public javafx.beans.property.ObjectProperty<T extends javafx.scene.control.Control> currentTableProperty- See Also:
-
searchFunction
public javafx.beans.property.ObjectProperty<TableFindSupportBase<T extends javafx.scene.control.Control,C extends javafx.scene.control.TableColumnBase>.SearchFunction> searchFunctionProperty- See Also:
-
currentTableSelectionModel
public javafx.beans.property.ReadOnlyProperty<javafx.scene.control.TableSelectionModel<?>> currentTableSelectionModelProperty- See Also:
-
selectedPosition
public javafx.beans.property.ReadOnlyProperty<javafx.scene.control.TablePositionBase<?>> selectedPositionProperty- Overrides:
selectedPositionProperty
in classAbstractTableFindSupport
- See Also:
-
-
Field Details
-
DUMMY_OBSERVABLE
-
-
Constructor Details
-
TableFindSupportBase
-
TableFindSupportBase
public TableFindSupportBase(FindTextFieldSupport pFindTextFieldSupport, T pTable, boolean pSearchInBackground)
-
-
Method Details
-
getFindSelectionChange
public javafx.beans.Observable getFindSelectionChange()Description copied from class:AbstractTableFindSupport
Gets an observable which fires events when the table selection changes because of an 'find' event - the previous/next buttons are clicked, selection change due to find string/type change, etc.- Specified by:
getFindSelectionChange
in classAbstractTableFindSupport
- Returns:
- observable
-
getColToOriginalCellFactory
protected Map<javafx.scene.control.TableColumnBase,javafx.util.Callback> getColToOriginalCellFactory() -
getFindObservable
-
searchInBackground
protected final boolean searchInBackground() -
autoSelectProperty
public javafx.beans.property.BooleanProperty autoSelectProperty()- See Also:
-
getAutoSelect
public boolean getAutoSelect()Gets the value of the property autoSelect.- Property description:
-
setAutoSelect
public void setAutoSelect(boolean pAutoSelect) Sets the value of the property autoSelect.- Property description:
-
currentTableProperty
- See Also:
-
getCurrentTable
Gets the value of the property currentTable.- Property description:
-
setCurrentTable
Sets the value of the property currentTable.- Property description:
-
searchFunctionProperty
public javafx.beans.property.ObjectProperty<TableFindSupportBase<T,C>.SearchFunction> searchFunctionProperty()- See Also:
-
getSearchFunction
Gets the value of the property searchFunction.- Property description:
-
currentTableSelectionModelProperty
public javafx.beans.property.ReadOnlyProperty<javafx.scene.control.TableSelectionModel<?>> currentTableSelectionModelProperty()- See Also:
-
getCurrentTableSelectionModel
public javafx.scene.control.TableSelectionModel<?> getCurrentTableSelectionModel()Gets the value of the property currentTableSelectionModel.- Property description:
-
selectedPositionProperty
public javafx.beans.property.ReadOnlyProperty<javafx.scene.control.TablePositionBase<?>> selectedPositionProperty()Description copied from class:AbstractTableFindSupport
Note that the returned value isnull
if multiple items are selected.- Overrides:
selectedPositionProperty
in classAbstractTableFindSupport
- See Also:
-
getColumns
-
getCellFactory
public abstract javafx.util.Callback<? extends javafx.scene.control.TableColumnBase<?,?>, getCellFactory? extends javafx.scene.control.IndexedCell<?>> (C pColumn) -
setCellFactory
public abstract void setCellFactory(C pColumn, javafx.util.Callback<? extends javafx.scene.control.TableColumnBase<?, ?>, ? extends javafx.scene.control.IndexedCell<?>> pCellFactory) -
getItems
-
getSelectionModel
-
getSelectedCells
public abstract javafx.collections.ObservableList<? extends javafx.scene.control.TablePositionBase> getSelectedCells(T pTable) -
getSelectedCells
public javafx.collections.ObservableList<? extends javafx.scene.control.TablePositionBase> getSelectedCells() -
createTablePosition
-
positionStream
public abstract Stream<? extends javafx.scene.control.TablePositionBase<?>> positionStream(T pTable, javafx.scene.control.TablePositionBase<?> pFrom, javafx.scene.control.TablePositionBase<?> pTo) Returns a stream of positions frompFromPos
(inclusive) topToPos
(inclusive). IfpFromPos
is 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
Returns the first cell or row position, depending on whether cell selection is enabled, ornull
if the table is empty or has no columns. -
getLastCellPos
Returns the last cell or row position, depending on whether cell selection is enabled, ornull
if the table is empty or has no columns. -
prevPosition
public abstract javafx.scene.control.TablePositionBase<?> prevPosition(T pTable, javafx.scene.control.TablePositionBase<?> pPos) Returns the position of the previous cell ornull
if there is no previous cell or if the specified position isnull
. -
nextPosition
public abstract javafx.scene.control.TablePositionBase<?> nextPosition(T pTable, javafx.scene.control.TablePositionBase<?> pPos) Returns the position of the next cell ornull
if there is no next cell. If the specified position isnull
and the table is not empty and there is at least one column in the table, the first cell is returned. -
selectPosition
Selects the specified cell/row and ensures that it's visible. The method does nothing if any of the arguments isnull
. -
updateFixedCellSize
protected abstract void updateFixedCellSize() -
getItemCount
-
createFindTask
-
cancelCurrentFindTask
protected void cancelCurrentFindTask() -
updateFindObservables
protected void updateFindObservables() -
getAdditionalFindObservables
-
handleCellSelectionModeChanges
protected void handleCellSelectionModeChanges() -
updateTableSelection
public javafx.scene.control.TablePositionBase<?> updateTableSelection() -
updateTableSelection
-
findNextOccurrence
protected javafx.scene.control.TablePositionBase<?> findNextOccurrence(boolean pBackwards) -
findNextOccurrence
protected javafx.scene.control.TablePositionBase<?> findNextOccurrence(T pTable, boolean pBackwards) Same asfindNext(Control, boolean)
, but returnsnull
instead of throwingPatternSyntaxException
, if not in background mode. -
findNextOccurrence
protected javafx.scene.control.TablePositionBase<?> findNextOccurrence(T pTable, javafx.scene.control.TablePositionBase<?> pFromPos, boolean pBackwards) Same asfindNext(Control, TablePositionBase, boolean)
, but returnsnull
instead of throwingPatternSyntaxException
, if not in background mode. -
findFirst
-
findNext
- Returns:
- the position of the cell/row (without selecting it),
or
null
if no match occurs. - Throws:
PatternSyntaxException
- if not in background mode and invalid regex pattern is provided.
-
findNext
protected javafx.scene.control.TablePositionBase<?> findNext(T pTable, javafx.scene.control.TablePositionBase<?> pFromPos, boolean pBackwards) - Returns:
- the position of the cell/row (without selecting it),
or
null
if no match occurs. - Throws:
PatternSyntaxException
- if not in background mode and invalid regex pattern is provided.
-
find
protected javafx.scene.control.TablePositionBase<?> find(T pTable, javafx.scene.control.TablePositionBase<?> pFromPos, javafx.scene.control.TablePositionBase<?> pToPos, String pFindText) - Throws:
PatternSyntaxException
- if not in background mode and invalid regex pattern is provided.
-
findAndSelect
protected javafx.scene.control.TablePositionBase<?> findAndSelect(T pTable, javafx.scene.control.TablePositionBase<?> pFromPos, javafx.scene.control.TablePositionBase<?> pToPos, String pFindText) - Throws:
PatternSyntaxException
- if invalid regex pattern is provided.
-
selectNext
protected javafx.scene.control.TablePositionBase<?> selectNext(boolean pBackwards) - Specified by:
selectNext
in classAbstractTableFindSupport
-
selectNext
Returns the position of the selected cell/row, ornull
if no match occurs.- Throws:
PatternSyntaxException
- if not in background mode and invalid regex pattern is provided.
-
isSearchable
public boolean isSearchable(javafx.scene.control.TableColumnBase<?, ?> pColumn) -
isMatchingRow
- Returns:
true
if it's a matching row.
-
isMatchingCell
-
getFirstSelectedCell
-
toLowerCase
-
updateSearchFunction
protected void updateSearchFunction() -
isInSearchState
protected boolean isInSearchState() -
fireFindSelectionChange
protected void fireFindSelectionChange() -
toRow
-
getDisplayText
-
setStringConverter
-
installDefaultStyles
public void installDefaultStyles() -
installDefaultStyles
-