...
Table of Contents | ||
---|---|---|
|
...
Defining the Diagram Type
The main documentation of Graphiti is found in the Eclipse online help, which is also found in the Eclipse application (Help → Help Contents). If you don't have Graphiti yet, install it from the Juno release update site, Modeling category.
- Read the Graphiti Introduction.
- Create a new plugin named de.cau.cs.rtprak.login.turing.graphiti (like in previous tutorials, replace "login" by your login name) and add dependencies to the following plugins:
- org.eclipse.graphiti
- org.eclipse.graphiti.ui
- Create a class
TuringDiagramTypeProvider
with superclassorg.eclipse.graphiti.dt.AbstractDiagramTypeProvider
. - Open
plugin.xml
and create an extension for org.eclipse.graphiti.ui.diagramTypes with a diagramType element:- id: de.cau.cs.rtprak.TuringDiagramType
- type: turing
- name: Turing Diagram Type
- Create an extension for org.eclipse.graphiti.ui.diagramTypeProviders with a diagramTypeProvider element:
- id: de.cau.cs.rtprak.login.TuringDiagramTypeProvider
- name: Turing Diagram
- class: name of the
TuringDiagramTypeProvider
class
- Add a diagramType element to the diagramTypeProvider with id de.cau.cs.rtprak.TuringDiagramType.
- Create a class
TuringFeatureProvider
with superclassorg.eclipse.graphiti.ui.features.DefaultFeatureProvider
. Add the following constructor to
TuringDiagramTypeProvider
:Code Block theme Eclipse language java /** * Create a Turing diagram type provider. */ public TuringDiagramTypeProvider() { setFeatureProvider(new TuringFeatureProvider(this)); }