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 value
V - type of column value (cell value)

public class ButtonEditingSupport<T,V> extends GenericEditingSupport<T,V>
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
  • Constructor Details

    • ButtonEditingSupport

      public ButtonEditingSupport(org.eclipse.jface.viewers.ColumnViewer viewer, org.eclipse.swt.widgets.Composite parent)
  • Method Details

    • getCellEditorInternal

      protected org.eclipse.jface.viewers.CellEditor getCellEditorInternal(T element)
      Specified by:
      getCellEditorInternal in class GenericEditingSupport<T,V>
    • getValueInternal

      protected Object getValueInternal(T element)
      Specified by:
      getValueInternal in class GenericEditingSupport<T,V>
    • setValueInternal

      protected void setValueInternal(T element, V value)
      Specified by:
      setValueInternal in class GenericEditingSupport<T,V>
    • setImage

      public ButtonEditingSupport<T,V> setImage(org.eclipse.swt.graphics.Image image)
      Set up the image for button
      Parameters:
      image - for button
      Returns:
      this object
    • setButtonText

      public ButtonEditingSupport<T,V> setButtonText(String buttonText)
      Set up the text for button
      Parameters:
      buttonText - , text for button
      Returns:
      this object
    • setButtonToolTip

      public ButtonEditingSupport<T,V> setButtonToolTip(String buttonToolTip)
      Set up the toolTip for button
      Parameters:
      buttonToolTip - , toolTip for button
      Returns:
      this object
    • setLabelExtractor

      public ButtonEditingSupport<T,V> setLabelExtractor(Function<T,String> labelExtractor)
      Set up the label Extractor
      Parameters:
      labelExtractor - function to get the value that will be shown in the cell
      Returns:
      this object
    • setSelectionListener

      public ButtonEditingSupport<T,V> setSelectionListener(Consumer<T> selectionListener)
      Set up selectionListener
      Parameters:
      selectionListener - function that will be executed when the button is pressed
      Returns:
      this object