de.cau.cs.kieler.core.model.triggers
Class DiagramTrigger.DiagramState

java.lang.Object
  extended by de.cau.cs.kieler.core.kivi.AbstractTriggerState
      extended by de.cau.cs.kieler.core.model.triggers.DiagramTrigger.DiagramState
All Implemented Interfaces:
ITriggerState
Enclosing class:
DiagramTrigger

public static class DiagramTrigger.DiagramState
extends AbstractTriggerState

A TriggerState that contains a diagram that can be processed with the KIELER View Management. Currently the diagram will be represented by an IWorkBenchPart (i.e. an Eclipse Editor or View). From this the corresponding information can be obtained by registered IGraphicalFrameworkBridge instances.

If you want to support another diagram or workbench part type, a new framework bridge has to be implemented for that part.

Rating red

Constructor Summary
DiagramTrigger.DiagramState()
          Default constructor creating an invalid DiagramState.
DiagramTrigger.DiagramState(IWorkbenchPart diagram)
          Constructor taking the corresponding IWorkbenchPart that contains the diagram.
 
Method Summary
 IWorkbenchPart getDiagramPart()
          Get the WorkBenchPart (Editor/View) that contains a diagram.
 String getDiagramType()
          Get the type ID of the diagram.
 IGraphicalFrameworkBridge getGraphicalFrameworkBridge()
          Get the GraphicalFrameworkBridge corresponding to the current diagram.
 EObject getSemanticModel()
          Get the semantic model in shape of the root EObject that corresponds to the diagram.
 Class<? extends ITrigger> getTriggerClass()
          Get the trigger class associated with this trigger state.
 
Methods inherited from class de.cau.cs.kieler.core.kivi.AbstractTriggerState
finish, getKeyClass, getSequenceNumber, merge, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiagramTrigger.DiagramState

public DiagramTrigger.DiagramState()
Default constructor creating an invalid DiagramState.


DiagramTrigger.DiagramState

public DiagramTrigger.DiagramState(IWorkbenchPart diagram)
Constructor taking the corresponding IWorkbenchPart that contains the diagram.

Parameters:
diagram - a diagram editor part
Method Detail

getDiagramPart

public IWorkbenchPart getDiagramPart()
Get the WorkBenchPart (Editor/View) that contains a diagram. It was already checked that a GraphicalFrameworkBridge is available for this part, so this is guaranteed here.

Returns:
an Eclipse WorkBenchPart containing a diagram.

getGraphicalFrameworkBridge

public IGraphicalFrameworkBridge getGraphicalFrameworkBridge()
Get the GraphicalFrameworkBridge corresponding to the current diagram. This should be used to obtain model or diagram information in a generic fashion.

Returns:
the registered IGraphicalFrameworkBridge for this diagram

getSemanticModel

public EObject getSemanticModel()
Get the semantic model in shape of the root EObject that corresponds to the diagram. May throw an UnsupportedPartException if no semantic model can be found. So this method never returns null.

Returns:
EObject model corresponding to the diagram

getDiagramType

public String getDiagramType()
Get the type ID of the diagram. I.e. in an editor it is the same as the Editor ID. TODO: should be adopted to views if views get supported

Returns:
String ID of the diagram type

getTriggerClass

public Class<? extends ITrigger> getTriggerClass()
Get the trigger class associated with this trigger state.

Returns:
the trigger class