Class TickUpdateCellEditDialog
- java.lang.Object
-
- org.eclipse.jface.window.Window
-
- org.eclipse.jface.dialogs.Dialog
-
- org.eclipse.nebula.widgets.nattable.edit.gui.CellEditDialog
-
- org.eclipse.nebula.widgets.nattable.edit.gui.TickUpdateCellEditDialog
-
- All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider
,ICellEditDialog
public class TickUpdateCellEditDialog extends CellEditDialog
Specialization ofCellEditDialog
that adds additional functionality to also use tick updates on the cell value(s). By selecting another edit type than set, the value entered in the editor control will be processed with the current value instead of simply setting this value. As using e.g. increase/decrease on the current value allows different values than on set, the validator needs to be wrapped so it is skipped for entering the value for processing.
-
-
Field Summary
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.edit.gui.CellEditDialog
cell, cellEditHandler, cellEditor, configRegistry, editDialogSettings, originalCanonicalValue
-
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 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
Constructors Constructor Description TickUpdateCellEditDialog(org.eclipse.swt.widgets.Shell parentShell, Object originalCanonicalValue, ILayerCell cell, ICellEditor cellEditor, IConfigRegistry configRegistry, ITickUpdateHandler tickUpdateHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
calculateValue(Object currentValue, Object processValue)
In caseICellEditDialog.getEditType()
returns an edit type for processing values, this method should implemented to do that transformation.protected org.eclipse.swt.widgets.Control
createDialogArea(org.eclipse.swt.widgets.Composite parent)
EditTypeEnum
getEditType()
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.edit.gui.CellEditDialog
cancelPressed, configureShell, getCommittedValue, getEscKeyListener, getInitialLocation, getInitialSize, isResizable, okPressed, setDialogSettings
-
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
-
-
-
-
Constructor Detail
-
TickUpdateCellEditDialog
public TickUpdateCellEditDialog(org.eclipse.swt.widgets.Shell parentShell, Object originalCanonicalValue, ILayerCell cell, ICellEditor cellEditor, IConfigRegistry configRegistry, ITickUpdateHandler tickUpdateHandler)
- Parameters:
parentShell
- the parent shell, ornull
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
- TheICellEditor
that will be used as editor control within the dialog.configRegistry
- TheIConfigRegistry
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.tickUpdateHandler
- TheITickUpdateHandler
that will be used to process the tick updates after closing this editor by pressing ok.
-
-
Method Detail
-
createDialogArea
protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
- Overrides:
createDialogArea
in classCellEditDialog
-
getEditType
public EditTypeEnum getEditType()
- Specified by:
getEditType
in interfaceICellEditDialog
- Overrides:
getEditType
in classCellEditDialog
- Returns:
- The edit type that has impact on how the set value will be
updated to the data model. By default
EditTypeEnum.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.
-
calculateValue
public Object calculateValue(Object currentValue, Object processValue)
Description copied from class:CellEditDialog
In caseICellEditDialog.getEditType()
returns an edit type for processing values, this method should implemented to do that transformation.- Specified by:
calculateValue
in interfaceICellEditDialog
- Overrides:
calculateValue
in classCellEditDialog
- Parameters:
currentValue
- 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.- Returns:
- This implementation will always return processValue, as there is
no processing specified in this
ICellEditDialog
implementation and therefore the value that was committed to the editor will be updated to the data model.
-
-