Java Reference
In-Depth Information
generated diagram, we need to contribute our own providers and implementa-
tion classes in our customization plug-in. Beginning in the Extensions tab of our
plug-in manifest editor, add a new
viewProviders
and
editpartProviders
extensions to match what's shown here. Notice that the
Priority
of both
providers is set to
Medium
, thereby ensuring that they will override our gener-
ated providers, which are set to
Lowest
.
<plugin>
<extension
point="org.eclipse.gmf.runtime.diagram.core.viewProviders">
<viewProvider
class="org.eclipse.scenario.diagram.custom.providers.
ScenarioViewProvider">
<Priority name="Medium"/>
<context viewClass="org.eclipse.gmf.runtime.notation.Node"
semanticHints=""/>
</viewProvider>
</extension>
<extension
point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders">
<editpartProvider
class="org.eclipse.scenario.diagram.custom.providers.
ScenarioEditPartProvider">
<Priority name="Medium"/>
</editpartProvider>
</extension>
</plugin>
We need to provide our two classes specified. The
ScenarioViewProvider
appears next and overrides the
getNodeViewClass()
method to return an
IntermediateEventImageViewFactory
class when the passed element's
visual ID matches that of our
Event2EditPart
. This is the
EditPart
that rep-
resents the Intermediate Event nodes on our diagram, although we should proba-
bly return to our
scenario.gmfgen
model and give each
Event
a more
descriptive name. This is the default naming scheme that the GMF generator
applies when a single domain element represents multiple elements in the diagram.
TIP
The default
Export-Package
list in the
MANIFEST.MF
of a generated
diagram plug-in includes only the
*
.
edit.parts
,
*
.
part
, and
*.providers
packages. If you expect that your diagram will be extended,
such as in the manner described here, you must export additional packages
before shipping your diagram.
Search WWH ::
Custom Search