Class BasicModelLoadingListener<M extends IModel>
- java.lang.Object
-
- net.ssehub.easy.dslCore.ui.listeners.BasicModelLoadingListener<M>
-
- Type Parameters:
M- the model type
- All Implemented Interfaces:
IModelProcessingListener<M>,IAggregatableListener
public class BasicModelLoadingListener<M extends IModel> extends java.lang.Object implements IModelProcessingListener<M>, IAggregatableListener
Generically implements a model processing (loading) listener which disables UI controls.- Author:
- Holger Eichelberger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.ssehub.easy.basics.modelManagement.IModelProcessingListener
IModelProcessingListener.Type
-
-
Field Summary
Fields Modifier and Type Field Description private IControlcontrolprivate ModelInfo<M>infoprivate ModelManagement<M>mgtprivate IModelProcessingListener.Type[]types
-
Constructor Summary
Constructors Constructor Description BasicModelLoadingListener(ModelInfo<M> info, ModelManagement<M> mgt, IControl control)Creates a generic listener.BasicModelLoadingListener(ModelInfo<M> info, ModelManagement<M> mgt, IControl control, IModelProcessingListener.Type[] types)Creates a generic listener.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <M extends IModel>
BasicModelLoadingListener<M>createListener(ModelInfo<M> info, ModelManagement<M> mgt, IControl control, IModelProcessingListener.Type... types)Creates a generic listener.static <M extends IModel>
BasicModelLoadingListener<M>createLoadingListener(ModelInfo<M> info, ModelManagement<M> mgt, IControl control)Creates a model loading listener.voiddispose()Disposes this listener, i.e., deregisters it.voidinitialize()Initializes this listener.private booleaninTypes(IModelProcessingListener.Type type)Whethertypeis intypes.voidnotifyProcessingEnded(ModelInfo<M> info, IModelProcessingListener.Type type)Is called when processing ended (or shortly after).voidnotifyProcessingStarted(ModelInfo<M> info, IModelProcessingListener.Type type)Is called when processing started (or shortly before).
-
-
-
Field Detail
-
control
private IControl control
-
mgt
private ModelManagement<M extends IModel> mgt
-
types
private IModelProcessingListener.Type[] types
-
-
Constructor Detail
-
BasicModelLoadingListener
public BasicModelLoadingListener(ModelInfo<M> info, ModelManagement<M> mgt, IControl control)
Creates a generic listener. Either useAggregatingModelLoadingListeneror callinitialize()afterwards (but not both). Reacts on all message types.- Parameters:
info- the model information object to listen onmgt- the related model management objectcontrol- the control to be enabled and disabled
-
BasicModelLoadingListener
public BasicModelLoadingListener(ModelInfo<M> info, ModelManagement<M> mgt, IControl control, IModelProcessingListener.Type[] types)
Creates a generic listener. Either useAggregatingModelLoadingListeneror callinitialize()afterwards (but not both).- Parameters:
info- the model information object to listen onmgt- the related model management objectcontrol- the control to be enabled and disabledtypes- message types causing enabled messages (may be null)
-
-
Method Detail
-
createListener
public static <M extends IModel> BasicModelLoadingListener<M> createListener(ModelInfo<M> info, ModelManagement<M> mgt, IControl control, IModelProcessingListener.Type... types)
Creates a generic listener. [convenience method]- Type Parameters:
M- the model type- Parameters:
info- the model information object to listen onmgt- the related model management objectcontrol- the control to be enabled and disabledtypes- message types causing enabled messages (may be null)- Returns:
- the created listener
-
createLoadingListener
public static <M extends IModel> BasicModelLoadingListener<M> createLoadingListener(ModelInfo<M> info, ModelManagement<M> mgt, IControl control)
Creates a model loading listener. [convenience method]- Type Parameters:
M- the model type- Parameters:
info- the model information object to listen onmgt- the related model management objectcontrol- the control to be enabled and disabled- Returns:
- the created listener
-
initialize
public void initialize()
Initializes this listener.- Specified by:
initializein interfaceIAggregatableListener
-
inTypes
private boolean inTypes(IModelProcessingListener.Type type)
Whethertypeis intypes.- Parameters:
type- the type to look for- Returns:
trueif type is a contained type,falseelse
-
notifyProcessingStarted
public void notifyProcessingStarted(ModelInfo<M> info, IModelProcessingListener.Type type)
Description copied from interface:IModelProcessingListenerIs called when processing started (or shortly before).- Specified by:
notifyProcessingStartedin interfaceIModelProcessingListener<M extends IModel>- Parameters:
info- the model informationtype- the processing type
-
notifyProcessingEnded
public void notifyProcessingEnded(ModelInfo<M> info, IModelProcessingListener.Type type)
Description copied from interface:IModelProcessingListenerIs called when processing ended (or shortly after).- Specified by:
notifyProcessingEndedin interfaceIModelProcessingListener<M extends IModel>- Parameters:
info- the model informationtype- the processing type
-
dispose
public void dispose()
Disposes this listener, i.e., deregisters it.- Specified by:
disposein interfaceIAggregatableListener
-
-