org.eclipse.nebula.widgets.nattable
Class NatTable

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.eclipse.swt.widgets.Canvas
                      extended by org.eclipse.nebula.widgets.nattable.NatTable
All Implemented Interfaces:
EventListener, ILayer, ILayerListener, IPersistable, IClientAreaProvider, org.eclipse.swt.events.PaintListener, org.eclipse.swt.graphics.Drawable, org.eclipse.swt.internal.SWTEventListener
Direct Known Subclasses:
NatTableFixture

public class NatTable
extends org.eclipse.swt.widgets.Canvas
implements ILayer, org.eclipse.swt.events.PaintListener, IClientAreaProvider, ILayerListener, IPersistable


Field Summary
protected  Collection<IConfiguration> configurations
           
static int DEFAULT_STYLE_OPTIONS
           
protected  String id
           
static String INITIAL_PAINT_COMPLETE_FLAG
          Key that is used for loading NatTable states.
 
Fields inherited from class org.eclipse.swt.widgets.Control
view
 
Fields inherited from interface org.eclipse.nebula.widgets.nattable.persistence.IPersistable
DOT, VALUE_SEPARATOR
 
Fields inherited from interface org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider
DEFAULT
 
Constructor Summary
NatTable(org.eclipse.swt.widgets.Composite parent)
           
NatTable(org.eclipse.swt.widgets.Composite parent, boolean autoconfigure)
           
NatTable(org.eclipse.swt.widgets.Composite parent, ILayer layer)
           
NatTable(org.eclipse.swt.widgets.Composite parent, ILayer layer, boolean autoconfigure)
           
NatTable(org.eclipse.swt.widgets.Composite parent, int style)
           
NatTable(org.eclipse.swt.widgets.Composite parent, int style, boolean autoconfigure)
           
NatTable(org.eclipse.swt.widgets.Composite parent, int style, ILayer layer)
           
NatTable(org.eclipse.swt.widgets.Composite parent, int style, ILayer layer, boolean autoconfigure)
           
 
Method Summary
 void addConfiguration(IConfiguration configuration)
          Adds a configuration to the table.
 void addDragSupport(int operations, org.eclipse.swt.dnd.Transfer[] transferTypes, org.eclipse.swt.dnd.DragSourceListener listener)
          Adds support for dragging items out of this control via a user drag-and-drop operation.
 void addDropSupport(int operations, org.eclipse.swt.dnd.Transfer[] transferTypes, org.eclipse.swt.dnd.DropTargetListener listener)
          Adds support for dropping items into this control via a user drag-and-drop operation.
 void addLayerListener(ILayerListener listener)
           
 void addOverlayPainter(IOverlayPainter overlayPainter)
           
protected  void checkSubclass()
           
 boolean commitAndCloseActiveCellEditor()
          Checks if there is an active cell editor registered.
 void configure()
          Processes all the registered IConfiguration (s).
 void configure(ConfigRegistry configRegistry, UiBindingRegistry uiBindingRegistry)
          Every layer gets this call back, starting at the top of the stack.
 boolean doCommand(ILayerCommand command)
          Opportunity to respond to a command as it flows down the stack.
 void fireLayerEvent(ILayerEvent event)
          Events can be fired to notify other components of the grid.
 boolean forceFocus()
           
 ICellEditor getActiveCellEditor()
          Returns the active cell editor that is currently open or null if there is no editor active.
 org.eclipse.swt.graphics.Rectangle getBoundsByPosition(int columnPosition, int rowPosition)
          Calculates the bounds in pixel for the given cell position.
 ILayerCell getCellByPosition(int columnPosition, int rowPosition)
           
 ICellPainter getCellPainter(int columnPosition, int rowPosition, ILayerCell cell, IConfigRegistry configRegistry)
           
 IClientAreaProvider getClientAreaProvider()
           
 int getColumnCount()
           
 int getColumnIndexByPosition(int columnPosition)
          Gets the underlying non-transformed column index for the given 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)
           
 IConfigRegistry getConfigRegistry()
           
 Object getDataValueByPosition(int columnPosition, int rowPosition)
           
 String getDisplayModeByPosition(int columnPosition, int rowPosition)
           
 int getHeight()
          Returns the total height in pixels of this layer.
 String getID()
           
 ILayer getLayer()
           
 ILayerPainter getLayerPainter()
           
 List<IOverlayPainter> getOverlayPainters()
           
 int getPreferredColumnCount()
           
 int getPreferredHeight()
           
 int getPreferredRowCount()
           
 int getPreferredWidth()
           
 LabelStack getRegionLabelsByXY(int x, int y)
          Layer can apply its own labels to any cell it wishes.
 int getRowCount()
           
 int getRowHeightByPosition(int rowPosition)
          Returns the height in pixels of the given row.
 int getRowIndexByPosition(int rowPosition)
          Gets the underlying non-transformed row index for the given row position.
 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.
 UiBindingRegistry getUiBindingRegistry()
           
 ILayer getUnderlyingLayerByPosition(int columnPosition, int rowPosition)
           
 Collection<ILayer> getUnderlyingLayersByColumnPosition(int columnPosition)
           
 Collection<ILayer> getUnderlyingLayersByRowPosition(int rowPosition)
           
protected  IEventConflater getVisualChangeEventConflater()
           
 int getWidth()
          Returns the total width in pixels of this layer.
 void handleLayerEvent(ILayerEvent event)
          Handle an event notification from an ILayer
 boolean hasLayerListener(Class<? extends ILayerListener> layerListenerClass)
           
protected  void initInternalListener()
           
 boolean isColumnPositionResizable(int columnPosition)
           
 boolean isRowPositionResizable(int rowPosition)
           
 void loadState(String prefix, Properties properties)
          Restore the state of the underlying layers from the values in the properties object.
 int localToUnderlyingColumnPosition(int localColumnPosition)
          Convert a column position to the coordinates of the underlying layer.
 int localToUnderlyingRowPosition(int localRowPosition)
           
 void paintControl(org.eclipse.swt.events.PaintEvent event)
           
 void refresh()
          Refreshes the entire NatTable as every layer will be refreshed.
 void registerCommandHandler(ILayerCommandHandler<?> commandHandler)
           
 void registerPersistable(IPersistable persistable)
          Persistables registered with a layer will have a chance to write their data out to the Properties instance when the layer is persisted.
 void removeLayerListener(ILayerListener listener)
           
 void removeOverlayPainter(IOverlayPainter overlayPainter)
           
 void repaintCell(int columnPosition, int rowPosition)
          Repaint only a specific cell in the grid.
 void repaintColumn(int columnPosition)
          Repaint only a specific column in the grid.
 void repaintRow(int rowPosition)
          Repaint only a specific row in the grid.
 void saveState(String prefix, Properties properties)
          Save the state of the table to the properties object.
 void setClientAreaProvider(IClientAreaProvider clientAreaProvider)
           
 void setConfigRegistry(IConfigRegistry configRegistry)
           
 void setLayer(ILayer layer)
           
 void setLayerPainter(ILayerPainter layerPainter)
           
 void setTheme(ThemeConfiguration themeConfiguration)
          Will unregister the style configurations that were applied before by another ThemeConfiguration and register the style configurations of the given ThemeConfiguration.
 void setUiBindingRegistry(UiBindingRegistry uiBindingRegistry)
           
 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)
           
 void unregisterCommandHandler(Class<? extends ILayerCommand> commandClass)
           
 void unregisterPersistable(IPersistable persistable)
           
 void updateResize()
           
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
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
dispose
 
Methods inherited from interface org.eclipse.nebula.widgets.nattable.util.IClientAreaProvider
getClientArea
 

Field Detail

DEFAULT_STYLE_OPTIONS

public static final int DEFAULT_STYLE_OPTIONS
See Also:
Constant Field Values

INITIAL_PAINT_COMPLETE_FLAG

public static final String INITIAL_PAINT_COMPLETE_FLAG
Key that is used for loading NatTable states. Is set to true in case the initial painting is not finished yet. In this case there is no need to call refresh commands on loading.

See Also:
Constant Field Values

configurations

protected final Collection<IConfiguration> configurations

id

protected String id
Constructor Detail

NatTable

public NatTable(org.eclipse.swt.widgets.Composite parent)

NatTable

public NatTable(org.eclipse.swt.widgets.Composite parent,
                boolean autoconfigure)
Parameters:
parent - widget for the table.
autoconfigure - if set to False - No auto configuration is done - Default settings are not loaded. Configuration(s) have to be manually added by invoking addConfiguration(). At the minimum the DefaultNatTableStyleConfiguration must be added for the table to render.

NatTable

public NatTable(org.eclipse.swt.widgets.Composite parent,
                ILayer layer)

NatTable

public NatTable(org.eclipse.swt.widgets.Composite parent,
                ILayer layer,
                boolean autoconfigure)

NatTable

public NatTable(org.eclipse.swt.widgets.Composite parent,
                int style)

NatTable

public NatTable(org.eclipse.swt.widgets.Composite parent,
                int style,
                boolean autoconfigure)

NatTable

public NatTable(org.eclipse.swt.widgets.Composite parent,
                int style,
                ILayer layer)

NatTable

public NatTable(org.eclipse.swt.widgets.Composite parent,
                int style,
                ILayer layer,
                boolean autoconfigure)
Method Detail

getVisualChangeEventConflater

protected IEventConflater getVisualChangeEventConflater()

getLayer

public ILayer getLayer()

setLayer

public void setLayer(ILayer layer)

addConfiguration

public void addConfiguration(IConfiguration configuration)
Adds a configuration to the table.

Configurations are processed when the configure() method is invoked. Each configuration object then has a chance to configure the

  1. ILayer
  2. ConfigRegistry
  3. UiBindingRegistry


getConfigRegistry

public IConfigRegistry getConfigRegistry()
Returns:
IConfigRegistry used to hold the configuration bindings by Layer, DisplayMode and Config labels.

setConfigRegistry

public void setConfigRegistry(IConfigRegistry configRegistry)

getUiBindingRegistry

public UiBindingRegistry getUiBindingRegistry()
Returns:
Registry holding all the UIBindings contributed by the underlying layers

setUiBindingRegistry

public void setUiBindingRegistry(UiBindingRegistry uiBindingRegistry)

getID

public String getID()

checkSubclass

protected void checkSubclass()
Overrides:
checkSubclass in class org.eclipse.swt.widgets.Composite

initInternalListener

protected void initInternalListener()

forceFocus

public boolean forceFocus()
Overrides:
forceFocus in class org.eclipse.swt.widgets.Control

getOverlayPainters

public List<IOverlayPainter> getOverlayPainters()

addOverlayPainter

public void addOverlayPainter(IOverlayPainter overlayPainter)

removeOverlayPainter

public void removeOverlayPainter(IOverlayPainter overlayPainter)

paintControl

public void paintControl(org.eclipse.swt.events.PaintEvent event)
Specified by:
paintControl in interface org.eclipse.swt.events.PaintListener

getLayerPainter

public ILayerPainter getLayerPainter()
Specified by:
getLayerPainter in interface ILayer

setLayerPainter

public void setLayerPainter(ILayerPainter layerPainter)

repaintColumn

public void repaintColumn(int columnPosition)
Repaint only a specific column in the grid. This method is optimized so that only the specific column is repainted and nothing else.

Parameters:
columnPosition - column of the grid to repaint

repaintRow

public void repaintRow(int rowPosition)
Repaint only a specific row in the grid. This method is optimized so that only the specific row is repainted and nothing else.

Parameters:
rowPosition - row of the grid to repaint

repaintCell

public void repaintCell(int columnPosition,
                        int rowPosition)
Repaint only a specific cell in the grid. This method is optimized so that only the specific cell is repainted and nothing else.

Parameters:
columnPosition - column position of the cell to repaint
rowPosition - row position of the cell to repaint

updateResize

public void updateResize()

refresh

public void refresh()
Refreshes the entire NatTable as every layer will be refreshed.


configure

public void configure(ConfigRegistry configRegistry,
                      UiBindingRegistry uiBindingRegistry)
Description copied from interface: ILayer
Every layer gets this call back, starting at the top of the stack. This is triggered by the configure() method. This is an opportunity to add any key/mouse bindings and other general configuration.

Specified by:
configure in interface ILayer
Parameters:
configRegistry - instance owned by NatTable
uiBindingRegistry - instance owned by NatTable

configure

public void configure()
Processes all the registered IConfiguration (s). All the underlying layers are walked and given a chance to configure. Note: all desired configuration tweaks must be done before this method is invoked.


handleLayerEvent

public void handleLayerEvent(ILayerEvent event)
Description copied from interface: ILayerListener
Handle an event notification from an ILayer

Specified by:
handleLayerEvent in interface ILayerListener
Parameters:
event - the event

saveState

public void saveState(String prefix,
                      Properties properties)
Save the state of the table to the properties object. IPersistable.saveState(String, Properties) is invoked on all the underlying layers. This properties object will be populated with the settings of all underlying layers and any IPersistable registered with those layers.

Specified by:
saveState in interface IPersistable
Parameters:
prefix - 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.

loadState

public void loadState(String prefix,
                      Properties properties)
Restore the state of the underlying layers from the values in the properties object.

Specified by:
loadState in interface IPersistable
Parameters:
prefix - 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.
See Also:
saveState(String, Properties)

registerPersistable

public void registerPersistable(IPersistable persistable)
Description copied from interface: ILayer
Persistables registered with a layer will have a chance to write their data out to the Properties instance when the layer is persisted.

Specified by:
registerPersistable in interface ILayer
Parameters:
persistable - the persistable to be registered
See Also:
ILayer.registerPersistable(IPersistable)

unregisterPersistable

public void unregisterPersistable(IPersistable persistable)
Specified by:
unregisterPersistable in interface ILayer

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 co-ordinates using ILayerCommand.convertToTargetLayer(ILayer)

Specified by:
doCommand in interface ILayer
Parameters:
command - the command to perform
Returns:
true if the command has been handled, false otherwise

registerCommandHandler

public void registerCommandHandler(ILayerCommandHandler<?> commandHandler)
Specified by:
registerCommandHandler in interface ILayer

unregisterCommandHandler

public void unregisterCommandHandler(Class<? extends ILayerCommand> commandClass)
Specified by:
unregisterCommandHandler in interface ILayer

fireLayerEvent

public void fireLayerEvent(ILayerEvent event)
Description copied from interface: ILayer
Events can be fired to notify other components of the grid. Events travel up the layer stack and may cause a repaint.

Example: When the contents of the grid change IVisualChangeEvent can be fired to notify other layers to refresh their caches etc.

Specified by:
fireLayerEvent in interface ILayer
Parameters:
event - the event to fire

addLayerListener

public void addLayerListener(ILayerListener listener)
Specified by:
addLayerListener in interface ILayer

removeLayerListener

public void removeLayerListener(ILayerListener listener)
Specified by:
removeLayerListener in interface ILayer

hasLayerListener

public boolean hasLayerListener(Class<? extends ILayerListener> layerListenerClass)
Specified by:
hasLayerListener in interface ILayer
Parameters:
layerListenerClass - The type of ILayerListener to check for existence
Returns:
true if this ILayer has a ILayerListener registered for the specified type, false if there is no such listener registered already

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface ILayer
Returns:
the number of columns in this coordinate model

getPreferredColumnCount

public int getPreferredColumnCount()
Specified by:
getPreferredColumnCount in interface ILayer

getColumnIndexByPosition

public int getColumnIndexByPosition(int columnPosition)
Description copied from interface: ILayer
Gets the underlying non-transformed column index for the given column position.

Specified by:
getColumnIndexByPosition in interface ILayer
Parameters:
columnPosition - a column position relative to this coordinate model
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
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)
Specified by:
underlyingToLocalColumnPosition in interface ILayer

underlyingToLocalColumnPositions

public Collection<Range> underlyingToLocalColumnPositions(ILayer sourceUnderlyingLayer,
                                                          Collection<Range> underlyingColumnPositionRanges)
Specified by:
underlyingToLocalColumnPositions in interface ILayer

getWidth

public int getWidth()
Description copied from interface: ILayer
Returns the total width in pixels of this layer.

Specified by:
getWidth in interface ILayer
Returns:
the width of this layer

getPreferredWidth

public int getPreferredWidth()
Specified by:
getPreferredWidth in interface ILayer

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
Parameters:
columnPosition - the column position in this layer
Returns:
the width of the column

isColumnPositionResizable

public boolean isColumnPositionResizable(int columnPosition)
Specified by:
isColumnPositionResizable in interface ILayer

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
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
Parameters:
columnPosition - the column position in this layer
Returns:
the x offset of the column, or -1

getUnderlyingLayersByColumnPosition

public Collection<ILayer> getUnderlyingLayersByColumnPosition(int columnPosition)
Specified by:
getUnderlyingLayersByColumnPosition in interface ILayer

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface ILayer
Returns:
the number of rows in this coordinate model

getPreferredRowCount

public int getPreferredRowCount()
Specified by:
getPreferredRowCount in interface ILayer

getRowIndexByPosition

public int getRowIndexByPosition(int rowPosition)
Description copied from interface: ILayer
Gets the underlying non-transformed row index for the given row position.

Specified by:
getRowIndexByPosition in interface ILayer
Parameters:
rowPosition - a row position relative to this coordinate model
Returns:
an underlying non-transformed row index, or -1 if the given row position does not exist within this coordinate system

localToUnderlyingRowPosition

public int localToUnderlyingRowPosition(int localRowPosition)
Specified by:
localToUnderlyingRowPosition in interface ILayer

underlyingToLocalRowPosition

public int underlyingToLocalRowPosition(ILayer sourceUnderlyingLayer,
                                        int underlyingRowPosition)
Specified by:
underlyingToLocalRowPosition in interface ILayer

underlyingToLocalRowPositions

public Collection<Range> underlyingToLocalRowPositions(ILayer sourceUnderlyingLayer,
                                                       Collection<Range> underlyingRowPositionRanges)
Specified by:
underlyingToLocalRowPositions in interface ILayer

getHeight

public int getHeight()
Description copied from interface: ILayer
Returns the total height in pixels of this layer.

Specified by:
getHeight in interface ILayer
Returns:
the height of this layer

getPreferredHeight

public int getPreferredHeight()
Specified by:
getPreferredHeight in interface ILayer

getRowHeightByPosition

public int getRowHeightByPosition(int rowPosition)
Description copied from interface: ILayer
Returns the height in pixels of the given row. The height of invisible and non-existing rows is 0.

Specified by:
getRowHeightByPosition in interface ILayer
Parameters:
rowPosition - the row position in this layer
Returns:
the height of the row

isRowPositionResizable

public boolean isRowPositionResizable(int rowPosition)
Specified by:
isRowPositionResizable in interface ILayer

getRowPositionByY

public int getRowPositionByY(int y)
Description copied from interface: ILayer
Returns the row position that contains the given y coordinate.

Specified by:
getRowPositionByY in interface ILayer
Parameters:
y - a vertical pixel location relative to the pixel boundary of this layer
Returns:
a row position relative to the associated coordinate system, or -1 if there is no row that contains y

getStartYOfRowPosition

public int getStartYOfRowPosition(int rowPosition)
Description copied from interface: ILayer
Returns the y offset in pixels of the given row.

Specified by:
getStartYOfRowPosition in interface ILayer
Parameters:
rowPosition - the row position in this layer
Returns:
the y offset of the row, or -1

getUnderlyingLayersByRowPosition

public Collection<ILayer> getUnderlyingLayersByRowPosition(int rowPosition)
Specified by:
getUnderlyingLayersByRowPosition in interface ILayer

getCellByPosition

public ILayerCell getCellByPosition(int columnPosition,
                                    int rowPosition)
Specified by:
getCellByPosition in interface ILayer

getBoundsByPosition

public org.eclipse.swt.graphics.Rectangle getBoundsByPosition(int columnPosition,
                                                              int rowPosition)
Description copied from interface: ILayer
Calculates the bounds in pixel for the given cell position.

Specified by:
getBoundsByPosition in interface ILayer
Parameters:
columnPosition - the column position of the cell
rowPosition - the row position of the cell
Returns:
the bounds, or null if there are no valid bounds

getDisplayModeByPosition

public String getDisplayModeByPosition(int columnPosition,
                                       int rowPosition)
Specified by:
getDisplayModeByPosition in interface ILayer
Parameters:
columnPosition - the column position of the cell
rowPosition - the row position of the cell
Returns:
DisplayMode for the cell at the given position. The DisplayMode affects the settings out of the ConfigRegistry. Display mode is NORMAL by default.

Example: SelectionLayer overrides this to return the SELECT label for cells which are selected.


getConfigLabelsByPosition

public LabelStack getConfigLabelsByPosition(int columnPosition,
                                            int rowPosition)
Specified by:
getConfigLabelsByPosition in interface ILayer

getDataValueByPosition

public Object getDataValueByPosition(int columnPosition,
                                     int rowPosition)
Specified by:
getDataValueByPosition in interface ILayer

getCellPainter

public ICellPainter getCellPainter(int columnPosition,
                                   int rowPosition,
                                   ILayerCell cell,
                                   IConfigRegistry configRegistry)
Specified by:
getCellPainter in interface ILayer

getRegionLabelsByXY

public LabelStack getRegionLabelsByXY(int x,
                                      int y)
Description copied from interface: ILayer
Layer can apply its own labels to any cell it wishes.

Specified by:
getRegionLabelsByXY in interface ILayer
Parameters:
x - the x pixel coordinate
y - the y pixel coordinate
Returns:
a LabelStack containing the region labels for the cell at the given pixel position

getUnderlyingLayerByPosition

public ILayer getUnderlyingLayerByPosition(int columnPosition,
                                           int rowPosition)
Specified by:
getUnderlyingLayerByPosition in interface ILayer

getClientAreaProvider

public IClientAreaProvider getClientAreaProvider()
Specified by:
getClientAreaProvider in interface ILayer

setClientAreaProvider

public void setClientAreaProvider(IClientAreaProvider clientAreaProvider)
Specified by:
setClientAreaProvider in interface ILayer

addDragSupport

public void addDragSupport(int operations,
                           org.eclipse.swt.dnd.Transfer[] transferTypes,
                           org.eclipse.swt.dnd.DragSourceListener listener)
Adds support for dragging items out of this control via a user drag-and-drop operation.

Parameters:
operations - a bitwise OR of the supported drag and drop operation types ( DROP_COPY,DROP_LINK, and DROP_MOVE)
transferTypes - the transfer types that are supported by the drag operation
listener - the callback that will be invoked to set the drag data and to cleanup after the drag and drop operation finishes
See Also:
DND

addDropSupport

public void addDropSupport(int operations,
                           org.eclipse.swt.dnd.Transfer[] transferTypes,
                           org.eclipse.swt.dnd.DropTargetListener listener)
Adds support for dropping items into this control via a user drag-and-drop operation.

Parameters:
operations - a bitwise OR of the supported drag and drop operation types ( DROP_COPY,DROP_LINK, and DROP_MOVE)
transferTypes - the transfer types that are supported by the drop operation
listener - the callback that will be invoked after the drag and drop operation finishes
See Also:
DND

setTheme

public void setTheme(ThemeConfiguration themeConfiguration)
Will unregister the style configurations that were applied before by another ThemeConfiguration and register the style configurations of the given ThemeConfiguration.

Parameters:
themeConfiguration - The ThemeConfiguration that contains the style configurations to apply.

getActiveCellEditor

public ICellEditor getActiveCellEditor()
Returns the active cell editor that is currently open or null if there is no editor active.

Returns:
the active editor or null

commitAndCloseActiveCellEditor

public boolean commitAndCloseActiveCellEditor()
Checks if there is an active cell editor registered. If there is one, it is tried to commit the value that is currently entered there.

Returns:
false if there is an open editor that can not be committed because of conversion/validation errors, true if there is no active open editor or it could be closed after committing the value.


Copyright © 2014. All rights reserved.