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 Details

  • Field Details

  • Constructor Details

    • TableFindSupportBase

      public TableFindSupportBase(FindTextFieldSupport pFindTextFieldSupport)
    • 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 class AbstractTableFindSupport
      Returns:
      observable
    • getColToOriginalCellFactory

      protected Map<javafx.scene.control.TableColumnBase,javafx.util.Callback> getColToOriginalCellFactory()
    • getFindObservable

      protected final AbstractObservable.Exposed 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

      public javafx.beans.property.ObjectProperty<T> currentTableProperty()
      See Also:
    • getCurrentTable

      public T getCurrentTable()
      Gets the value of the property currentTable.
      Property description:
    • setCurrentTable

      public void setCurrentTable(T pCurrentTable)
      Sets the value of the property currentTable.
      Property description:
    • searchFunctionProperty

      public javafx.beans.property.ObjectProperty<TableFindSupportBase<T,C>.SearchFunction> searchFunctionProperty()
      See Also:
    • getSearchFunction

      public TableFindSupportBase<T,C>.SearchFunction 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 is null if multiple items are selected.
      Overrides:
      selectedPositionProperty in class AbstractTableFindSupport
      See Also:
    • getColumns

      public abstract javafx.collections.ObservableList<C> getColumns(T pTable)
    • getCellFactory

      public abstract javafx.util.Callback<? extends javafx.scene.control.TableColumnBase<?,?>,? extends javafx.scene.control.IndexedCell<?>> getCellFactory(C pColumn)
    • setCellFactory

      public abstract void setCellFactory(C pColumn, javafx.util.Callback<? extends javafx.scene.control.TableColumnBase<?,?>,? extends javafx.scene.control.IndexedCell<?>> pCellFactory)
    • getItems

      public abstract List<?> getItems(T pTable)
    • getSelectionModel

      public abstract javafx.scene.control.TableSelectionModel<?> getSelectionModel(T pTable)
    • 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

      public abstract javafx.scene.control.TablePositionBase<?> createTablePosition(T pTable, int pRow, C pColumn)
    • 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 from pFromPos (inclusive) to pToPos (inclusive). If pFromPos is greater than pToPos, the elements in the stream are provided in backward order.
      Throws:
      IllegalArgumentException - if any of the specified positions is null, 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 abstract javafx.scene.control.TablePositionBase<?> getFirstCellPos(T pTable)
      Returns the first cell or row position, depending on whether cell selection is enabled, or null if the table is empty or has no columns.
    • getLastCellPos

      public abstract javafx.scene.control.TablePositionBase<?> getLastCellPos(T pTable)
      Returns the last cell or row position, depending on whether cell selection is enabled, or null 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 or null if there is no previous cell or if the specified position is null.
    • nextPosition

      public abstract javafx.scene.control.TablePositionBase<?> nextPosition(T pTable, javafx.scene.control.TablePositionBase<?> pPos)
      Returns the position of the next cell or null if there is no next cell. If the specified position is null and the table is not empty and there is at least one column in the table, the first cell is returned.
    • selectPosition

      protected abstract void selectPosition(T pTable, javafx.scene.control.TablePositionBase<?> pPos)
      Selects the specified cell/row and ensures that it's visible. The method does nothing if any of the arguments is null.
    • updateFixedCellSize

      protected abstract void updateFixedCellSize()
    • getItemCount

      public int getItemCount(T pTable)
    • createFindTask

      protected TableFindSupportBase<T,C>.FindTask createFindTask()
    • cancelCurrentFindTask

      protected void cancelCurrentFindTask()
    • updateFindObservables

      protected void updateFindObservables()
    • getAdditionalFindObservables

      protected List<javafx.beans.Observable> getAdditionalFindObservables()
    • handleCellSelectionModeChanges

      protected void handleCellSelectionModeChanges()
    • updateTableSelection

      public javafx.scene.control.TablePositionBase<?> updateTableSelection()
    • updateTableSelection

      protected javafx.scene.control.TablePositionBase<?> updateTableSelection(T pTable)
    • findNextOccurrence

      protected javafx.scene.control.TablePositionBase<?> findNextOccurrence(boolean pBackwards)
    • findNextOccurrence

      protected javafx.scene.control.TablePositionBase<?> findNextOccurrence(T pTable, boolean pBackwards)
      Same as findNext(Control, boolean), but returns null instead of throwing PatternSyntaxException, if not in background mode.
    • findNextOccurrence

      protected javafx.scene.control.TablePositionBase<?> findNextOccurrence(T pTable, javafx.scene.control.TablePositionBase<?> pFromPos, boolean pBackwards)
      Same as findNext(Control, TablePositionBase, boolean), but returns null instead of throwing PatternSyntaxException, if not in background mode.
    • findFirst

      protected javafx.scene.control.TablePositionBase<?> findFirst(T pTable)
    • findNext

      protected javafx.scene.control.TablePositionBase<?> findNext(T pTable, 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.
    • 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 class AbstractTableFindSupport
    • selectNext

      protected javafx.scene.control.TablePositionBase<?> selectNext(T pTable, boolean pBackwards)
      Returns the position of the selected cell/row, or null 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

      protected boolean isMatchingRow(T pTable, int pRow, Function<String,Boolean> pIsMatch)
      Returns:
      true if it's a matching row.
    • isMatchingCell

      protected <S extends javafx.scene.control.TableColumnBase> boolean isMatchingCell(javafx.scene.control.TablePositionBase<S> pPos, Function<String,Boolean> pIsMatch)
    • getFirstSelectedCell

      protected javafx.scene.control.TablePositionBase<?> getFirstSelectedCell(T pTable)
    • toLowerCase

      protected String toLowerCase(String pFindText)
    • updateSearchFunction

      protected void updateSearchFunction()
    • isInSearchState

      protected boolean isInSearchState()
    • fireFindSelectionChange

      protected void fireFindSelectionChange()
    • toRow

      protected static <T> List<String> toRow(T pItem, List<Function<?,String>> pToStringMappers)
    • getDisplayText

      public static String getDisplayText(javafx.scene.control.TableColumnBase<?,?> pColumn, Object pItem)
    • setStringConverter

      public static <V> void setStringConverter(javafx.scene.control.TableColumnBase<?,V> pColumn, Function<V,String> pConverter)
    • installDefaultStyles

      public void installDefaultStyles()
    • installDefaultStyles

      public static void installDefaultStyles(TableFindSupportBase<?,?> pFindSupport)