|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.widgets.Canvas
org.eclipse.nebula.widgets.nattable.NatTable
public class NatTable
| 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 |
|---|
public static final int DEFAULT_STYLE_OPTIONS
public static final String INITIAL_PAINT_COMPLETE_FLAG
true in case the initial painting is not finished yet.
In this case there is no need to call refresh commands on loading.
protected final Collection<IConfiguration> configurations
protected String id
| Constructor Detail |
|---|
public NatTable(org.eclipse.swt.widgets.Composite parent)
public NatTable(org.eclipse.swt.widgets.Composite parent,
boolean autoconfigure)
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.
public NatTable(org.eclipse.swt.widgets.Composite parent,
ILayer layer)
public NatTable(org.eclipse.swt.widgets.Composite parent,
ILayer layer,
boolean autoconfigure)
public NatTable(org.eclipse.swt.widgets.Composite parent,
int style)
public NatTable(org.eclipse.swt.widgets.Composite parent,
int style,
boolean autoconfigure)
public NatTable(org.eclipse.swt.widgets.Composite parent,
int style,
ILayer layer)
public NatTable(org.eclipse.swt.widgets.Composite parent,
int style,
ILayer layer,
boolean autoconfigure)
| Method Detail |
|---|
protected IEventConflater getVisualChangeEventConflater()
public ILayer getLayer()
public void setLayer(ILayer layer)
public void addConfiguration(IConfiguration configuration)
Configurations are processed when the configure() method is invoked.
Each configuration object then has a chance to configure the
public IConfigRegistry getConfigRegistry()
IConfigRegistry used to hold the configuration bindings
by Layer, DisplayMode and Config labels.public void setConfigRegistry(IConfigRegistry configRegistry)
public UiBindingRegistry getUiBindingRegistry()
public void setUiBindingRegistry(UiBindingRegistry uiBindingRegistry)
public String getID()
protected void checkSubclass()
checkSubclass in class org.eclipse.swt.widgets.Compositeprotected void initInternalListener()
public boolean forceFocus()
forceFocus in class org.eclipse.swt.widgets.Controlpublic List<IOverlayPainter> getOverlayPainters()
public void addOverlayPainter(IOverlayPainter overlayPainter)
public void removeOverlayPainter(IOverlayPainter overlayPainter)
public void paintControl(org.eclipse.swt.events.PaintEvent event)
paintControl in interface org.eclipse.swt.events.PaintListenerpublic ILayerPainter getLayerPainter()
getLayerPainter in interface ILayerpublic void setLayerPainter(ILayerPainter layerPainter)
public void repaintColumn(int columnPosition)
columnPosition - column of the grid to repaintpublic void repaintRow(int rowPosition)
rowPosition - row of the grid to repaint
public void repaintCell(int columnPosition,
int rowPosition)
columnPosition - column position of the cell to repaintrowPosition - row position of the cell to repaintpublic void updateResize()
public void refresh()
public void configure(ConfigRegistry configRegistry,
UiBindingRegistry uiBindingRegistry)
ILayerconfigure() method. This is an opportunity to add
any key/mouse bindings and other general configuration.
configure in interface ILayerconfigRegistry - instance owned by NatTableuiBindingRegistry - instance owned by NatTablepublic void configure()
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.
public void handleLayerEvent(ILayerEvent event)
ILayerListenerILayer
handleLayerEvent in interface ILayerListenerevent - the event
public void saveState(String prefix,
Properties properties)
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.
saveState in interface IPersistableprefix - 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)
loadState in interface IPersistableprefix - 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.saveState(String, Properties)public void registerPersistable(IPersistable persistable)
ILayerProperties instance when the layer is persisted.
registerPersistable in interface ILayerpersistable - the persistable to be registeredILayer.registerPersistable(IPersistable)public void unregisterPersistable(IPersistable persistable)
unregisterPersistable in interface ILayerpublic boolean doCommand(ILayerCommand command)
ILayerILayerCommand.convertToTargetLayer(ILayer)
doCommand in interface ILayercommand - the command to perform
public void registerCommandHandler(ILayerCommandHandler<?> commandHandler)
registerCommandHandler in interface ILayerpublic void unregisterCommandHandler(Class<? extends ILayerCommand> commandClass)
unregisterCommandHandler in interface ILayerpublic void fireLayerEvent(ILayerEvent event)
ILayer
Example: When the contents of the grid change IVisualChangeEvent can be
fired to notify other layers to refresh their caches etc.
fireLayerEvent in interface ILayerevent - the event to firepublic void addLayerListener(ILayerListener listener)
addLayerListener in interface ILayerpublic void removeLayerListener(ILayerListener listener)
removeLayerListener in interface ILayerpublic boolean hasLayerListener(Class<? extends ILayerListener> layerListenerClass)
hasLayerListener in interface ILayerlayerListenerClass - The type of ILayerListener to check for existence
true if this ILayer has a ILayerListener
registered for the specified type, false if there is
no such listener registered alreadypublic int getColumnCount()
getColumnCount in interface ILayerpublic int getPreferredColumnCount()
getPreferredColumnCount in interface ILayerpublic int getColumnIndexByPosition(int columnPosition)
ILayer
getColumnIndexByPosition in interface ILayercolumnPosition - a column position relative to this coordinate model
public 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 getColumnWidthByPosition(int columnPosition)
ILayer
getColumnWidthByPosition in interface ILayercolumnPosition - the column position in this layer
public boolean isColumnPositionResizable(int columnPosition)
isColumnPositionResizable in interface ILayerpublic int getColumnPositionByX(int x)
ILayer
getColumnPositionByX in interface ILayerx - a horizontal 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 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)
ILayer
getRowIndexByPosition in interface ILayerrowPosition - a row position relative to this coordinate model
public 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 getRowHeightByPosition(int rowPosition)
ILayer
getRowHeightByPosition in interface ILayerrowPosition - the row position in this layer
public boolean isRowPositionResizable(int rowPosition)
isRowPositionResizable in interface ILayerpublic int getRowPositionByY(int y)
ILayer
getRowPositionByY in interface ILayery - a vertical pixel location relative to the pixel boundary of this layer
public int getStartYOfRowPosition(int rowPosition)
ILayer
getStartYOfRowPosition in interface ILayerrowPosition - the row position in this layer
public Collection<ILayer> getUnderlyingLayersByRowPosition(int rowPosition)
getUnderlyingLayersByRowPosition in interface ILayer
public ILayerCell getCellByPosition(int columnPosition,
int rowPosition)
getCellByPosition in interface ILayer
public org.eclipse.swt.graphics.Rectangle getBoundsByPosition(int columnPosition,
int rowPosition)
ILayer
getBoundsByPosition in interface ILayercolumnPosition - the column position of the cellrowPosition - the row position of the cell
null if there are no valid bounds
public String getDisplayModeByPosition(int columnPosition,
int rowPosition)
getDisplayModeByPosition in interface ILayercolumnPosition - the column position of the cellrowPosition - the row position of the cell
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.
public LabelStack getConfigLabelsByPosition(int columnPosition,
int rowPosition)
getConfigLabelsByPosition in interface ILayer
public Object getDataValueByPosition(int columnPosition,
int rowPosition)
getDataValueByPosition in interface ILayer
public ICellPainter getCellPainter(int columnPosition,
int rowPosition,
ILayerCell cell,
IConfigRegistry configRegistry)
getCellPainter in interface ILayer
public LabelStack getRegionLabelsByXY(int x,
int y)
ILayer
getRegionLabelsByXY in interface ILayerx - the x pixel coordinatey - the y pixel coordinate
public ILayer getUnderlyingLayerByPosition(int columnPosition,
int rowPosition)
getUnderlyingLayerByPosition in interface ILayerpublic IClientAreaProvider getClientAreaProvider()
getClientAreaProvider in interface ILayerpublic void setClientAreaProvider(IClientAreaProvider clientAreaProvider)
setClientAreaProvider in interface ILayer
public void addDragSupport(int operations,
org.eclipse.swt.dnd.Transfer[] transferTypes,
org.eclipse.swt.dnd.DragSourceListener listener)
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 operationlistener - the callback that will be invoked to set the drag data and to
cleanup after the drag and drop operation finishesDND
public void addDropSupport(int operations,
org.eclipse.swt.dnd.Transfer[] transferTypes,
org.eclipse.swt.dnd.DropTargetListener listener)
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 operationlistener - the callback that will be invoked after the drag and drop
operation finishesDNDpublic void setTheme(ThemeConfiguration themeConfiguration)
ThemeConfiguration
and register the style configurations of the given ThemeConfiguration.
themeConfiguration - The ThemeConfiguration that contains the style configurations to apply.public ICellEditor getActiveCellEditor()
null if
there is no editor active.
nullpublic boolean commitAndCloseActiveCellEditor()
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||