Class ButtonEditingSupport<T,V>
java.lang.Object
org.eclipse.jface.viewers.EditingSupport
com.amalgamasimulation.desktop.binding.editingsupports.GenericEditingSupport<T,V>
com.amalgamasimulation.desktop.binding.editingsupports.ButtonEditingSupport<T,V>
- Type Parameters:
T- type of row valueV- type of column value (cell value)
Class is used to create a button inside a cell.
The button is created on the right side of the cell. When pressed, the dialogOpen function is executed.
- Author:
- Ionov Ivan
-
Field Summary
Fields inherited from class com.amalgamasimulation.desktop.binding.editingsupports.GenericEditingSupport
canEditCell, parent, viewer -
Constructor Summary
ConstructorsConstructorDescriptionButtonEditingSupport(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) setButtonText(String buttonText) Set up the text for buttonsetButtonToolTip(String buttonToolTip) Set up the toolTip for buttonsetImage(org.eclipse.swt.graphics.Image image) Set up the image for buttonsetLabelExtractor(Function<T, String> labelExtractor) Set up the label ExtractorsetSelectionListener(Consumer<T> selectionListener) Set up selectionListenerprotected 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
-
Constructor Details
-
ButtonEditingSupport
public ButtonEditingSupport(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>
-
setImage
Set up the image for button- Parameters:
image- for button- Returns:
- this object
-
setButtonText
Set up the text for button- Parameters:
buttonText- , text for button- Returns:
- this object
-
setButtonToolTip
Set up the toolTip for button- Parameters:
buttonToolTip- , toolTip for button- Returns:
- this object
-
setLabelExtractor
Set up the label Extractor- Parameters:
labelExtractor- function to get the value that will be shown in the cell- Returns:
- this object
-
setSelectionListener
Set up selectionListener- Parameters:
selectionListener- function that will be executed when the button is pressed- Returns:
- this object
-