|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.transaction.ResourceSetListenerImpl
org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker
public class DiagramEventBroker
A model server listener that broadcast EObject events to all registered listeners.
Nested Class Summary | |
---|---|
static interface |
DiagramEventBroker.DiagramEventBrokerFactory
Factory interface that can be used to create overrides of the DiagramEventBroker class |
class |
DiagramEventBroker.NotifierToKeyToListenersSetMap
Utility class representing a Map of Notifier to a Map of Keys to a Set of listener |
Constructor Summary | |
---|---|
protected |
DiagramEventBroker()
Creates a DiagramEventBroker that listens to all
EObject notifications for the given editing domain. |
Method Summary | |
---|---|
void |
addNotificationListener(org.eclipse.emf.ecore.EObject target,
org.eclipse.emf.ecore.EStructuralFeature key,
NotificationListener listener)
Add the supplied listener to the listener list. |
void |
addNotificationListener(org.eclipse.emf.ecore.EObject target,
org.eclipse.emf.ecore.EStructuralFeature key,
NotificationPreCommitListener listener)
Add the supplied listener to the listener list. |
void |
addNotificationListener(org.eclipse.emf.ecore.EObject target,
NotificationListener listener)
Add the supplied listener to the listener list. |
void |
addNotificationListener(org.eclipse.emf.ecore.EObject target,
NotificationPreCommitListener listener)
Add the supplied listener to the listener list. |
protected void |
fireNotification(org.eclipse.emf.common.notify.Notification event)
Forward the supplied event to all listeners listening on the supplied target element. |
static DiagramEventBroker |
getInstance(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain)
Gets the diagmam event broker instance for the editing domain passed in. |
protected java.util.Set |
getInterestedNotificationListeners(org.eclipse.emf.common.notify.Notification event,
DiagramEventBroker.NotifierToKeyToListenersSetMap listeners)
gets a subset of all the registered listeners who are interested in receiving the supplied event. |
protected DiagramEventBroker.NotifierToKeyToListenersSetMap |
getPostCommitListenersMap()
returns the post commit listeners map |
protected DiagramEventBroker.NotifierToKeyToListenersSetMap |
getPreCommitListenersMap()
returns the pre commit listeners map |
protected void |
handleNotificationOnAddedElement(org.eclipse.emf.transaction.ResourceSetChangeEvent event)
This method allows clients to customize the Diagram event broker behavior when it comes to handling events on added objects. |
protected void |
handleNotificationOnDeletedElement(org.eclipse.emf.transaction.ResourceSetChangeEvent event)
This method allows clients to customize the Diagram event broker behavior when it comes to handling events on deleted objects. |
boolean |
isAggregatePrecommitListener()
|
protected boolean |
isDeleted(java.util.Set deletedObjects,
org.eclipse.emf.ecore.EObject notifier)
decide if the passed object is deleted or not; the decision is done by checking is the passed notifier or any of its ancestors exists in the passed deletedObjects Set, if it find the obnject to be deleted it will add it to the deleted objects set. |
static void |
registerDiagramEventBrokerFactory(DiagramEventBroker.DiagramEventBrokerFactory newDebFactory)
|
void |
removeNotificationListener(org.eclipse.emf.ecore.EObject target,
NotificationListener listener)
remove the supplied listener from the listener list. |
void |
removeNotificationListener(org.eclipse.emf.ecore.EObject target,
NotificationPreCommitListener listener)
remove the supplied listener from the listener list. |
void |
removeNotificationListener(org.eclipse.emf.ecore.EObject target,
java.lang.Object key,
NotificationListener listener)
remove the supplied listener from the listener list. |
void |
removeNotificationListener(org.eclipse.emf.ecore.EObject target,
java.lang.Object key,
NotificationPreCommitListener listener)
remove the supplied listener from the listener list. |
void |
resourceSetChanged(org.eclipse.emf.transaction.ResourceSetChangeEvent event)
|
protected boolean |
shouldIgnoreNotification(org.eclipse.emf.common.notify.Notification notification)
determine if the passed notification can be ignored or not the default implementation will ignore touch event if it is not a resolve event, also it will ignore the mutable feature events |
static void |
startListening(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain)
Creates a new diagram event broker instance for the editing domain passed in only if the editing domain does not already have a diagram event broker. |
static void |
stopListening(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain)
|
org.eclipse.emf.common.command.Command |
transactionAboutToCommit(org.eclipse.emf.transaction.ResourceSetChangeEvent event)
|
Methods inherited from class org.eclipse.emf.transaction.ResourceSetListenerImpl |
---|
getFilter, isPostcommitOnly, isPrecommitOnly |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DiagramEventBroker()
DiagramEventBroker
that listens to all
EObject
notifications for the given editing domain.
Method Detail |
---|
protected DiagramEventBroker.NotifierToKeyToListenersSetMap getPreCommitListenersMap()
protected DiagramEventBroker.NotifierToKeyToListenersSetMap getPostCommitListenersMap()
public static DiagramEventBroker getInstance(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain)
editingDomain
-
public static void startListening(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain)
editingDomain
- public static void registerDiagramEventBrokerFactory(DiagramEventBroker.DiagramEventBrokerFactory newDebFactory)
newDebFactory
- public static void stopListening(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain)
editingDomain
- public org.eclipse.emf.common.command.Command transactionAboutToCommit(org.eclipse.emf.transaction.ResourceSetChangeEvent event)
transactionAboutToCommit
in interface org.eclipse.emf.transaction.ResourceSetListener
transactionAboutToCommit
in class org.eclipse.emf.transaction.ResourceSetListenerImpl
public void resourceSetChanged(org.eclipse.emf.transaction.ResourceSetChangeEvent event)
resourceSetChanged
in interface org.eclipse.emf.transaction.ResourceSetListener
resourceSetChanged
in class org.eclipse.emf.transaction.ResourceSetListenerImpl
protected void handleNotificationOnAddedElement(org.eclipse.emf.transaction.ResourceSetChangeEvent event)
event
- being handledprotected void handleNotificationOnDeletedElement(org.eclipse.emf.transaction.ResourceSetChangeEvent event)
event
- event being handledprotected boolean isDeleted(java.util.Set deletedObjects, org.eclipse.emf.ecore.EObject notifier)
deletedObjects
- notifier
-
protected boolean shouldIgnoreNotification(org.eclipse.emf.common.notify.Notification notification)
notification
- the notification to check
protected void fireNotification(org.eclipse.emf.common.notify.Notification event)
Note, for the MSL migration effort, each listener will be forwarded 2 events. First, a MSL complient Notification event followed by an ElementEvent (for backwards compatibility). The ElementEvent will be removed one the MSL migration is complete.
public void addNotificationListener(org.eclipse.emf.ecore.EObject target, NotificationPreCommitListener listener)
target
- the traget to listen tolistener
- the listenerpublic void addNotificationListener(org.eclipse.emf.ecore.EObject target, NotificationListener listener)
target
- the traget to listen tolistener
- the listenerpublic void addNotificationListener(org.eclipse.emf.ecore.EObject target, org.eclipse.emf.ecore.EStructuralFeature key, NotificationPreCommitListener listener)
target
- the traget to listen tokey
- the key for the listenerlistener
- the listenerpublic void addNotificationListener(org.eclipse.emf.ecore.EObject target, org.eclipse.emf.ecore.EStructuralFeature key, NotificationListener listener)
target
- the traget to listen tokey
- the key for the listenerlistener
- the listenerpublic void removeNotificationListener(org.eclipse.emf.ecore.EObject target, NotificationPreCommitListener listener)
target
- the traget to listen tolistener
- the listenerpublic void removeNotificationListener(org.eclipse.emf.ecore.EObject target, NotificationListener listener)
target
- the traget to listen tolistener
- the listenerpublic void removeNotificationListener(org.eclipse.emf.ecore.EObject target, java.lang.Object key, NotificationPreCommitListener listener)
target
- the traget to listen tokey
- the key for the listenerlistener
- the listenerpublic void removeNotificationListener(org.eclipse.emf.ecore.EObject target, java.lang.Object key, NotificationListener listener)
target
- the traget to listen tokey
- the key for the listenerlistener
- the listenerprotected java.util.Set getInterestedNotificationListeners(org.eclipse.emf.common.notify.Notification event, DiagramEventBroker.NotifierToKeyToListenersSetMap listeners)
event
- the event to use
public boolean isAggregatePrecommitListener()
isAggregatePrecommitListener
in interface org.eclipse.emf.transaction.ResourceSetListener
isAggregatePrecommitListener
in class org.eclipse.emf.transaction.ResourceSetListenerImpl
|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.