Class AggregatingModelLoadingListener
- java.lang.Object
-
- net.ssehub.easy.dslCore.ui.listeners.AggregatingModelLoadingListener
-
- All Implemented Interfaces:
IAggregatableListener,IControl
public class AggregatingModelLoadingListener extends java.lang.Object implements IControl, IAggregatableListener
Implements an aggregating model loading listener, which enables the given controls only if all listeners are enabled.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private IControl[]controlsprivate java.util.Map<IAggregatableListener,java.lang.Boolean>state
-
Constructor Summary
Constructors Constructor Description AggregatingModelLoadingListener(IControl... controls)Aggregates the state of multiple loading listeners.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListeners(IAggregatableListener... listeners)Adds the listeners.voiddispose()Disposes all aggregating listeners.voidinitialize()Initializes the listener.voidsetEnabled(IAggregatableListener key, boolean enabled)Notifies Sets the display status to disabled or enabled.
-
-
-
Field Detail
-
controls
private IControl[] controls
-
state
private java.util.Map<IAggregatableListener,java.lang.Boolean> state
-
-
Constructor Detail
-
AggregatingModelLoadingListener
public AggregatingModelLoadingListener(IControl... controls)
Aggregates the state of multiple loading listeners.- Parameters:
controls- the controls to be informed- See Also:
initialize(),addListeners(IAggregatableListener...)
-
-
Method Detail
-
initialize
public void initialize()
Description copied from interface:IAggregatableListenerInitializes the listener.- Specified by:
initializein interfaceIAggregatableListener
-
addListeners
public void addListeners(IAggregatableListener... listeners)
Adds the listeners.- Parameters:
listeners- the listeners
-
setEnabled
public void setEnabled(IAggregatableListener key, boolean enabled)
Description copied from interface:IControlNotifies Sets the display status to disabled or enabled.- Specified by:
setEnabledin interfaceIControl- Parameters:
key- optional information that uniquely identifies the caller in order to aggregate the overall status (may be null)enabled- the next display status
-
dispose
public void dispose()
Disposes all aggregating listeners.- Specified by:
disposein interfaceIAggregatableListener
-
-