Package com._1c.g5.modeling.xtext.model
Class DefaultModelChangeEventBroker
- java.lang.Object
-
- com._1c.g5.modeling.xtext.model.DefaultModelChangeEventBroker
-
- All Implemented Interfaces:
IModelChangeEventBroker
,IModelChangeListener
,IModelChangeSource
public class DefaultModelChangeEventBroker extends Object implements IModelChangeEventBroker
DefaultIModelChangeEventBroker
implementation. This implementation is thread safe.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com._1c.g5.modeling.xtext.model.IModelChangeEventBroker
IModelChangeEventBroker.Registry
-
-
Constructor Summary
Constructors Constructor Description DefaultModelChangeEventBroker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(IModelChangeListener listener)
Add a listener to the event source.void
modelChanged(org.eclipse.emf.common.notify.Notification event)
The source will invoce this method to announce changed resource.void
removeListener(IModelChangeListener listener)
Immediately removes a registered listener from the source.
-
-
-
Method Detail
-
addListener
public void addListener(IModelChangeListener listener)
Description copied from interface:IModelChangeSource
Add a listener to the event source. Listeners will not be added twice. Subsequent calls toIModelChangeSource.addListener(IModelChangeListener)
will not affect the number of events that the listener receives.IModelChangeSource.removeListener(IModelChangeListener)
will remove the listener immediately independently from the number of invocations ofIModelChangeSource.addListener(IModelChangeListener)
for the given listener.- Specified by:
addListener
in interfaceIModelChangeSource
- Parameters:
listener
- the listener to be registered. May not benull
.
-
removeListener
public void removeListener(IModelChangeListener listener)
Description copied from interface:IModelChangeSource
Immediately removes a registered listener from the source. However ifIModelChangeSource.removeListener(IModelChangeListener)
is called during a notification, the removed listener will still receive the event. If the listener has not been registered before, theIModelChangeSource.removeListener(IModelChangeListener)
does nothing.- Specified by:
removeListener
in interfaceIModelChangeSource
- Parameters:
listener
- the listener to be removed. May not benull
.
-
modelChanged
public void modelChanged(org.eclipse.emf.common.notify.Notification event)
Description copied from interface:IModelChangeListener
The source will invoce this method to announce changed resource. The event will never be
null
. However, it may contain an empty list of deltas.Listeners are free to remove themselves from the sender of the event or add other listeners. However added listeners will not be informed about the current change.
This event fired synchronously.
- Specified by:
modelChanged
in interfaceIModelChangeListener
- Parameters:
event
- the fired event. Will never benull
.- Throws:
IllegalArgumentException
- if event isnull
.
-
-