Java Reference
In-Depth Information
}
public static final String ID =
"org.eclipse.mindmap.diagram.editor.MindmapDiagramEditorID";
@Override
public String getContributorId() {
return MindmapDiagramEditorPlugin.ID;
}
}
Notice in our manifest that we declare that DiagramDocumentEditor
MatchingStrategy provides our editor's matching strategy. This class is pro-
vided along with our editor's superclass by the GMF runtime and is sufficient for
our needs as is. However, we must implement our own contributor class. To do
this, we again use the quick fix and create a class to extend DiagramActionBar
Contributor , provided by the runtime in the org.eclipse.gmf.
runtime.diagram.ui.parts package. We need to override two methods, as
shown here. The superclass uses the contribution item service to initialize a
default set of action bars that are useful for most diagrams.
public class MindmapDiagramActionBarContributor
extends DiagramActionBarContributor {
@Override
protected Class<MindmapDiagramEditor> getEditorClass() {
return MindmapDiagramEditor. class ;
}
@Override
protected String getEditorId() {
return MindmapDiagramEditor.ID;
}
}
Domain Model
We must register each of the domain model elements used in our diagram within
an org.eclipse.gmf.runtime.emf.type.core.elementTypes contribu-
tion, declaring our mindmap model NS URI as the metamodel.
<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
<metamodel nsURI="http://www.eclipse.org/2008/mindmap">
<metamodelType
id="org.eclipse.mindmap.diagram.Map"
Search WWH ::




Custom Search