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
public class FilterRowDataLayer<T> extends DataLayer
DataLayer
with a customIDataProvider
which stores/tracks the filter text on columns. Applies region name ofGridRegion.FILTER_ROW
to the filter row. Persists the filter text to the properties file.
-
-
Field Summary
Fields Modifier and Type Field Description static String
FILTER_ROW_COLUMN_LABEL_PREFIX
Prefix of the column label applied to each column in the filter rowstatic String
PERSISTENCE_KEY_FILTER_ROW_TOKENS
Prefix for the persistence key in the properties file-
Fields 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, rowHeightConfig
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer
commandHandlers, eventHandlers, eventHelperLock, layerPainter
-
Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description FilterRowDataLayer(IFilterStrategy<T> filterStrategy, ILayer columnHeaderLayer, IDataProvider columnHeaderDataProvider, IConfigRegistry configRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
doCommand(ILayerCommand command)
Opportunity to respond to a command as it flows down the stack.int
getColumnCount()
int
getColumnIndexByPosition(int columnPosition)
This is the root coordinate system, so the column index is always equal to the column position.int
getColumnPositionByX(int x)
Returns the column position that contains the given x coordinate.int
getColumnWidthByPosition(int columnPosition)
Returns the width in pixels of the given column.LabelStack
getConfigLabelsByPosition(int columnPosition, int rowPosition)
Returns the config labels for the cell at the given coordinates.FilterRowDataProvider<T>
getFilterRowDataProvider()
int
getPreferredColumnCount()
int
getPreferredWidth()
Collection<String>
getProvidedLabels()
int
getStartXOfColumnPosition(int columnPosition)
Returns the x offset in pixels of the given column.int
getWidth()
Returns the total width in pixels of this layer.boolean
isColumnPositionResizable(int columnPosition)
Check if the column at the given position is resizable.int
localToUnderlyingColumnPosition(int localColumnPosition)
Convert a column position to the coordinates of the underlying layer.int
underlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer, int underlyingColumnPosition)
Transforms the column position relative to the given underlying layer to this layer coordinates.Collection<Range>
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, upScaleRowHeight
-
Methods 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, unregisterPersistable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods 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, unregisterPersistable
-
Methods inherited from interface org.eclipse.nebula.widgets.nattable.layer.ILayerListener
handleLayerEvent
-
-
-
-
Field Detail
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
-
Constructor Detail
-
FilterRowDataLayer
public FilterRowDataLayer(IFilterStrategy<T> filterStrategy, ILayer columnHeaderLayer, IDataProvider columnHeaderDataProvider, IConfigRegistry configRegistry)
-
-
Method Detail
-
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)
-
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 theIConfigRegistry
.- Specified by:
getConfigLabelsByPosition
in interfaceILayer
- Overrides:
getConfigLabelsByPosition
in classAbstractLayer
- 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 interfaceILayer
- Overrides:
getColumnCount
in classDataLayer
- Returns:
- The number of columns in this layer.
-
getPreferredColumnCount
public int getPreferredColumnCount()
- Specified by:
getPreferredColumnCount
in interfaceILayer
- Overrides:
getPreferredColumnCount
in classDataLayer
-
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 interfaceILayer
- Overrides:
getColumnIndexByPosition
in 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: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 interfaceILayer
- Overrides:
localToUnderlyingColumnPosition
in 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:ILayer
Transforms the column position relative to the given underlying layer to this layer coordinates.- Specified by:
underlyingToLocalColumnPosition
in interfaceILayer
- Overrides:
underlyingToLocalColumnPosition
in 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:ILayer
Transforms the column position ranges relative to the given underlying layer to this layer coordinates.- Specified by:
underlyingToLocalColumnPositions
in interfaceILayer
- Overrides:
underlyingToLocalColumnPositions
in 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:ILayer
Returns the total width in pixels of this layer.
-
getPreferredWidth
public int getPreferredWidth()
- Specified by:
getPreferredWidth
in interfaceILayer
- Overrides:
getPreferredWidth
in classDataLayer
-
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 interfaceILayer
- Overrides:
getColumnWidthByPosition
in 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:ILayer
Check if the column at the given position is resizable.- Specified by:
isColumnPositionResizable
in interfaceILayer
- Overrides:
isColumnPositionResizable
in classDataLayer
- 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 interfaceILayer
- Overrides:
getColumnPositionByX
in 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:ILayer
Returns the x offset in pixels of the given column.- Specified by:
getStartXOfColumnPosition
in interfaceILayer
- Overrides:
getStartXOfColumnPosition
in classDataLayer
- 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 interfaceILayer
- Overrides:
getProvidedLabels
in classAbstractLayer
- Returns:
- The collection of labels that are provided by this layer.
- Since:
- 1.4
-
-