Java Reference
In-Depth Information
<extension point="org.eclipse.emf.ecore.extension_parser">
<parser
type="mmd"
class="org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory">
</parser>
</extension>
Palette Definition
To create diagram elements, we need to define a palette. We can do this in a
largely declarative manner using the paletteProviders extension-point.
Following, we define a palette provider for our mindmap that uses the runtime's
DefaultPaletteProvider class and is associated with our editor using its ID.
Note that the Practitioner can customize the palette.
<extension point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
<paletteProvider
class=
"org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
<Priority name="Highest"/>
<editor
id="org.eclipse.mindmap.diagram.editor.MindmapDiagramEditorID"/>
<contribution
factoryClass="org.eclipse.mindmap.diagram.providers.
MindmapPaletteFactory">
<entry id="nodeDrawer"
label="Nodes"
kind="drawer"
description="Mindmap diagram nodes"
path="/"
small_icon="icons/obj16/MindmapDiagramFile.gif">
<expand>
<content/>
</expand>
</entry>
<entry id="Topic"
label="Topic"
kind="tool"
description="Create a new Topic"
path="/nodeDrawer/"
small_icon="icons/obj16/MindmapDiagramFile.gif"/>
</contribution>
</paletteProvider>
</extension>
We've declared a factory class MindmapPaletteFactory that we need to
implement, along with a node drawer entry with a single Topic tool. Following
is the implementation of our factory class, which extends the inner class
Search WWH ::




Custom Search