Class FilterRowDataLayer<T>

Type Parameters:
T - type of the underlying row object
All Implemented Interfaces:
ILayer, ILayerListener, IUniqueIndexLayer, IPersistable

public class FilterRowDataLayer<T> extends DataLayer
DataLayer with a custom IDataProvider which stores/tracks the filter text on columns. Applies region name of GridRegion.FILTER_ROW to the filter row. Persists the filter text to the properties file.
  • Field Details

    • FILTER_ROW_COLUMN_LABEL_PREFIX

      public static final String FILTER_ROW_COLUMN_LABEL_PREFIX
      Prefix of the column label applied to each column in the filter row
      See Also:
    • PERSISTENCE_KEY_FILTER_ROW_TOKENS

      public static final String PERSISTENCE_KEY_FILTER_ROW_TOKENS
      Prefix for the persistence key in the properties file
      See Also:
  • Constructor Details

  • Method Details

    • getFilterRowDataProvider

      public FilterRowDataProvider<T> getFilterRowDataProvider()
    • doCommand

      public boolean doCommand(ILayerCommand command)
      Description copied from interface: ILayer
      Opportunity to respond to a command as it flows down the stack. If the layer is not interested in the command it should allow the command to keep traveling down the stack.

      Note: Before the layer can process a command it must convert the command to its local coordinates using ILayerCommand.convertToTargetLayer(ILayer)

      Specified by:
      doCommand in interface ILayer
      Overrides:
      doCommand in class DataLayer
      Parameters:
      command - The command to execute.
      Returns:
      true if the command has been handled and was therefore consumed, false otherwise.
    • getConfigLabelsByPosition

      public LabelStack getConfigLabelsByPosition(int columnPosition, int rowPosition)
      Description copied from interface: ILayer
      Returns the config labels for the cell at the given coordinates. Needed to retrieve the corresponding configurations out of the IConfigRegistry.
      Specified by:
      getConfigLabelsByPosition in interface ILayer
      Overrides:
      getConfigLabelsByPosition in class AbstractLayer
      Parameters:
      columnPosition - The column position of the cell.
      rowPosition - The row position of the cell.
      Returns:
      The LabelStack with the config labels for the cell at the given coordinates.
    • getColumnCount

      public int getColumnCount()
      Specified by:
      getColumnCount in interface ILayer
      Overrides:
      getColumnCount in class DataLayer
      Returns:
      The number of columns in this layer.
    • getPreferredColumnCount

      public int getPreferredColumnCount()
      Specified by:
      getPreferredColumnCount in interface ILayer
      Overrides:
      getPreferredColumnCount in class DataLayer
    • getColumnIndexByPosition

      public int getColumnIndexByPosition(int columnPosition)
      Description copied from class: DataLayer
      This is the root coordinate system, so the column index is always equal to the column position.
      Specified by:
      getColumnIndexByPosition in interface ILayer
      Overrides:
      getColumnIndexByPosition in class DataLayer
      Parameters:
      columnPosition - The column position relative to this layer.
      Returns:
      An underlying non-transformed column index, or -1 if the given column position does not exist within this coordinate system.
    • localToUnderlyingColumnPosition

      public int localToUnderlyingColumnPosition(int localColumnPosition)
      Description copied from interface: ILayer
      Convert a column position to the coordinates of the underlying layer. This is possible since each layer is aware of its underlying layer.
      Specified by:
      localToUnderlyingColumnPosition in interface ILayer
      Overrides:
      localToUnderlyingColumnPosition in class DataLayer
      Parameters:
      localColumnPosition - column position in local (the layer's own) coordinates
      Returns:
      column position in the underlying layer's coordinates
    • underlyingToLocalColumnPosition

      public int underlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer, int underlyingColumnPosition)
      Description copied from interface: ILayer
      Transforms the column position relative to the given underlying layer to this layer coordinates.
      Specified by:
      underlyingToLocalColumnPosition in interface ILayer
      Overrides:
      underlyingToLocalColumnPosition in class DataLayer
      Parameters:
      sourceUnderlyingLayer - The underlying layer to which the given column position matches.
      underlyingColumnPosition - The column position in the given underlying layer that should be converted to a local column position.
      Returns:
      The given column position transformed to be local to this layer.
    • underlyingToLocalColumnPositions

      public Collection<Range> underlyingToLocalColumnPositions(ILayer sourceUnderlyingLayer, Collection<Range> underlyingColumnPositionRanges)
      Description copied from interface: ILayer
      Transforms the column position ranges relative to the given underlying layer to this layer coordinates.
      Specified by:
      underlyingToLocalColumnPositions in interface ILayer
      Overrides:
      underlyingToLocalColumnPositions in class DataLayer
      Parameters:
      sourceUnderlyingLayer - The underlying layer to which the given column positions match.
      underlyingColumnPositionRanges - The column position ranges relative to the given underlying layer that should be converted to local column positions.
      Returns:
      The given column position ranges transformed to this layer.
    • getWidth

      public int getWidth()
      Description copied from interface: ILayer
      Returns the total width in pixels of this layer.
      Specified by:
      getWidth in interface ILayer
      Overrides:
      getWidth in class DataLayer
      Returns:
      The total width in pixels of this layer.
    • getPreferredWidth

      public int getPreferredWidth()
      Specified by:
      getPreferredWidth in interface ILayer
      Overrides:
      getPreferredWidth in class DataLayer
    • getColumnWidthByPosition

      public int getColumnWidthByPosition(int columnPosition)
      Description copied from interface: ILayer
      Returns the width in pixels of the given column. The width of invisible and non-existing columns is 0.
      Specified by:
      getColumnWidthByPosition in interface ILayer
      Overrides:
      getColumnWidthByPosition in class DataLayer
      Parameters:
      columnPosition - The column position in this layer.
      Returns:
      The width of the column.
    • isColumnPositionResizable

      public boolean isColumnPositionResizable(int columnPosition)
      Description copied from interface: ILayer
      Check if the column at the given position is resizable.
      Specified by:
      isColumnPositionResizable in interface ILayer
      Overrides:
      isColumnPositionResizable in class DataLayer
      Parameters:
      columnPosition - The column position to check.
      Returns:
      true if the column is resizable, false if not.
    • getColumnPositionByX

      public int getColumnPositionByX(int x)
      Description copied from interface: ILayer
      Returns the column position that contains the given x coordinate.
      Specified by:
      getColumnPositionByX in interface ILayer
      Overrides:
      getColumnPositionByX in class DataLayer
      Parameters:
      x - A horizontal pixel location relative to the pixel boundary of this layer.
      Returns:
      A column position relative to the associated coordinate system, or -1 if there is no column that contains x.
    • getStartXOfColumnPosition

      public int getStartXOfColumnPosition(int columnPosition)
      Description copied from interface: ILayer
      Returns the x offset in pixels of the given column.
      Specified by:
      getStartXOfColumnPosition in interface ILayer
      Overrides:
      getStartXOfColumnPosition in class DataLayer
      Parameters:
      columnPosition - The column position in this layer.
      Returns:
      The x offset of the column, or -1.
    • getProvidedLabels

      public Collection<String> getProvidedLabels()
      Specified by:
      getProvidedLabels in interface ILayer
      Overrides:
      getProvidedLabels in class AbstractLayer
      Returns:
      The collection of labels that are provided by this layer.
      Since:
      1.4