org.eclipse.emf.mint.util
Class GroupAdapterImpl

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.AdapterImpl
      extended by org.eclipse.emf.mint.util.GroupAdapterImpl
All Implemented Interfaces:
org.eclipse.emf.common.notify.Adapter, org.eclipse.emf.common.notify.Adapter.Internal

public abstract class GroupAdapterImpl
extends org.eclipse.emf.common.notify.impl.AdapterImpl

Adapter for tracking changes to a group of related objects. Each time a related object is added to the group (typically through a reference), changes to its features are tracked and notifications forwarded to registered listeners. This is particularly useful when an object's derived feature depends on a feature that belongs to one of its referenced objects.

Clients may extend this class.


Nested Class Summary
protected  class GroupAdapterImpl.NotificationForwarder
          Adapter used to forward notifications from related objects to the root object.
protected static class GroupAdapterImpl.NotifierEList
          Deprecated. no longer used
 
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
org.eclipse.emf.common.notify.Adapter.Internal
 
Field Summary
protected  GroupAdapterImpl.NotifierEList targets
          Deprecated. this adapter only tracks a single target
 
Fields inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl
target
 
Constructor Summary
GroupAdapterImpl()
           
 
Method Summary
protected  void addGroupTargets(List<? extends org.eclipse.emf.common.notify.Notifier> groupTargets)
          Adds the given targets to the group of tracked targets.
protected  GroupAdapterImpl.NotificationForwarder createNotificationForwarder()
          Creates a new @{link NotificationForwarder}.
 void dispose()
          Disposes the adapter by removing it from its target.
protected abstract  List<org.eclipse.emf.ecore.EReference> getGroupReferences(org.eclipse.emf.ecore.EObject object)
          Returns the object's references that define its direct relations.
protected  List<org.eclipse.emf.ecore.EObject> getGroupTargets(org.eclipse.emf.ecore.EObject object)
          Returns the object's direct relations.
protected  org.eclipse.emf.common.notify.Notifier getRootTarget()
          Deprecated. use AdapterImpl.getTarget() instead
protected  boolean isGroupReference(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EReference ref)
          Determines whether the object's reference participates in defining its relations.
 void notifyChanged(org.eclipse.emf.common.notify.Notification msg)
           
protected  void removeGroupTargets(List<? extends org.eclipse.emf.common.notify.Notifier> groupTargets)
          Removes the targets from the group of tracked targets.
 void setTarget(org.eclipse.emf.common.notify.Notifier target)
           
 void unsetTarget(org.eclipse.emf.common.notify.Notifier target)
           
 
Methods inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl
getTarget, isAdapterForType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

targets

protected GroupAdapterImpl.NotifierEList targets
Deprecated. this adapter only tracks a single target
Tracked targets (the group).

Constructor Detail

GroupAdapterImpl

public GroupAdapterImpl()
Method Detail

setTarget

public void setTarget(org.eclipse.emf.common.notify.Notifier target)
Specified by:
setTarget in interface org.eclipse.emf.common.notify.Adapter
Overrides:
setTarget in class org.eclipse.emf.common.notify.impl.AdapterImpl

unsetTarget

public void unsetTarget(org.eclipse.emf.common.notify.Notifier target)
Specified by:
unsetTarget in interface org.eclipse.emf.common.notify.Adapter.Internal
Overrides:
unsetTarget in class org.eclipse.emf.common.notify.impl.AdapterImpl

dispose

public void dispose()
Disposes the adapter by removing it from its target.


notifyChanged

public void notifyChanged(org.eclipse.emf.common.notify.Notification msg)
Specified by:
notifyChanged in interface org.eclipse.emf.common.notify.Adapter
Overrides:
notifyChanged in class org.eclipse.emf.common.notify.impl.AdapterImpl

createNotificationForwarder

protected GroupAdapterImpl.NotificationForwarder createNotificationForwarder()
Creates a new @{link NotificationForwarder}.

Returns:
new notification forwarder

addGroupTargets

protected void addGroupTargets(List<? extends org.eclipse.emf.common.notify.Notifier> groupTargets)
Adds the given targets to the group of tracked targets.

Parameters:
groupTargets - new targets to track

removeGroupTargets

protected void removeGroupTargets(List<? extends org.eclipse.emf.common.notify.Notifier> groupTargets)
Removes the targets from the group of tracked targets.

Parameters:
groupTargets - targets to remove from the group

getGroupTargets

protected List<org.eclipse.emf.ecore.EObject> getGroupTargets(org.eclipse.emf.ecore.EObject object)
Returns the object's direct relations.

Parameters:
object - object whose direct relations to return
Returns:
object's direct relations

isGroupReference

protected boolean isGroupReference(org.eclipse.emf.ecore.EObject object,
                                   org.eclipse.emf.ecore.EReference ref)
Determines whether the object's reference participates in defining its relations.

Parameters:
object - object
ref - object's reference
Returns:
true if the given reference contributes its direct relations

getGroupReferences

protected abstract List<org.eclipse.emf.ecore.EReference> getGroupReferences(org.eclipse.emf.ecore.EObject object)
Returns the object's references that define its direct relations.

Parameters:
object - object whose references to return
Returns:
object's references that define its direct relations

getRootTarget

protected org.eclipse.emf.common.notify.Notifier getRootTarget()
Deprecated. use AdapterImpl.getTarget() instead

Returns the group's root object.

Returns:
the group's root object

Copyright 2008, 2009 Ecliptical Software Inc. and others.
All Rights Reserved.