Package uk.ac.diamond.daq.mapping.ui
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
-
Field Summary
Fields inherited from interface gda.rcp.views.CompositeFactory
COMPOSITE_ROOTFields inherited from interface uk.ac.gda.ui.tool.selectable.Lockable
LOCKABLE_SELECTABLE -
Constructor Summary
ConstructorsConstructorDescriptionCreates an factory instance. -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.swt.widgets.CompositecreateComposite(org.eclipse.swt.widgets.Composite parent, int style) voidlock(boolean lock) Enable, or disable, the selectable widget
-
Constructor Details
-
SelectableAcquisitionCompositeFactory
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:
createCompositein interfaceCompositeFactory
-
lock
public void lock(boolean lock) Enable, or disable, the selectable widget
-