Class EmfSpinnerDataBinding<T extends org.eclipse.emf.ecore.EObject,V>

Type Parameters:
T - The type of EObject container
V - The type of the bound feature value
All Implemented Interfaces:
AbstractDataBinding<V>, ContainerDataBinding<T,V>, EmfDataBinding<T,V>

public class EmfSpinnerDataBinding<T extends org.eclipse.emf.ecore.EObject,V> extends ContainerSpinnerDataBinding<T,V> implements EmfDataBinding<T,V>
Spinner binding to a feature of an EMF object. The new value is set with a command, so it can be undone.
Author:
Ionov Ivan
See Also:
  • Constructor Details

    • EmfSpinnerDataBinding

      public EmfSpinnerDataBinding()
  • Method Details

    • feature

      public EmfSpinnerDataBinding<T,V> feature(org.eclipse.emf.ecore.EStructuralFeature feature)
    • createBinding

      public void createBinding()
      Description copied from class: AbstractSpinnerDataBinding
      Creates the error icon, sets the range and digits of the spinner, subscribes to its events and shows the model value. The arrow step is set to 1 and the page step to 10 in selection units; the section may replace them with its own after createBinding. Throws IllegalArgumentException if digits is below 0 or the minimum is greater than the maximum, because the spinner would ignore such values without an error. The tooltip of the icon is set here once, so validation must be called before createBinding. The listeners and the order of their events are described in the class Javadoc.
      Specified by:
      createBinding in interface AbstractDataBinding<T extends org.eclipse.emf.ecore.EObject>
      Overrides:
      createBinding in class ContainerSpinnerDataBinding<T extends org.eclipse.emf.ecore.EObject,V>
    • getFeature

      public org.eclipse.emf.ecore.EStructuralFeature getFeature()
      Description copied from interface: EmfDataBinding
      Gets the EMF structural feature being bound.
      Specified by:
      getFeature in interface EmfDataBinding<T extends org.eclipse.emf.ecore.EObject,V>
      Returns:
      The EStructuralFeature representing the model attribute being bound to the UI control. This defines which property of the EObject container is being observed/modified.