|
||||||||||
| 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.AbstractLayerTransform
org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer
public class ColumnReorderLayer
Adds functionality for reordering column(s) Also responsible for saving/loading the column order state.
DefaultColumnReorderLayerConfiguration| Field Summary | |
|---|---|
protected List<Integer> |
columnIndexOrder
|
static String |
PERSISTENCE_KEY_COLUMN_INDEX_ORDER
|
| 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 | |
|---|---|
ColumnReorderLayer(IUniqueIndexLayer underlyingLayer)
|
|
ColumnReorderLayer(IUniqueIndexLayer underlyingLayer,
boolean useDefaultConfiguration)
|
|
| Method Summary | |
|---|---|
int |
getColumnIndexByPosition(int columnPosition)
Gets the underlying non-transformed column index for the given column position. |
List<Integer> |
getColumnIndexOrder()
|
int |
getColumnPositionByIndex(int columnIndex)
|
int |
getColumnPositionByX(int x)
Returns the column position that contains the given x coordinate. |
int |
getReorderFromColumnPosition()
|
int |
getRowPositionByIndex(int rowIndex)
|
int |
getStartXOfColumnPosition(int targetColumnPosition)
Returns the x offset in pixels of the given column. |
void |
handleLayerEvent(ILayerEvent event)
Handle layer event notification. |
protected boolean |
isRestoredStateValid(List<Integer> newColumnIndexOrder)
Ensure that columns haven't changed in the underlying data source |
void |
loadState(String prefix,
Properties properties)
Underlying layers must load state first. |
int |
localToUnderlyingColumnPosition(int localColumnPosition)
Convert a column position to the coordinates of the underlying layer. |
protected void |
registerCommandHandlers()
Layers should use this method to register their command handlers and call it from their constructor. |
void |
reorderColumnPosition(int fromColumnPosition,
int toColumnPosition)
|
void |
reorderColumnPosition(int fromColumnPosition,
int toColumnPosition,
boolean reorderToLeftEdge)
|
void |
reorderMultipleColumnPositions(List<Integer> fromColumnPositions,
int toColumnPosition)
|
void |
reorderMultipleColumnPositions(List<Integer> fromColumnPositions,
int toColumnPosition,
boolean reorderToLeftEdge)
|
void |
saveState(String prefix,
Properties properties)
Saves the state to the given Properties using the specified prefix. |
void |
setReorderFromColumnPosition(int fromColumnPosition)
|
int |
underlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer,
int underlyingColumnPosition)
|
Collection<Range> |
underlyingToLocalColumnPositions(ILayer sourceUnderlyingLayer,
Collection<Range> underlyingColumnPositionRanges)
|
| Methods inherited from class org.eclipse.nebula.widgets.nattable.layer.AbstractLayer |
|---|
addConfiguration, addLayerListener, clearConfiguration, fireLayerEvent, getBoundsByPosition, getClientAreaProvider, getConfigLabelAccumulator, getRegionName, hasLayerListener, registerCommandHandler, registerEventHandler, registerPersistable, removeLayerListener, setConfigLabelAccumulator, setLayerPainter, setRegionName, toString, unregisterCommandHandler, unregisterEventHandler, unregisterPersistable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String PERSISTENCE_KEY_COLUMN_INDEX_ORDER
protected final List<Integer> columnIndexOrder
| Constructor Detail |
|---|
public ColumnReorderLayer(IUniqueIndexLayer underlyingLayer)
public ColumnReorderLayer(IUniqueIndexLayer underlyingLayer,
boolean useDefaultConfiguration)
| Method Detail |
|---|
public void handleLayerEvent(ILayerEvent event)
AbstractLayersuper.fireLayerEvent(event) - unless you plan to eat the
event yourself.
handleLayerEvent in interface ILayerListenerhandleLayerEvent in class AbstractLayerevent - the eventprotected void registerCommandHandlers()
AbstractLayer
registerCommandHandlers in class AbstractLayer
public void saveState(String prefix,
Properties properties)
IPersistable
saveState in interface IPersistablesaveState in class AbstractLayerTransformprefix - 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)
AbstractLayerTransformIStructuralChangeEvent from underlying layers will reset caches
after state has been loaded
loadState in interface IPersistableloadState in class AbstractLayerTransformprefix - 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 boolean isRestoredStateValid(List<Integer> newColumnIndexOrder)
newColumnIndexOrder - restored from the properties file.public List<Integer> getColumnIndexOrder()
public int getColumnIndexByPosition(int columnPosition)
ILayer
getColumnIndexByPosition in interface ILayergetColumnIndexByPosition in class AbstractLayerTransformcolumnPosition - 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 ILayerlocalToUnderlyingColumnPosition in class AbstractLayerTransformlocalColumnPosition - column position in local (the layer's own) coordinates
public int underlyingToLocalColumnPosition(ILayer sourceUnderlyingLayer,
int underlyingColumnPosition)
underlyingToLocalColumnPosition in interface ILayerunderlyingToLocalColumnPosition in class AbstractLayerTransform
public Collection<Range> underlyingToLocalColumnPositions(ILayer sourceUnderlyingLayer,
Collection<Range> underlyingColumnPositionRanges)
underlyingToLocalColumnPositions in interface ILayerunderlyingToLocalColumnPositions in class AbstractLayerTransformpublic int getColumnPositionByX(int x)
ILayer
getColumnPositionByX in interface ILayergetColumnPositionByX in class AbstractLayerTransformx - a horizontal pixel location relative to the pixel boundary of
this layer
public int getStartXOfColumnPosition(int targetColumnPosition)
ILayer
getStartXOfColumnPosition in interface ILayergetStartXOfColumnPosition in class AbstractLayerTransformtargetColumnPosition - the column position in this layer
public int getRowPositionByIndex(int rowIndex)
getRowPositionByIndex in interface IUniqueIndexLayer
public void reorderColumnPosition(int fromColumnPosition,
int toColumnPosition)
public void reorderColumnPosition(int fromColumnPosition,
int toColumnPosition,
boolean reorderToLeftEdge)
public void reorderMultipleColumnPositions(List<Integer> fromColumnPositions,
int toColumnPosition)
public void reorderMultipleColumnPositions(List<Integer> fromColumnPositions,
int toColumnPosition,
boolean reorderToLeftEdge)
public int getReorderFromColumnPosition()
public void setReorderFromColumnPosition(int fromColumnPosition)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||