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

public class ColorEditingSupport<T> extends GenericEditingSupport<T,org.eclipse.swt.graphics.RGB>
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
  • Constructor Details

    • ColorEditingSupport

      public ColorEditingSupport(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,org.eclipse.swt.graphics.RGB>
    • getValueInternal

      protected Object getValueInternal(T element)
      Specified by:
      getValueInternal in class GenericEditingSupport<T,org.eclipse.swt.graphics.RGB>
    • setValueInternal

      protected void setValueInternal(T element, org.eclipse.swt.graphics.RGB rgb)
      Specified by:
      setValueInternal in class GenericEditingSupport<T,org.eclipse.swt.graphics.RGB>
    • setValueExtractor

      public ColorEditingSupport<T> setValueExtractor(Function<T,Color> valueExtractor)
      Set up the value Extractor
      Parameters:
      valueExtractor - Function that returns the color from the container object
      Returns:
      this object
    • setSelectionListener

      public ColorEditingSupport<T> setSelectionListener(BiConsumer<T,Color> selectionListener)
      Set up the selectionListener
      Parameters:
      selectionListener - Function executed after pressing 'OK' in the dialog
      Returns:
      this object