|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.nebula.widgets.nattable.layer.AbstractLayer
org.eclipse.nebula.widgets.nattable.layer.DataLayer
public class DataLayer
Wraps the IDataProvider, and serves as the data source for all other
layers. Also, tracks the size of the columns and the rows using
SizeConfig objects. Since this layer sits directly on top of the data
source, at this layer index == position.
| Field Summary | |
|---|---|
protected SizeConfig |
columnWidthConfig
|
protected IDataProvider |
dataProvider
|
static int |
DEFAULT_COLUMN_WIDTH
|
static int |
DEFAULT_ROW_HEIGHT
|
static String |
PERSISTENCE_KEY_COLUMN_WIDTH
|
static String |
PERSISTENCE_KEY_ROW_HEIGHT
|
protected SizeConfig |
rowHeightConfig
|
| Fields inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer |
|---|
commandHandlers, eventHandlers, layerPainter |
| Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable |
|---|
DOT, VALUE_SEPARATOR |
| Constructor Summary | |
|---|---|
protected |
DataLayer()
|
|
DataLayer(IDataProvider dataProvider)
|
|
DataLayer(IDataProvider dataProvider,
int defaultColumnWidth,
int defaultRowHeight)
|
protected |
DataLayer(int defaultColumnWidth,
int defaultRowHeight)
|
| Method Summary | |
|---|---|
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 |
getColumnPositionByIndex(int columnIndex)
This is the root coordinate system, so the column position is always equal to the column index. |
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. |
IDataProvider |
getDataProvider()
|
Object |
getDataValue(int columnIndex,
int rowIndex)
Gets the value at the given column and row index. |
Object |
getDataValueByPosition(int columnPosition,
int rowPosition)
|
int |
getDefaultColumnWidth()
|
int |
getDefaultRowHeight()
|
int |
getHeight()
Returns the total height in pixels of this layer. |
int |
getPreferredColumnCount()
|
int |
getPreferredHeight()
|
int |
getPreferredRowCount()
|
int |
getPreferredWidth()
|
int |
getRowCount()
|
int |
getRowHeightByPosition(int rowPosition)
Returns the height in pixels of the given row. |
int |
getRowIndexByPosition(int rowPosition)
This is the root coordinate system, so the row index is always equal to the row position. |
int |
getRowPositionByIndex(int rowIndex)
This is the root coordinate system, so the row position is always equal to the row index. |
int |
getRowPositionByY(int y)
Returns the row position that contains the given y coordinate. |
int |
getStartXOfColumnPosition(int columnPosition)
Returns the x offset in pixels of the given column. |
int |
getStartYOfRowPosition(int rowPosition)
Returns the y offset in pixels of the given row. |
ILayer |
getUnderlyingLayerByPosition(int columnPosition,
int rowPosition)
|
Collection<ILayer> |
getUnderlyingLayersByColumnPosition(int columnPosition)
|
Collection<ILayer> |
getUnderlyingLayersByRowPosition(int rowPosition)
|
int |
getWidth()
Returns the total width in pixels of this layer. |
boolean |
isColumnPercentageSizing()
|
boolean |
isColumnPercentageSizing(int position)
|
boolean |
isColumnPositionResizable(int columnPosition)
|
boolean |
isRowPercentageSizing()
|
boolean |
isRowPercentageSizing(int position)
|
boolean |
isRowPositionResizable(int rowPosition)
|
void |
loadState(String prefix,
Properties properties)
Restore the state out of the given Properties identified by the specified prefix. |
int |
localToUnderlyingColumnPosition(int localColumnPosition)
Convert a column position to the coordinates of the underlying layer. |
int |
localToUnderlyingRowPosition(int localRowPosition)
|
protected void |
registerCommandHandlers()
Layers should use this method to register their command handlers and call it from their constructor. |
void |
saveState(String prefix,
Properties properties)
Saves the state to the given Properties using the specified prefix. |
void |
setColumnPercentageSizing(boolean percentageSizing)
Configures how the column sizing of this DataLayer is handled. |
void |
setColumnPercentageSizing(int position,
boolean percentageSizing)
Configures how the column sizing of this DataLayer is handled. |
void |
setColumnPositionResizable(int columnPosition,
boolean resizable)
|
void |
setColumnsResizableByDefault(boolean resizableByDefault)
|
void |
setColumnWidthByPosition(int columnPosition,
int width)
|
void |
setColumnWidthByPosition(int columnPosition,
int width,
boolean fireEvent)
|
void |
setColumnWidthPercentageByPosition(int columnPosition,
int width)
|
protected void |
setDataProvider(IDataProvider dataProvider)
|
void |
setDataValue(int columnIndex,
int rowIndex,
Object newValue)
Sets the value at the given column and row index. |
void |
setDataValueByPosition(int columnPosition,
int rowPosition,
Object newValue)
|
void |
setDefaultColumnWidth(int width)
|
void |
setDefaultColumnWidthByPosition(int columnPosition,
int width)
|
void |
setDefaultRowHeight(int height)
|
void |
setDefaultRowHeightByPosition(int rowPosition,
int height)
|
void |
setRowHeightByPosition(int rowPosition,
int height)
|
void |
setRowHeightByPosition(int rowPosition,
int height,
boolean fireEvent)
|
void |
setRowHeightPercentageByPosition(int rowPosition,
int height)
|
void |
setRowPercentageSizing(boolean percentageSizing)
Configures how the row sizing of this DataLayer is handled. |
void |
setRowPercentageSizing(int position,
boolean percentageSizing)
Configures how the row sizing of this DataLayer is handled. |
void |
setRowPositionResizable(int rowPosition,
boolean resizable)
|
void |
setRowsResizableByDefault(boolean resizableByDefault)
|
int |
underlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer,
int underlyingColumnPosition)
|
Collection<Range> |
underlyingToLocalColumnPositions(ILayer sourceUnderlyingLayer,
Collection<Range> underlyingColumnPositionRanges)
|
int |
underlyingToLocalRowPosition(ILayer sourceUnderlyingLayer,
int underlyingRowPosition)
|
Collection<Range> |
underlyingToLocalRowPositions(ILayer sourceUnderlyingLayer,
Collection<Range> underlyingRowPositionRanges)
|
| 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, getConfigLabelsByPosition, getDisplayModeByPosition, getLayerPainter, getRegionLabelsByXY, hasLayerListener, registerCommandHandler, registerPersistable, removeLayerListener, setClientAreaProvider, unregisterCommandHandler, unregisterPersistable |
| Methods inherited from interface org.eclipse.nebula.widgets.nattable.layer.ILayerListener |
|---|
handleLayerEvent |
| Field Detail |
|---|
public static final String PERSISTENCE_KEY_ROW_HEIGHT
public static final String PERSISTENCE_KEY_COLUMN_WIDTH
public static final int DEFAULT_COLUMN_WIDTH
public static final int DEFAULT_ROW_HEIGHT
protected IDataProvider dataProvider
protected SizeConfig columnWidthConfig
protected SizeConfig rowHeightConfig
| Constructor Detail |
|---|
public DataLayer(IDataProvider dataProvider)
public DataLayer(IDataProvider dataProvider,
int defaultColumnWidth,
int defaultRowHeight)
protected DataLayer()
protected DataLayer(int defaultColumnWidth,
int defaultRowHeight)
| Method Detail |
|---|
public void saveState(String prefix,
Properties properties)
IPersistable
saveState in interface IPersistablesaveState in class AbstractLayerprefix - The prefix to use for the state keys. Is also used as the
state configuration name.properties - The Properties instance to save the state to.
public void loadState(String prefix,
Properties properties)
IPersistable
loadState in interface IPersistableloadState in class AbstractLayerprefix - The prefix to use for the state keys. Is also used as the
state configuration name.properties - The Properties instance to load the state from.protected void registerCommandHandlers()
AbstractLayer
registerCommandHandlers in class AbstractLayerpublic IDataProvider getDataProvider()
protected void setDataProvider(IDataProvider dataProvider)
public Object getDataValue(int columnIndex,
int rowIndex)
columnIndex - rowIndex -
public void setDataValue(int columnIndex,
int rowIndex,
Object newValue)
columnIndex - rowIndex - newValue - public int getColumnCount()
getColumnCount in interface ILayerpublic int getPreferredColumnCount()
getPreferredColumnCount in interface ILayerpublic int getColumnIndexByPosition(int columnPosition)
getColumnIndexByPosition in interface ILayercolumnPosition - a column position relative to this coordinate model
public int getColumnPositionByIndex(int columnIndex)
getColumnPositionByIndex in interface IUniqueIndexLayerpublic int localToUnderlyingColumnPosition(int localColumnPosition)
ILayer
localToUnderlyingColumnPosition in interface ILayerlocalColumnPosition - column position in local (the layer's own) coordinates
public int underlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer,
int underlyingColumnPosition)
underlyingToLocalColumnPosition in interface ILayer
public Collection<Range> underlyingToLocalColumnPositions(ILayer sourceUnderlyingLayer,
Collection<Range> underlyingColumnPositionRanges)
underlyingToLocalColumnPositions in interface ILayerpublic int getWidth()
ILayer
getWidth in interface ILayerpublic int getPreferredWidth()
getPreferredWidth in interface ILayerpublic int getDefaultColumnWidth()
public int getColumnWidthByPosition(int columnPosition)
ILayer
getColumnWidthByPosition in interface ILayercolumnPosition - the column position in this layer
public void setColumnWidthByPosition(int columnPosition,
int width)
public void setColumnWidthByPosition(int columnPosition,
int width,
boolean fireEvent)
public void setColumnWidthPercentageByPosition(int columnPosition,
int width)
public void setDefaultColumnWidth(int width)
public void setDefaultColumnWidthByPosition(int columnPosition,
int width)
public boolean isColumnPositionResizable(int columnPosition)
isColumnPositionResizable in interface ILayer
public void setColumnPositionResizable(int columnPosition,
boolean resizable)
public void setColumnsResizableByDefault(boolean resizableByDefault)
public Collection<ILayer> getUnderlyingLayersByColumnPosition(int columnPosition)
getUnderlyingLayersByColumnPosition in interface ILayerpublic int getRowCount()
getRowCount in interface ILayerpublic int getPreferredRowCount()
getPreferredRowCount in interface ILayerpublic int getRowIndexByPosition(int rowPosition)
getRowIndexByPosition in interface ILayerrowPosition - a row position relative to this coordinate model
public int getRowPositionByIndex(int rowIndex)
getRowPositionByIndex in interface IUniqueIndexLayerpublic int localToUnderlyingRowPosition(int localRowPosition)
localToUnderlyingRowPosition in interface ILayer
public int underlyingToLocalRowPosition(ILayer sourceUnderlyingLayer,
int underlyingRowPosition)
underlyingToLocalRowPosition in interface ILayer
public Collection<Range> underlyingToLocalRowPositions(ILayer sourceUnderlyingLayer,
Collection<Range> underlyingRowPositionRanges)
underlyingToLocalRowPositions in interface ILayerpublic int getHeight()
ILayer
getHeight in interface ILayerpublic int getPreferredHeight()
getPreferredHeight in interface ILayerpublic int getDefaultRowHeight()
public int getRowHeightByPosition(int rowPosition)
ILayer
getRowHeightByPosition in interface ILayerrowPosition - the row position in this layer
public void setRowHeightByPosition(int rowPosition,
int height)
public void setRowHeightByPosition(int rowPosition,
int height,
boolean fireEvent)
public void setRowHeightPercentageByPosition(int rowPosition,
int height)
public void setDefaultRowHeight(int height)
public void setDefaultRowHeightByPosition(int rowPosition,
int height)
public boolean isRowPositionResizable(int rowPosition)
isRowPositionResizable in interface ILayer
public void setRowPositionResizable(int rowPosition,
boolean resizable)
public void setRowsResizableByDefault(boolean resizableByDefault)
public Collection<ILayer> getUnderlyingLayersByRowPosition(int rowPosition)
getUnderlyingLayersByRowPosition in interface ILayer
public Object getDataValueByPosition(int columnPosition,
int rowPosition)
getDataValueByPosition in interface ILayer
public void setDataValueByPosition(int columnPosition,
int rowPosition,
Object newValue)
public int getColumnPositionByX(int x)
ILayer
getColumnPositionByX in interface ILayerx - a horizontal pixel location relative to the pixel boundary of
this layer
public int getRowPositionByY(int y)
ILayer
getRowPositionByY in interface ILayery - a vertical pixel location relative to the pixel boundary of
this layer
public int getStartXOfColumnPosition(int columnPosition)
ILayer
getStartXOfColumnPosition in interface ILayercolumnPosition - the column position in this layer
public int getStartYOfRowPosition(int rowPosition)
ILayer
getStartYOfRowPosition in interface ILayerrowPosition - the row position in this layer
public ILayer getUnderlyingLayerByPosition(int columnPosition,
int rowPosition)
getUnderlyingLayerByPosition in interface ILayerpublic boolean doCommand(ILayerCommand command)
ILayerILayerCommand.convertToTargetLayer(ILayer)
doCommand in interface ILayerdoCommand in class AbstractLayercommand - the command to perform
public boolean isColumnPercentageSizing()
true if the column sizing is done by percentage
calculation, false if the column sizing is done by
pixel (default)public void setColumnPercentageSizing(boolean percentageSizing)
DataLayer is handled.
Default is pixel sizing. If percentage sizing should be used you have to
ensure that the size value for every column is set explicitly and that
the sum of the column sizes doesn't exceed 100.
percentageSizing - true if the column sizing should be done by
percentage calculation, false if the column
sizing should be done by pixel (default)public boolean isColumnPercentageSizing(int position)
position - The position which is asked for the percentage sizing
configuration.
true if the column sizing for the given position is
done by percentage calculation, false if the column
sizing is done by pixel (default)
public void setColumnPercentageSizing(int position,
boolean percentageSizing)
DataLayer is handled.
Default is pixel sizing. If percentage sizing should be used you have to
ensure that the size value for every column is set explicitly and that
the sum of the column sizes doesn't exceed 100.
position - The position for which the sizing configuration should be set.percentageSizing - true if the column sizing should be done by
percentage calculation, false if the column
sizing should be done by pixel (default)public boolean isRowPercentageSizing()
true if the row sizing is done by percentage
calculation, false if the row sizing is done by
pixel (default)public void setRowPercentageSizing(boolean percentageSizing)
DataLayer is handled.
Default is pixel sizing. If percentage sizing should be used you have to
ensure that the size value for every row is set explicitly and that the
sum of the row sizes doesn't exceed 100.
percentageSizing - true if the row sizing should be done by
percentage calculation, false if the row sizing
should be done by pixel (default)public boolean isRowPercentageSizing(int position)
position - The position which is asked for the percentage sizing
configuration.
true if the row sizing for the given position is
done by percentage calculation, false if the row
sizing is done by pixel (default)
public void setRowPercentageSizing(int position,
boolean percentageSizing)
DataLayer is handled.
Default is pixel sizing. If percentage sizing should be used you have to
ensure that the size value for every row is set explicitly and that the
sum of the row sizes doesn't exceed 100.
position - The row position for which the sizing configuration should be
set.percentageSizing - true if the row sizing should be done by
percentage calculation, false if the row sizing
should be done by pixel (default)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||