Class SelectableAcquisitionCompositeFactory

java.lang.Object
uk.ac.diamond.daq.mapping.ui.SelectableAcquisitionCompositeFactory
All Implemented Interfaces:
CompositeFactory, Lockable

public class SelectableAcquisitionCompositeFactory extends Object implements CompositeFactory, Lockable
This widget can dynamically change its content based on the user selection.

An instance of this class contains a collection of AcquisitionCompositeFactory. Each element of the collection is exposed as radio button at the top of the widget. The selection of an element causes the associated NamedComposite to be build inside a ScrolledComposite

Any of the NamedComposite may inhibit the transition to another {code NamedComposite} locking this Composite. To activate the lock the NamedComposite executes

        LockableSelectable lockableClass = WidgetUtilities.getDataObject(this.parent, LockableSelectable.class, LockableSelectable.LOCKABLE_SELECTABLE);
        Optional.of(lockableClass).ifPresent(l -> l.lock(true));
 
After which the selectable widget will be disabled. In a similar way the lock can be disabled setting the lock to false
 

  • Constructor Details

    • SelectableAcquisitionCompositeFactory

      public SelectableAcquisitionCompositeFactory(List<AcquisitionCompositeFactory> composites)
      Creates an factory instance.
      Parameters:
      composites - the namedCompsite to select from
  • Method Details

    • createComposite

      public org.eclipse.swt.widgets.Composite createComposite(org.eclipse.swt.widgets.Composite parent, int style)
      Specified by:
      createComposite in interface CompositeFactory
    • lock

      public void lock(boolean lock)
      Enable, or disable, the selectable widget
      Specified by:
      lock in interface Lockable
      Parameters:
      lock - true to lock, false to unlock