|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.tu_berlin.cs.tfs.muvitorkit.ui.utils.MuvitorNotifierService
public class MuvitorNotifierService
In MuvitorKit editors, this purely static service can be used to listen to and process EMF notifications fired by almost all EObject instances even without being registered to these models. Usually, listeners of this service perform checks for correctness conditions and generate problem markers on specific model changes.
This service is hooked into MuvitorKit editors via the adapter edit parts,
which by default pass notifications of their models to this service by
calling notifyListeners(Notification)
.
As the default behavior that is this services's main purpose, if MuvitorNotifierService notices that an EObject has been deleted from the model it will take care of closing all MuvitorKit views showing this particular EObject or one of its children.
There are several interfaces for listeners serving different purposes. The
most general is MuvitorNotifierService.IChangeListener
, which will be notified about all
notifications announced via notifyListeners(Notification)
.
Listeners should use this service carefully with respect to performance
issues by reacting on specific notifications only (e.g. by filtering
notifications by their featureID) and restricting listeners to their editor
contexts if possible (see
addListener(IMuvitorListener, MuvitorTreeEditor)
).
Nested Class Summary | |
---|---|
static interface |
MuvitorNotifierService.IChangeListener
Listeners implementing this interface will be notified about all occurring notifications. |
static interface |
MuvitorNotifierService.IChangeListenerJob
This interface is equivalent to MuvitorNotifierService.IChangeListener unless listening
jobs will be notified after all other IMuvitorListener so that
possible reactions to a notification have completed before. |
Method Summary | |
---|---|
static void |
addListener(de.tu_berlin.cs.tfs.muvitorkit.ui.utils.MuvitorNotifierService.IMuvitorListener listener,
MuvitorTreeEditor editor)
Adds a listener to the MuvitorNotifierService . |
static void |
clear(MuvitorTreeEditor editor)
Unregisters all listeners from the MuvitorNotifierService of a
specific editor context. |
static void |
notifyListeners(Notification notification)
This method passes a notification to all listeners registered to the GlobalNotifierService. |
static void |
removeListener(de.tu_berlin.cs.tfs.muvitorkit.ui.utils.MuvitorNotifierService.IMuvitorListener listener)
Removes a listener from the MuvitorNotifierService . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static final void addListener(de.tu_berlin.cs.tfs.muvitorkit.ui.utils.MuvitorNotifierService.IMuvitorListener listener, MuvitorTreeEditor editor)
MuvitorNotifierService
.
listener
- the listener to be addededitor
- the editor in whose context notifications will be forwarded to
the listener, or null
if it should receive all
notifications globallypublic static final void removeListener(de.tu_berlin.cs.tfs.muvitorkit.ui.utils.MuvitorNotifierService.IMuvitorListener listener)
MuvitorNotifierService
.
listener
- the listener to be removedpublic static final void clear(MuvitorTreeEditor editor)
MuvitorNotifierService
of a
specific editor context.
public static final void notifyListeners(Notification notification)
In MuvitorKit editors all edit parts (should) extend the adapter edit parts that by default call this method if their models fire some notification.
If the notification announces that an EObject has been deleted from the model all MuvitorKit views showing this particular EObject or one of its children will be closed.
notification
- the notification to distribute to all registered listenersIMuvitorListener
,
MuvitorNotifierService.IChangeListener
,
MuvitorNotifierService.IChangeListenerJob
,
AdapterTreeEditPart
,
AdapterGraphicalEditPart
,
AdapterConnectionEditPart
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |