Class TextEditingSupport<T,V>
java.lang.Object
org.eclipse.jface.viewers.EditingSupport
com.amalgamasimulation.desktop.binding.editingsupports.GenericEditingSupport<T,V>
com.amalgamasimulation.desktop.binding.editingsupports.TextEditingSupport<T,V>
- Type Parameters:
T- type of row valueV- type of column value (cell value)
- Direct Known Subclasses:
AutoCompleteTextEditingSupport,EMFTextEditingSupport
Class is used to edit table cell values. When a cell is clicked, a text editor appears where the new value for that cell can be entered
- Author:
- Ionov Ivan
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BiConsumer<T, V> A function that will be executed after losing focus on the text editor or after pressing the Enter buttonprotected ValidationStrategy<V, String> Strategy for checking the entered value in a cellFunction that returns the value from the container objectFields inherited from class com.amalgamasimulation.desktop.binding.editingsupports.GenericEditingSupport
canEditCell, parent, viewer -
Constructor Summary
ConstructorsConstructorDescriptionTextEditingSupport(org.eclipse.jface.viewers.ColumnViewer viewer, org.eclipse.swt.widgets.Composite parent) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.eclipse.jface.viewers.CellEditorgetCellEditorInternal(T element) protected ObjectgetValueInternal(T element) setSelectionListener(BiConsumer<T, V> selectionListener) Set up the selectionListenersetStrategy(ValidationStrategy<V, String> strategy) Set up strategy checking the entered valuesetValueExtractor(Function<T, V> valueExtractor) Set up the value Extractorprotected voidsetValueInternal(T element, V value) Methods inherited from class com.amalgamasimulation.desktop.binding.editingsupports.GenericEditingSupport
canEdit, canEditInternal, getCellEditor, getValue, initializeCellEditorValue, initializeCellEditorValueInternal, setCanEditCell, setValueMethods inherited from class org.eclipse.jface.viewers.EditingSupport
getViewer, saveCellEditorValue
-
Field Details
-
valueExtractor
Function that returns the value from the container object -
selectionListener
A function that will be executed after losing focus on the text editor or after pressing the Enter button -
strategy
Strategy for checking the entered value in a cell
-
-
Constructor Details
-
TextEditingSupport
public TextEditingSupport(org.eclipse.jface.viewers.ColumnViewer viewer, org.eclipse.swt.widgets.Composite parent)
-
-
Method Details
-
getCellEditorInternal
- Specified by:
getCellEditorInternalin classGenericEditingSupport<T,V>
-
getValueInternal
- Specified by:
getValueInternalin classGenericEditingSupport<T,V>
-
setValueInternal
- Specified by:
setValueInternalin classGenericEditingSupport<T,V>
-
setValueExtractor
Set up the value Extractor- Parameters:
valueExtractor- Function that returns the value from the container object- Returns:
- this object
-
setSelectionListener
Set up the selectionListener- Parameters:
selectionListener- function that will be executed after losing focus on the text editor or after pressing the Enter button- Returns:
- this object
-
setStrategy
Set up strategy checking the entered value- Parameters:
strategy- for checking the entered value in a cell- Returns:
- this object
-