IEnabler interface and
can therefore act as enablers.
Some ULC components and models can act as enabler "sources" of other components.
Based on the state of the enabler component, ULC automatically enables
or disables registered components (without any communication to the server).
The enabling condition depends on the type of the enabler "source"
component, e.g., using ULCTextField as an enabler, components are
enabled if the field is non-empty. Such enabling conditions may be
logically negated (ULCNotEnabler) or concatenated
(ULCAndEnabler, ULCMandatoryAndEnabler,
ULCOrEnabler,
and ULCXorEnabler).
The application developer can freely combine these enablers to model even
complex dependencies.
Note that besides enabling single components, enablers can also be
applied to containers (i.e., ULCBoxPane), with the effect that all
widgets of the container are enabled or disabled at once.
Instead of enabling and disabling components manually in the application code,
use enablers whenever possible in order to avoid server roundtrips. Enablers
are used by specifying the enabling source as enabler for the component.
The IEnabler interface tags all components that can serve as enablers.
The following list provides an overview of components along with their enabling condition.
| Enabling source | Enabling condition |
ULCListSelectionModel | The selection on the corresponding component is not empty. |
ULCTreeSelectionModel | The selection on the corresponding component is not empty. |
ULCComboBox | The selected item is not null. |
ULCTextField | The field is not empty. |
ULCTextArea | The field is not empty. |
ULCPasswordField | The field is not empty. |
ULCCheckBox | The button is selected. |
ULCRadioButton | The button is selected. |
ULCToggleButton | The button is selected. |
ULCCheckBoxMenuItem | The menu item is selected. |
ULCRadioButtonMenuItem | The menu item is selected. |
There is one special enabler class, ULCHasChangedEnabler.
This enabler can be used to group components, which can have a "dirty" state.
Those components are tagged by the IHasChangedSource interface, and
include input type components, such as text fields, toggle buttons,
tables. ULCHasChangedEnabler requires explicit reset to the "clean"
state before it will generate more enabling events.