| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.eclipse.nebula.widgets.nattable.edit.gui.CellEditDialog
public class CellEditDialog
Dialog that supports editing of cells in NatTable. Is used for multi cell editing and for dialog only editors.
| Nested Class Summary | 
|---|
| Nested classes/interfaces inherited from class org.eclipse.jface.window.Window | 
|---|
| org.eclipse.jface.window.Window.IExceptionHandler | 
| Field Summary | |
|---|---|
| protected  ILayerCell | cellThe cell that should be edited. | 
| protected  DialogEditHandler | cellEditHandlerThe ICellEditHandlerthat should be used by the editor. | 
| protected  ICellEditor | cellEditorThe cell editor that should be integrated and activated in this dialog. | 
| protected  IConfigRegistry | configRegistryThe IConfigRegistrycontaining the configuration of the current NatTable 
 instance the command should be executed for. | 
| protected  Map<String,Object> | editDialogSettingsMap that contains custom configurations for this CellEditDialog. | 
| protected  Object | originalCanonicalValueThe value that should be propagated to the editor control. | 
| Fields inherited from class org.eclipse.jface.dialogs.Dialog | 
|---|
| blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS | 
| Fields inherited from class org.eclipse.jface.window.Window | 
|---|
| CANCEL, OK | 
| Fields inherited from interface org.eclipse.nebula.widgets.nattable.edit.gui.ICellEditDialog | 
|---|
| DIALOG_MESSAGE, DIALOG_SHELL_ICON, DIALOG_SHELL_LOCATION, DIALOG_SHELL_RESIZABLE, DIALOG_SHELL_SIZE, DIALOG_SHELL_TITLE | 
| Constructor Summary | |
|---|---|
| CellEditDialog(org.eclipse.swt.widgets.Shell parentShell,
               Object originalCanonicalValue,
               ILayerCell cell,
               ICellEditor cellEditor,
               IConfigRegistry configRegistry) | |
| Method Summary | |
|---|---|
|  Object | calculateValue(Object currentValue,
               Object processValue)In case ICellEditDialog.getEditType()returns an edit type for processing
 values, this method should implemented to do that transformation. | 
| protected  void | cancelPressed() | 
| protected  void | configureShell(org.eclipse.swt.widgets.Shell newShell) | 
| protected  org.eclipse.swt.widgets.Control | createDialogArea(org.eclipse.swt.widgets.Composite parent) | 
|  Object | getCommittedValue() | 
|  EditTypeEnum | getEditType() | 
| protected  org.eclipse.swt.events.KeyListener | getEscKeyListener() | 
| protected  org.eclipse.swt.graphics.Point | getInitialLocation(org.eclipse.swt.graphics.Point initialSize) | 
| protected  org.eclipse.swt.graphics.Point | getInitialSize() | 
| protected  boolean | isResizable() | 
| protected  void | okPressed() | 
|  void | setDialogSettings(Map<String,Object> editDialogSettings)Allows to customize the appearance of the dialog. | 
| Methods inherited from class org.eclipse.jface.dialogs.Dialog | 
|---|
| applyDialogFont, buttonPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonBar, createButtonsForButtonBar, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getOKButton, initializeBounds, initializeDialogUnits, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText | 
| Methods inherited from class org.eclipse.jface.window.Window | 
|---|
| canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Methods inherited from interface org.eclipse.nebula.widgets.nattable.edit.gui.ICellEditDialog | 
|---|
| open | 
| Field Detail | 
|---|
protected final Object originalCanonicalValue
protected final ICellEditor cellEditor
protected DialogEditHandler cellEditHandler
ICellEditHandler that should be used by the editor.
protected final ILayerCell cell
protected final IConfigRegistry configRegistry
IConfigRegistry containing the configuration of the current NatTable 
 instance the command should be executed for. This is necessary because the edit 
 controllers in the current architecture are not aware of the instance they are 
 running in and therefore it is needed for activation of editors.
protected Map<String,Object> editDialogSettings
CellEditDialog.
 We do not use the IDialogSettings provided by JFace, because they are
 used to store and load the settings in XML rather than overriding the behaviour.
| Constructor Detail | 
|---|
public CellEditDialog(org.eclipse.swt.widgets.Shell parentShell,
                      Object originalCanonicalValue,
                      ILayerCell cell,
                      ICellEditor cellEditor,
                      IConfigRegistry configRegistry)
parentShell - the parent shell, or null to create a top-level
                        shelloriginalCanonicalValue - The value that should be propagated to the editor 
                        control. Needed because for multi cell editing or editor activation by
                        letter/digit key will result in a different value to populate for some 
                        editors than populating the value out of the cell/data model directly.cell - The cell that should be edited. Needed because editor activation
                        retrieves the configuration for editing directly out of the cell.cellEditor - The ICellEditor that will be used as editor control
                        within the dialog.configRegistry - The IConfigRegistry containing the configuration of 
                        the current NatTable instance the command should be executed for. This is 
                        necessary because the edit controllers in the current architecture are not 
                        aware of the instance they are running in and therefore it is needed for 
                        activation of editors.| Method Detail | 
|---|
protected void configureShell(org.eclipse.swt.widgets.Shell newShell)
configureShell in class org.eclipse.jface.window.Windowprotected boolean isResizable()
isResizable in class org.eclipse.jface.dialogs.Dialogprotected org.eclipse.swt.graphics.Point getInitialLocation(org.eclipse.swt.graphics.Point initialSize)
getInitialLocation in class org.eclipse.jface.dialogs.Dialogprotected org.eclipse.swt.graphics.Point getInitialSize()
getInitialSize in class org.eclipse.jface.dialogs.Dialogprotected void okPressed()
okPressed in class org.eclipse.jface.dialogs.Dialogprotected void cancelPressed()
cancelPressed in class org.eclipse.jface.dialogs.Dialogprotected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
createDialogArea in class org.eclipse.jface.dialogs.Dialogpublic Object getCommittedValue()
getCommittedValue in interface ICellEditDialogpublic EditTypeEnum getEditType()
getEditType in interface ICellEditDialogEditTypeEnum.SET is returned, which
                        will simply set the committed value to the data model. Every other
                        edit type will do some calculation based on the committed value and 
                        the current value in the data model.
public Object calculateValue(Object currentValue,
                             Object processValue)
ICellEditDialog.getEditType() returns an edit type for processing
 values, this method should implemented to do that transformation.
calculateValue in interface ICellEditDialogcurrentValue - The current value for the cell before data model updateprocessValue - The value committed to the editor that should be used for
                        calculation on the current value.
ICellEditDialog implementation and therefore the value
                        that was committed to the editor will be updated to the data model.protected org.eclipse.swt.events.KeyListener getEscKeyListener()
public void setDialogSettings(Map<String,Object> editDialogSettings)
CellEditDialogFactory. 
 
 The map containing the settings can be registered to the IConfigRegistry for 
 the key EditConfigAttributes.EDIT_DIALOG_SETTINGS. The keys that are valid
 for this map are specified below.
 
 This implementation will check if the given map contains a value for ICellEditDialog.DIALOG_SHELL_RESIZABLE.
 If there is a value found for that configuration, the Shell style will be recalculated based on the specified
 value. The style bits are calculated the same way like in the Dialog constructor.
 This is performed in here because setting the Shell style bits after the creation of the Shell would have no 
 effect.
setDialogSettings in interface ICellEditDialogeditDialogSettings - Map containing the settings to customize the edit dialog 
                        appearance.ICellEditDialog.DIALOG_SHELL_TITLE, 
ICellEditDialog.DIALOG_SHELL_ICON, 
ICellEditDialog.DIALOG_SHELL_LOCATION, 
ICellEditDialog.DIALOG_SHELL_SIZE, 
ICellEditDialog.DIALOG_SHELL_RESIZABLE, 
ICellEditDialog.DIALOG_MESSAGE, 
EditConfigAttributes.EDIT_DIALOG_SETTINGS| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||