Class FilterRowDataLayer<T>
java.lang.Object
org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
org.eclipse.nebula.widgets.nattable.layer.DataLayer
org.eclipse.nebula.widgets.nattable.filterrow.FilterRowDataLayer<T>
- Type Parameters:
T- type of the underlying row object
- All Implemented Interfaces:
ILayer,ILayerListener,IUniqueIndexLayer,IPersistable
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPrefix of the column label applied to each column in the filter rowstatic final StringPrefix for the persistence key in the properties fileFields inherited from class org.eclipse.nebula.widgets.nattable.layer.DataLayer
columnWidthConfig, dataProvider, DEFAULT_COLUMN_WIDTH, DEFAULT_ROW_HEIGHT, PERSISTENCE_KEY_COLUMN_WIDTH, PERSISTENCE_KEY_ROW_HEIGHT, rowHeightConfigFields inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
commandHandlers, eventHandlers, eventHelperLock, layerPainterFields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionFilterRowDataLayer(IFilterStrategy<T> filterStrategy, ILayer columnHeaderLayer, IDataProvider columnHeaderDataProvider, IConfigRegistry configRegistry) Creates aFilterRowDataLayerwith the default configurationDefaultFilterRowConfiguration.FilterRowDataLayer(IFilterStrategy<T> filterStrategy, ILayer columnHeaderLayer, IDataProvider columnHeaderDataProvider, IConfigRegistry configRegistry, boolean useDefaultConfiguration) Creates aFilterRowDataLayer. -
Method Summary
Modifier and TypeMethodDescriptionbooleandoCommand(ILayerCommand command) Opportunity to respond to a command as it flows down the stack.intintgetColumnIndexByPosition(int columnPosition) This is the root coordinate system, so the column index is always equal to the column position.intgetColumnPositionByX(int x) Returns the column position that contains the given x coordinate.intgetColumnWidthByPosition(int columnPosition) Returns the width in pixels of the given column.getConfigLabelsByPosition(int columnPosition, int rowPosition) Returns the config labels for the cell at the given coordinates.intintintgetStartXOfColumnPosition(int columnPosition) Returns the x offset in pixels of the given column.intgetWidth()Returns the total width in pixels of this layer.booleanisColumnPositionResizable(int columnPosition) Check if the column at the given position is resizable.intlocalToUnderlyingColumnPosition(int localColumnPosition) Convert a column position to the coordinates of the underlying layer.intunderlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer, int underlyingColumnPosition) Transforms the column position relative to the given underlying layer to this layer coordinates.underlyingToLocalColumnPositions(ILayer sourceUnderlyingLayer, Collection<Range> underlyingColumnPositionRanges) Transforms the column position ranges relative to the given underlying layer to this layer coordinates.Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.DataLayer
downScaleColumnWidth, downScaleRowHeight, getColumnPositionByIndex, getConfiguredColumnWidthByPosition, getConfiguredColumnWidthPercentageByPosition, getConfiguredMinColumnWidthByPosition, getConfiguredMinRowHeightByPosition, getConfiguredRowHeightByPosition, getConfiguredRowHeightPercentageByPosition, getDataProvider, getDataValue, getDataValueByPosition, getDefaultColumnWidth, getDefaultMinColumnWidth, getDefaultMinRowHeight, getDefaultRowHeight, getHeight, getMinColumnWidth, getMinRowHeight, getPreferredHeight, getPreferredRowCount, getRowCount, getRowHeightByPosition, getRowIndexByPosition, getRowPositionByIndex, getRowPositionByY, getStartYOfRowPosition, getUnderlyingLayerByPosition, getUnderlyingLayersByColumnPosition, getUnderlyingLayersByRowPosition, isColumnPercentageSizing, isColumnPercentageSizing, isDistributeRemainingColumnSpace, isDistributeRemainingRowSpace, isFixColumnPercentageValuesOnResize, isFixRowPercentageValuesOnResize, isMinColumnWidthConfigured, isMinColumnWidthConfigured, isMinRowHeightConfigured, isMinRowHeightConfigured, isRowPercentageSizing, isRowPercentageSizing, isRowPositionResizable, loadState, localToUnderlyingRowPosition, registerCommandHandlers, resetColumnWidth, resetColumnWidthConfiguration, resetMinColumnWidth, resetMinRowHeight, resetRowHeight, resetRowHeightConfiguration, saveState, setColumnPercentageSizing, setColumnPercentageSizing, setColumnPositionResizable, setColumnsResizableByDefault, setColumnWidthByPosition, setColumnWidthByPosition, setColumnWidthPercentageByPosition, setColumnWidthPercentageByPosition, setDataProvider, setDataValue, setDataValueByPosition, setDefaultColumnWidth, setDefaultColumnWidthByPosition, setDefaultMinColumnWidth, setDefaultMinRowHeight, setDefaultRowHeight, setDefaultRowHeightByPosition, setDistributeRemainingColumnSpace, setDistributeRemainingRowSpace, setFixColumnPercentageValuesOnResize, setFixRowPercentageValuesOnResize, setMinColumnWidth, setMinRowHeight, setRowHeightByPosition, setRowHeightByPosition, setRowHeightPercentageByPosition, setRowHeightPercentageByPosition, setRowPercentageSizing, setRowPercentageSizing, setRowPositionResizable, setRowsResizableByDefault, underlyingToLocalRowPosition, underlyingToLocalRowPositions, upScaleColumnWidth, upScaleRowHeightMethods inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
addConfiguration, addLayerListener, clearConfiguration, configure, dispose, fireLayerEvent, getBoundsByPosition, getCellByPosition, getCellPainter, getClientAreaProvider, getConfigLabelAccumulator, getDisplayModeByPosition, getLayerPainter, getRegionLabelsByXY, getRegionName, handleLayerEvent, hasLayerListener, isDynamicSizeLayer, registerCommandHandler, registerEventHandler, registerPersistable, removeLayerListener, setClientAreaProvider, setConfigLabelAccumulator, setLayerPainter, setRegionName, toString, unregisterCommandHandler, unregisterEventHandler, unregisterPersistableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.nebula.widgets.nattable.layer.ILayer
addLayerListener, configure, dispose, fireLayerEvent, getBoundsByPosition, getCellByPosition, getCellPainter, getClientAreaProvider, getDisplayModeByPosition, getLayerPainter, getRegionLabelsByXY, hasLayerListener, isDynamicSizeLayer, registerCommandHandler, registerPersistable, removeLayerListener, setClientAreaProvider, unregisterCommandHandler, unregisterPersistableMethods inherited from interface org.eclipse.nebula.widgets.nattable.layer.ILayerListener
handleLayerEvent
-
Field Details
-
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
Prefix for the persistence key in the properties file- See Also:
-
-
Constructor Details
-
FilterRowDataLayer
public FilterRowDataLayer(IFilterStrategy<T> filterStrategy, ILayer columnHeaderLayer, IDataProvider columnHeaderDataProvider, IConfigRegistry configRegistry) Creates aFilterRowDataLayerwith the default configurationDefaultFilterRowConfiguration.- Parameters:
filterStrategy- TheIFilterStrategyto which the set filter value should be applied.columnHeaderLayer- TheILayerto which thisFilterRowDataLayeris dependent. Typically theColumnHeaderLayer.columnHeaderDataProvider- TheIDataProviderof the column header needed to retrieve the real column count of the column header and not a transformed one.configRegistry- TheIConfigRegistryneeded to retrieve theIDisplayConverterfor converting the values on state save/load operations.
-
FilterRowDataLayer
public FilterRowDataLayer(IFilterStrategy<T> filterStrategy, ILayer columnHeaderLayer, IDataProvider columnHeaderDataProvider, IConfigRegistry configRegistry, boolean useDefaultConfiguration) Creates aFilterRowDataLayer.- Parameters:
filterStrategy- TheIFilterStrategyto which the set filter value should be applied.columnHeaderLayer- TheILayerto which thisFilterRowDataLayeris dependent. Typically theColumnHeaderLayer.columnHeaderDataProvider- TheIDataProviderof the column header needed to retrieve the real column count of the column header and not a transformed one.configRegistry- TheIConfigRegistryneeded to retrieve theIDisplayConverterfor converting the values on state save/load operations.useDefaultConfiguration-trueif the default configuration should be applied,falseif a custom configuration will be applied afterwards.- Since:
- 2.3
-
-
Method Details
-
getFilterRowDataProvider
-
doCommand
Description copied from interface:ILayerOpportunity 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) -
getConfigLabelsByPosition
Description copied from interface:ILayerReturns the config labels for the cell at the given coordinates. Needed to retrieve the corresponding configurations out of theIConfigRegistry.- Specified by:
getConfigLabelsByPositionin interfaceILayer- Overrides:
getConfigLabelsByPositionin classAbstractLayer- Parameters:
columnPosition- The column position of the cell.rowPosition- The row position of the cell.- Returns:
- The
LabelStackwith the config labels for the cell at the given coordinates.
-
getColumnCount
public int getColumnCount()- Specified by:
getColumnCountin interfaceILayer- Overrides:
getColumnCountin classDataLayer- Returns:
- The number of columns in this layer.
-
getPreferredColumnCount
public int getPreferredColumnCount()- Specified by:
getPreferredColumnCountin interfaceILayer- Overrides:
getPreferredColumnCountin classDataLayer
-
getColumnIndexByPosition
public int getColumnIndexByPosition(int columnPosition) Description copied from class:DataLayerThis is the root coordinate system, so the column index is always equal to the column position.- Specified by:
getColumnIndexByPositionin interfaceILayer- Overrides:
getColumnIndexByPositionin classDataLayer- 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:ILayerConvert a column position to the coordinates of the underlying layer. This is possible since each layer is aware of its underlying layer.- Specified by:
localToUnderlyingColumnPositionin interfaceILayer- Overrides:
localToUnderlyingColumnPositionin classDataLayer- 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:ILayerTransforms the column position relative to the given underlying layer to this layer coordinates.- Specified by:
underlyingToLocalColumnPositionin interfaceILayer- Overrides:
underlyingToLocalColumnPositionin classDataLayer- 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:ILayerTransforms the column position ranges relative to the given underlying layer to this layer coordinates.- Specified by:
underlyingToLocalColumnPositionsin interfaceILayer- Overrides:
underlyingToLocalColumnPositionsin classDataLayer- 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:ILayerReturns the total width in pixels of this layer. -
getPreferredWidth
public int getPreferredWidth()- Specified by:
getPreferredWidthin interfaceILayer- Overrides:
getPreferredWidthin classDataLayer
-
getColumnWidthByPosition
public int getColumnWidthByPosition(int columnPosition) Description copied from interface:ILayerReturns the width in pixels of the given column. The width of invisible and non-existing columns is 0.- Specified by:
getColumnWidthByPositionin interfaceILayer- Overrides:
getColumnWidthByPositionin classDataLayer- Parameters:
columnPosition- The column position in this layer.- Returns:
- The width of the column.
-
isColumnPositionResizable
public boolean isColumnPositionResizable(int columnPosition) Description copied from interface:ILayerCheck if the column at the given position is resizable.- Specified by:
isColumnPositionResizablein interfaceILayer- Overrides:
isColumnPositionResizablein classDataLayer- Parameters:
columnPosition- The column position to check.- Returns:
trueif the column is resizable,falseif not.
-
getColumnPositionByX
public int getColumnPositionByX(int x) Description copied from interface:ILayerReturns the column position that contains the given x coordinate.- Specified by:
getColumnPositionByXin interfaceILayer- Overrides:
getColumnPositionByXin classDataLayer- 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:ILayerReturns the x offset in pixels of the given column.- Specified by:
getStartXOfColumnPositionin interfaceILayer- Overrides:
getStartXOfColumnPositionin classDataLayer- Parameters:
columnPosition- The column position in this layer.- Returns:
- The x offset of the column, or -1.
-
getProvidedLabels
- Specified by:
getProvidedLabelsin interfaceILayer- Overrides:
getProvidedLabelsin classAbstractLayer- Returns:
- The collection of labels that are provided by this layer.
- Since:
- 1.4
-