public abstract class DMXAbstractController extends Object implements DMXController, ModelChangeAware
Abstract implementation of DMXController
. Clients can extends this class in order to reuse
common functionality found in most controllers, and only implement business logic methods.
In addition, this class implements ModelChangeAware
interface, which enables it to notify listeners about changes in
model. This is used to track progress for long-running tasks.
Modifier and Type | Field and Description |
---|---|
protected String[] |
ids
Model data IDs
|
protected List<ModelChangeListener> |
modelChangeListenersList
List of model changes listeners.
|
Constructor and Description |
---|
DMXAbstractController(String... dataIds)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addModelChangeListener(ModelChangeListener listener)
Add new listener.
|
String[] |
getControllerData() |
String |
getMapping()
Returns a mapping for this controller.
|
String |
getNextViewId()
This method assumes that no next view is defines, and thus returns an empty string.
|
void |
notifyDataChanged(Map<String,Object> data)
Notify listeners that model data is changed.
|
void |
removeModelChangeListener(ModelChangeListener listener)
Remove specified listener.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute
protected String[] ids
protected List<ModelChangeListener> modelChangeListenersList
public DMXAbstractController(String... dataIds)
dataIds
- model data IDspublic String getNextViewId()
getNextViewId
in interface DMXController
public String getMapping()
getMapping
in interface DMXController
public final String[] getControllerData()
getControllerData
in interface DMXController
public void addModelChangeListener(ModelChangeListener listener)
ModelChangeAware
addModelChangeListener
in interface ModelChangeAware
listener
- listener to addpublic void removeModelChangeListener(ModelChangeListener listener)
ModelChangeAware
removeModelChangeListener
in interface ModelChangeAware
listener
- listener to addpublic void notifyDataChanged(Map<String,Object> data)
ModelChangeAware
notifyDataChanged
in interface ModelChangeAware
data
- changed dataCopyright © 2012-2014 Vektor Software. All Rights Reserved.