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 value
V - type of column value (cell value)
Direct Known Subclasses:
AutoCompleteTextEditingSupport, EMFTextEditingSupport

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

    • valueExtractor

      protected Function<T,V> valueExtractor
      Function that returns the value from the container object
    • selectionListener

      protected BiConsumer<T,V> selectionListener
      A function that will be executed after losing focus on the text editor or after pressing the Enter button
    • strategy

      protected ValidationStrategy<V,String> 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

      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>
    • setValueExtractor

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

      public TextEditingSupport<T,V> setSelectionListener(BiConsumer<T,V> selectionListener)
      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

      public TextEditingSupport<T,V> setStrategy(ValidationStrategy<V,String> strategy)
      Set up strategy checking the entered value
      Parameters:
      strategy - for checking the entered value in a cell
      Returns:
      this object