public interface ActivatorConfigurator
Modifier and Type | Method and Description |
---|---|
void |
addActionListener(ActionListener listener)
Adds a listener that will be informed when the GUI state changes
in such a way that the result of
getActivator or
getConfigMessage may change. |
Activator |
getActivator()
Constructs an activator in accordance with the current state of
this GUI.
|
String |
getConfigMessage()
Returns a short status message for display to the user.
|
JComponent |
getPanel()
Returns the GUI component with which the user can interact.
|
Safety |
getSafety()
Indicates whether an activator created by the current state
of this configurator is known to be harmless.
|
ConfigState |
getState()
Returns an object that contains the current state of this configurator.
|
void |
removeActionListener(ActionListener listener)
Removes a previously added listener.
|
void |
setState(ConfigState state)
Restores the state of this object from a given state object.
|
JComponent getPanel()
Activator getActivator()
This method may be called often, so should be cheap to invoke. The idea is that it will be called immediately before the activator is used, so the returned object may fix, rather than arrange to gather at a later date, information acquired from the GUI.
getConfigMessage()
String getConfigMessage()
As a rule, exactly one of this method and the
getActivator
should return null.
If there is no activator, this method should return some
reason why the configuration is incorrect or incomplete,
and otherwise it should return null.
void addActionListener(ActionListener listener)
getActivator
or
getConfigMessage
may change.listener
- listener to addvoid removeActionListener(ActionListener listener)
listener
- listener to removeConfigState getState()
void setState(ConfigState state)
state
- stored stateSafety getSafety()
Implementations should be cautious; if some slightly adjusted state might be dangerous, false could be returned as well (that's why this method is on ActivatorConfigurator and not Activator itself).
Copyright © 2003-2025 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.