Class MultiLineTextCellEditor
java.lang.Object
org.eclipse.nebula.widgets.nattable.edit.editor.AbstractCellEditor
org.eclipse.nebula.widgets.nattable.edit.editor.TextCellEditor
org.eclipse.nebula.widgets.nattable.edit.editor.MultiLineTextCellEditor
- All Implemented Interfaces:
ICellEditor
A specialization of
TextCellEditor that uses a multi line text editor
as editor control. To support multi line editing correctly, the behaviour to
commit on pressing the enter key is disabled.
A multi line editor usually needs some space. Therefore it might be a good
decision to set the configuration attribute
EditConfigAttributes.OPEN_IN_DIALOG to true for this
editor, so the editor always opens in a subdialog.
As some table layouts may support enough space for an inline cell editor,
this editor does not specify
ICellEditor.openInline(org.eclipse.nebula.widgets.nattable.config.IConfigRegistry, java.util.List)
to always return false.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.nebula.widgets.nattable.edit.editor.AbstractCellEditor
AbstractCellEditor.InlineFocusListener, AbstractCellEditor.InlineTraverseListener -
Field Summary
Fields inherited from class org.eclipse.nebula.widgets.nattable.edit.editor.TextCellEditor
autoActivationCharacters, autoActivationDelay, commitOnEnter, contentProposalAdapter, controlContentAdapter, decorationProvider, keyStroke, proposalAcceptanceStyle, proposalProviderFields inherited from class org.eclipse.nebula.widgets.nattable.edit.editor.AbstractCellEditor
cellStyle, configRegistry, conversionEditErrorHandler, dataValidator, displayConverter, editMode, focusListener, labelStack, layerCell, parent, traverseListener, validationEditErrorHandler -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new multi line text editor that ensures to not commit the editor value in case enter is typed.MultiLineTextCellEditor(boolean lineWrap) Create a new multi line text editor that ensures to not commit the editor value in case enter is typed. -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.swt.graphics.RectanglecalculateControlBounds(org.eclipse.swt.graphics.Rectangle cellBounds) This method is used to calculate the bounds of the edit control when opened inline.org.eclipse.swt.widgets.TextcreateEditorControl(org.eclipse.swt.widgets.Composite parent) Creates the editor control that is wrapped by this ICellEditor.voidsetLineWrap(boolean lineWrap) Methods inherited from class org.eclipse.nebula.widgets.nattable.edit.editor.TextCellEditor
activateCell, close, configureContentProposalAdapter, createEditorControl, enableContentProposal, enableContentProposal, getDecorationProvider, getEditorControl, getEditorValue, getInputConversionErrorHandler, getInputValidationErrorHandler, getSelectionMode, getTextKeyListener, isCommitOnEnter, isCommitWithCtrlKey, isEditable, isProposalPopupOpen, setCommitOnEnter, setCommitWithCtrlKey, setDecorationPositionOverride, setEditable, setEditorValue, setErrorDecorationEnabled, setFieldDecorationId, setInputConversionErrorHandler, setInputValidationErrorHandler, setSelectionMode, showErrorDecorationHoverMethods inherited from class org.eclipse.nebula.widgets.nattable.edit.editor.AbstractCellEditor
activateAtAnyPosition, activateCell, activateOnTraversal, addEditorControlListeners, commit, commit, commit, getCanonicalValue, getCanonicalValue, getColumnIndex, getColumnPosition, getRowIndex, getRowPosition, handleConversion, isClosed, openAdjacentEditor, openInline, openMultiEditDialog, removeEditorControlListeners, setCanonicalValue, setDataValidator, supportMultiEdit, validateCanonicalValue, validateCanonicalValue
-
Constructor Details
-
MultiLineTextCellEditor
public MultiLineTextCellEditor()Create a new multi line text editor that ensures to not commit the editor value in case enter is typed. The text control will support automatic line wrapping. -
MultiLineTextCellEditor
public MultiLineTextCellEditor(boolean lineWrap) Create a new multi line text editor that ensures to not commit the editor value in case enter is typed.- Parameters:
lineWrap- Flag to configure whether the text control should enable automatic line wrap behaviour or not.
-
-
Method Details
-
createEditorControl
public org.eclipse.swt.widgets.Text createEditorControl(org.eclipse.swt.widgets.Composite parent) Description copied from interface:ICellEditorCreates the editor control that is wrapped by this ICellEditor. Will use the style configurations in ConfigRegistry for styling the control.- Specified by:
createEditorControlin interfaceICellEditor- Overrides:
createEditorControlin classTextCellEditor- Parameters:
parent- The Composite that will be the parent of the new editor control. Can not benull- Returns:
- The created editor control that is wrapped by this ICellEditor.
-
calculateControlBounds
public org.eclipse.swt.graphics.Rectangle calculateControlBounds(org.eclipse.swt.graphics.Rectangle cellBounds) Description copied from interface:ICellEditorThis method is used to calculate the bounds of the edit control when opened inline. By default it should return the given cell bounds to match the cell structure in NatTable. For several cases it might be useful to return the preferred size to show all content rather than trimming the control to the cell size.Note: By changing the bounds you should ensure to only modify width and height attributes and not x and y coordinate, otherwise the editor control will show up somewhere else and not in place of the cell that is edited.
- Specified by:
calculateControlBoundsin interfaceICellEditor- Overrides:
calculateControlBoundsin classAbstractCellEditor- Parameters:
cellBounds- The bounds of the cell for which the editor is opened.- Returns:
- The bounds of the editor control that should be applied. By default the cell bounds for several cases bigger.
-
setLineWrap
public void setLineWrap(boolean lineWrap) - Parameters:
lineWrap-trueif the text control should enable automatic line wrap behaviour,falseif not
-