org.eclipse.xtext.resource.impl
Class AbstractResourceDescriptionChangeEventSource

java.lang.Object
  extended by org.eclipse.xtext.resource.impl.AbstractResourceDescriptionChangeEventSource
All Implemented Interfaces:
IResourceDescription.Event.Source
Direct Known Subclasses:
AbstractBuilderState, DelegatingEventSource, DirtyStateAwareResourceDescriptions, DirtyStateManager, StateChangeEventBroker, TypeResourceUnloader

public class AbstractResourceDescriptionChangeEventSource
extends java.lang.Object
implements IResourceDescription.Event.Source

Author:
Sebastian Zarnekow - Initial contribution and API

Constructor Summary
protected AbstractResourceDescriptionChangeEventSource()
           
 
Method Summary
 void addListener(IResourceDescription.Event.Listener listener)
          Add a listener to the event source.
 void addListeners(java.util.Collection<IResourceDescription.Event.Listener> listeners)
           
protected  void notifyListeners(IResourceDescription.Event event)
           
 void removeListener(IResourceDescription.Event.Listener listener)
          Immediately removes a registered listener from the source.
 void removeListeners(java.util.Collection<IResourceDescription.Event.Listener> listeners)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractResourceDescriptionChangeEventSource

protected AbstractResourceDescriptionChangeEventSource()
Method Detail

addListener

public void addListener(IResourceDescription.Event.Listener listener)
Description copied from interface: IResourceDescription.Event.Source
Add a listener to the event source. Listeners will not be added twice. Subsequent calls to #addListener(Listener) will not affect the number of events that the listener receives. #removeListener(Listener) will remove the listener immediately independently from the number of invocations of #addListener(Listener) for the given listener.

Specified by:
addListener in interface IResourceDescription.Event.Source
Parameters:
listener - the listener to be registered. May not be null.

addListeners

public void addListeners(java.util.Collection<IResourceDescription.Event.Listener> listeners)

removeListener

public void removeListener(IResourceDescription.Event.Listener listener)
Description copied from interface: IResourceDescription.Event.Source
Immediately removes a registered listener from the source. However if #removeListener(Listener) is called during a notification, the removed listener will still receive the event. If the listener has not been registered before, the #removeListener(Listener) does nothing.

Specified by:
removeListener in interface IResourceDescription.Event.Source
Parameters:
listener - the listener to be removed. May not be null.

removeListeners

public void removeListeners(java.util.Collection<IResourceDescription.Event.Listener> listeners)

notifyListeners

protected void notifyListeners(IResourceDescription.Event event)