org.eclipse.gmf.graphdef.editor.sheet
Class AttachAdapter

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.AdapterImpl
      extended by org.eclipse.gmf.graphdef.editor.sheet.AttachAdapter
All Implemented Interfaces:
org.eclipse.emf.common.notify.Adapter, org.eclipse.emf.common.notify.Adapter.Internal

public final class AttachAdapter
extends org.eclipse.emf.common.notify.impl.AdapterImpl

Helper adapter that tracks specific feature of the notifier(s) it is attached to (with regular objOfInterest.eAdapters().add(attachAdapter) call) and attaches/detaches provided adapter when feature value changes (set/unset, add/remove)

Author:
artem

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
org.eclipse.emf.common.notify.Adapter.Internal
 
Field Summary
 
Fields inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl
target
 
Constructor Summary
AttachAdapter(org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.common.notify.Adapter... attachAdapters)
          Plain attaching/detaching adapter, with no additional change tracker.
AttachAdapter(org.eclipse.emf.ecore.EReference reference, ChangeTracker tracker, org.eclipse.emf.common.notify.Adapter... attachAdapters)
           
 
Method Summary
 void notifyChanged(org.eclipse.emf.common.notify.Notification msg)
           
 void setTarget(org.eclipse.emf.common.notify.Notifier newTarget)
           
 void unsetTarget(org.eclipse.emf.common.notify.Notifier oldTarget)
           
 
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
 

Constructor Detail

AttachAdapter

public AttachAdapter(org.eclipse.emf.ecore.EReference reference,
                     org.eclipse.emf.common.notify.Adapter... attachAdapters)
Plain attaching/detaching adapter, with no additional change tracker.

See Also:
AttachAdapter(EReference, ChangeTracker, Adapter...)

AttachAdapter

public AttachAdapter(org.eclipse.emf.ecore.EReference reference,
                     ChangeTracker tracker,
                     org.eclipse.emf.common.notify.Adapter... attachAdapters)
Parameters:
reference - - feature to track, non-null, adapter's target expected to conform feature's container type
tracker - - notified on feature change in addition to attached/detached adapters, may be null. If specified, gets notification *after* adapters were attached/detached.
attachAdapters - - copy by reference, do not change initial array
Method Detail

setTarget

public void setTarget(org.eclipse.emf.common.notify.Notifier newTarget)
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 oldTarget)
Specified by:
unsetTarget in interface org.eclipse.emf.common.notify.Adapter.Internal
Overrides:
unsetTarget in class org.eclipse.emf.common.notify.impl.AdapterImpl

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


Copyright © 2012. All Rights Reserved.