E
- the type of elements returned by the underlying column viewer.public abstract class TextEditingSupport<E> extends TypedEditingSupportConstantEditor<E,String>
An Editing Support with support for generic types and a single underlying
TextCellEditor
. Objects of this type also permit to set a validator
to restrict the values that the underlying cell editor will accept.
The user of this class must ensure that the underlying column viewer always gives elements of type E.
This object accepts two validators, a “first-level” validator and a
(unqualified) validator. The effective validator is a composition of those
two validators: if the first-level validator reports an error, the effective
validator reports that error (the unqualified validator is not invoked); and
otherwise, the unqualified validator is invoked. If a validator is set to
null
, it considers everything acceptable (but the other
validator still operates). Both validators are null
by default
(subclasses may change this).
The user must go through this object to change the validator behavior of the underlying cell editor. The user may not set or remove the validator directly on the underlying cell editor.
The user must override #getValueTyped(E)
to
provide values corresponding to elements; and
#setValueTyped(E, String)
to set the
values sent by the text cell editor back to the model. The user may also
override #canEditTyped(E)
(true
by
default).
Constructor and Description |
---|
TextEditingSupport(ColumnViewer viewer,
Class<E> classOfElements) |
Modifier and Type | Method and Description |
---|---|
TextCellEditor |
getTextCellEditor() |
getCellEditor, getCellEditorTyped, setCellEditor, setFirstLevelValidator, setValidator
canEdit, canEditTyped, getCellEditor, getTypedElement, getTypedValue, getValue, getValueTyped, setValue, setValueTyped
getViewer, initializeCellEditorValue, saveCellEditorValue
public TextEditingSupport(ColumnViewer viewer, Class<E> classOfElements)
viewer
- must have a composite as underlying control.public TextCellEditor getTextCellEditor()
Copyright © 2017. All rights reserved.