de.cau.cs.kieler.viewmanagement.triggers
Class DiagramListener

java.lang.Object
  extended by de.cau.cs.kieler.viewmanagement.triggers.DiagramListener
All Implemented Interfaces:
EventListener, ResourceSetListener, IPartListener, IStartup

public class DiagramListener
extends Object
implements IPartListener, IStartup, ResourceSetListener

A generic listener, that listens to Diagram events of the currently active editor.

Rating red

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.transaction.ResourceSetListener
ResourceSetListener.Internal
 
Constructor Summary
DiagramListener()
           
 
Method Summary
 void earlyStartup()
          Registers this class as a listener to changes of the active editor.
 NotificationFilter getFilter()
           
 boolean isAggregatePrecommitListener()
           
 boolean isPostcommitOnly()
           
 boolean isPrecommitOnly()
           
 void partActivated(IWorkbenchPart part)
          When the active editor changes to a DiagramEditor, this class is added as a ResourceSetListener.
 void partBroughtToTop(IWorkbenchPart part)
           
 void partClosed(IWorkbenchPart part)
           
 void partDeactivated(IWorkbenchPart part)
          Remove previously added ResourceSetListener from the editor.
 void partOpened(IWorkbenchPart part)
           
 void resourceSetChanged(ResourceSetChangeEvent event)
           
 Command transactionAboutToCommit(ResourceSetChangeEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiagramListener

public DiagramListener()
Method Detail

earlyStartup

public void earlyStartup()
Registers this class as a listener to changes of the active editor.

Specified by:
earlyStartup in interface IStartup
See Also:
IStartup.earlyStartup(), partActivated(IWorkbenchPart)

partActivated

public void partActivated(IWorkbenchPart part)
When the active editor changes to a DiagramEditor, this class is added as a ResourceSetListener. This will notify this listener about changes of the diagram, e.g. Collapse or Expand events.

Specified by:
partActivated in interface IPartListener
See Also:
IPartListener.partActivated(org.eclipse.ui.IWorkbenchPart)

partDeactivated

public void partDeactivated(IWorkbenchPart part)
Remove previously added ResourceSetListener from the editor.

Specified by:
partDeactivated in interface IPartListener

resourceSetChanged

public void resourceSetChanged(ResourceSetChangeEvent event)
Specified by:
resourceSetChanged in interface ResourceSetListener

partBroughtToTop

public void partBroughtToTop(IWorkbenchPart part)
Specified by:
partBroughtToTop in interface IPartListener

partClosed

public void partClosed(IWorkbenchPart part)
Specified by:
partClosed in interface IPartListener

partOpened

public void partOpened(IWorkbenchPart part)
Specified by:
partOpened in interface IPartListener

getFilter

public NotificationFilter getFilter()
Specified by:
getFilter in interface ResourceSetListener

isAggregatePrecommitListener

public boolean isAggregatePrecommitListener()
Specified by:
isAggregatePrecommitListener in interface ResourceSetListener

isPostcommitOnly

public boolean isPostcommitOnly()
Specified by:
isPostcommitOnly in interface ResourceSetListener

isPrecommitOnly

public boolean isPrecommitOnly()
Specified by:
isPrecommitOnly in interface ResourceSetListener

transactionAboutToCommit

public Command transactionAboutToCommit(ResourceSetChangeEvent event)
                                 throws RollbackException
Specified by:
transactionAboutToCommit in interface ResourceSetListener
Throws:
RollbackException