Class ColorEditingSupport<T>
java.lang.Object
org.eclipse.jface.viewers.EditingSupport
com.amalgamasimulation.desktop.binding.editingsupports.GenericEditingSupport<T,org.eclipse.swt.graphics.RGB>
com.amalgamasimulation.desktop.binding.editingsupports.ColorEditingSupport<T>
- Type Parameters:
T- type of row value
- Direct Known Subclasses:
EMFColorEditingSupport
Class is used to edit the color in a cell.
Creates a button on the right side of the cell, which, when clicked, opens a dialog with the ability to edit the color.
- Author:
- Ionov Ivan
-
Field Summary
Fields inherited from class com.amalgamasimulation.desktop.binding.editingsupports.GenericEditingSupport
canEditCell, parent, viewer -
Constructor Summary
ConstructorsConstructorDescriptionColorEditingSupport(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, Color> selectionListener) Set up the selectionListenersetValueExtractor(Function<T, Color> valueExtractor) Set up the value Extractorprotected voidsetValueInternal(T element, org.eclipse.swt.graphics.RGB rgb) 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
-
Constructor Details
-
ColorEditingSupport
public ColorEditingSupport(org.eclipse.jface.viewers.ColumnViewer viewer, org.eclipse.swt.widgets.Composite parent)
-
-
Method Details
-
getCellEditorInternal
- Specified by:
getCellEditorInternalin classGenericEditingSupport<T,org.eclipse.swt.graphics.RGB>
-
getValueInternal
- Specified by:
getValueInternalin classGenericEditingSupport<T,org.eclipse.swt.graphics.RGB>
-
setValueInternal
- Specified by:
setValueInternalin classGenericEditingSupport<T,org.eclipse.swt.graphics.RGB>
-
setValueExtractor
Set up the value Extractor- Parameters:
valueExtractor- Function that returns the color from the container object- Returns:
- this object
-
setSelectionListener
Set up the selectionListener- Parameters:
selectionListener- Function executed after pressing 'OK' in the dialog- Returns:
- this object
-