All Superinterfaces:
Action, ActionListener, EventListener
All Known Subinterfaces:
CommandControl, Controls, ToggleControl

public interface Control extends Action
An Action with a reactive enabled state and Optional-based accessors.

Unlike a plain Action, a Control's enabled state is controlled through an ObservableState supplied when building it (ControlBuilder.enabled(ObservableState)); setEnabled(boolean) throws UnsupportedOperationException. Its properties (caption, mnemonic, icons, colors, ...) are exposed via Optional accessors.

Controls come in two flavors: a Control.Command/Control.ActionCommand based CommandControl and a Value/State based ToggleControl.

 State selectionEmpty = // ...

 CommandControl delete = Control.builder()
     .command(this::deleteSelected)
     .caption("Delete")
     .mnemonic('D')
     .enabled(selectionEmpty.not())
     .build();
See Also: