Own Diagram Editor based on existing org.eclipse.papyrus.uml.diagram.clazz Editor [message #1020610] |
Mon, 18 March 2013 11:03  |
Eclipse User |
|
|
|
Hello!
I want to create a new Papyrus Diagram Editor and integrate it into Papyrus.
The existing Class Diagram Editor from org.eclipse.papyrus.uml.diagram.clazz does exactly what I need, I only have to do some modifications in one or two classes of this plugin.
What I done so far:
- I copied the org.eclipse.papyrus.uml.diagram.clazz plugin project and rename it into
org.eclipse.papyrus.uml.diagram.myeditor (also the subpackages are changed from clazz to myeditor)
- I changed every occurrence of the the word "clazz" into "myeditor" in the plugin.xml
- The plugin ID is changed to org.eclipse.papyrus.uml.diagram.myeditor
- I also changed the labels for the menu entries with the plugin.xml
for example in:
<menuContribution locationURI="menu:org.eclipse.papyrus.ui.menu">
<menu id="org.eclipse.papyrus.uml.diagram.ui.menu.diagrams"
label="Diagrams">
<command commandId="org.eclipse.papyrus.uml.diagram.myeditor.CreateClassDiagramCommand"
icon="icons/obj16/Diagram_Class.gif"
label="Create a new MyEditor Diagram"
style="push"
tooltip="Create a new MyEditor Diagram">
<visibleWhen>
<reference definitionId="org.eclipse.papyrus.uml.diagram.common.IsPapyrusActiveWithUMLModel"/>
</visibleWhen>
</command>
</menu>
</menuContribution>
If I start a Runtime Eclipse Application from my plugin I see the Entry "MyEditor Diagram" in the list of available Editors but when I choose it, it still executes code from the original org.eclipse.papyrus.uml.diagram.clazz plugin
I checked this by putting a system.out.println command in the initializeGraphicalViewer() method of the class UMLDiagramEditor in my plugin and in the original org.eclipse.papyrus.uml.diagram.clazz plugin. The method initializeGraphicalViewer() from the original org.eclipse.papyrus.uml.diagram.clazz plugin is called.
Thanks in advance.
Best regards
Jan
|
|
|
|
|
|
|
|
|
Re: Own Diagram Editor based on existing org.eclipse.papyrus.uml.diagram.clazz Editor [message #1409635 is a reply to message #1408186] |
Mon, 18 August 2014 11:29  |
Eclipse User |
|
|
|
We added the following menuContribution and changed some things and now the SoaML menus are showing:
<menuContribution locationURI="popup:org.eclipse.papyrus.views.modelexplorer.popupmenu.creatediagram
<command commandId="org.eclipse.papyrus.soaml.diagram.interfacesdef.CreateClassDiagramCommand"
icon="icons/obj16/ServicesInterfacesClass30.png"
label="Create a new Interfaces Definition Diagram"
style="push"
tooltip="Create a new Interfaces Definition Diagram">
<visibleWhen>
<with variable="activeEditorId">
<equals value="org.eclipse.papyrus.infra.core.papyrusEditor">
</equals>
</with>
</visibleWhen>
</command>
</menuContribution>
The problem now is that when we click on one of the options we get the following exception:
java.lang.UnsupportedOperationException at org.eclipse.papyrus.infra.gmfdiag.common.AbstractPapyrusGmfCreateDiagramCommandHandler.execute(AbstractPapyrusGmfCreateDiagramCommandHandler.java:393)
I've taken a look at the AbstractPapyrusGmfCreateDiagramCommandHandler class and the execute method has this comment:
// This method should not be called, use the execute(ExecutionEvent, ViewPrototype, String) method.
But there's no such method with those parameters.
Thank you,
Sofía
|
|
|
Powered by
FUDForum. Page generated in 0.06733 seconds