Class ColumnFilterDialogModel<R>

java.lang.Object
docking.widgets.table.constraint.dialog.ColumnFilterDialogModel<R>
Type Parameters:
R - the row type for the table

public class ColumnFilterDialogModel<R> extends Object
This class is for constructing and editing ColumnBasedTableFilter. It is used by the ColumnFilterDialog and exists primarily to make testing easier.
  • Constructor Details

    • ColumnFilterDialogModel

      public ColumnFilterDialogModel(RowObjectFilterModel<R> model, TableColumnModel columnModel, ColumnBasedTableFilter<R> currentColumnTableFilter)
      Constructs a new ColumnFilterModel
      Parameters:
      model - the RowObjectFilterModel of the table being filtered.
      columnModel - the TableColumnModel of the table being filtered.
      currentColumnTableFilter - the currently applied TableColumnFilter or null if there is no current TableColumnFilter applied.
  • Method Details

    • getAllColumnFilterData

      public static <R> List<ColumnFilterData<?>> getAllColumnFilterData(RowObjectFilterModel<R> model, TableColumnModel columnModel)
    • dispose

      public void dispose()
      clean up.
    • createFilterRow

      public DialogFilterRow createFilterRow(LogicOperation logicOperation)
      Creates a new filter row (a new major row in the dialog filter panel)
      Parameters:
      logicOperation - the logical operation for how this row interacts with preceding rows
      Returns:
      the new filter row that represents a major row in the dialog filter panel
    • deleteFilterRow

      public void deleteFilterRow(DialogFilterRow filterRow)
      Deletes a filter row (a major row in the dialog filter panel)
      Parameters:
      filterRow - the row to delete.
    • getFilterRows

      public List<DialogFilterRow> getFilterRows()
      Returns a list of all filter rows in this model.
      Returns:
      a list of all filter rows in this model.
    • addListener

      public void addListener(TableFilterDialogModelListener listener)
      Adds a listener to be notified for various changes that occur in this filter model.
      Parameters:
      listener - the listener to add.
    • removeListener

      public void removeListener(TableFilterDialogModelListener listener)
      Removes the given listener.
      Parameters:
      listener - the listener to remove.
    • isValid

      public boolean isValid()
      Checks if this model represents a valid filter. While editing, some elements of the filter may be incomplete or invalid and if so, then this method will return false.
      Returns:
      true if the model represents a valid filter.
    • getTableColumnFilter

      public ColumnBasedTableFilter<R> getTableColumnFilter()
      Builds a ColumnTableFilter from this model if the model is valid.
      Returns:
      a new ColumnTableFilter based on the configuration of this model or null if the model is invalid.
    • clear

      public void clear()
      Clears the model of all filters.
    • getAllColumnFilterData

      public List<ColumnFilterData<?>> getAllColumnFilterData()
      Returns a list of the columnFilterData for all filterable columns in the table
      Returns:
      a list of the columnFilterData for all filterable columns in the table
    • isEmpty

      public boolean isEmpty()
      Return true if there are no conditions (valid or invalid) defined for this filter model.
      Returns:
      true if there are no conditions (valid or invalid) defined for this filter model.
    • hasUnappliedChanges

      public boolean hasUnappliedChanges()
      Returns true if this model has changes that make the filter different from the currently applied filter.
      Returns:
      if there are unapplied user changes to the filter.
    • setCurrentlyAppliedFilter

      public void setCurrentlyAppliedFilter(ColumnBasedTableFilter<R> tableColumnFilter)