Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Own Diagram Editor based on existing org.eclipse.papyrus.uml.diagram.clazz Editor(Is it possible to copy the existing Class Diagram plugin project, modify it and deploy it additionally as own Diagram Editor)
Own Diagram Editor based on existing org.eclipse.papyrus.uml.diagram.clazz Editor [message #1020610] Mon, 18 March 2013 11:03 Go to next message
Jan Winter is currently offline Jan Winter
Messages: 1
Registered: March 2013
Junior Member
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 #1021092 is a reply to message #1020610] Tue, 19 March 2013 10:08 Go to previous message
Camille Letavernier is currently offline Camille Letavernier
Messages: 224
Registered: February 2011
Senior Member
Hi Jan,

You also need to update the ModelID and all textual occurrences of this constant:

org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ModelEditPart.MODEL_ID
PapyrusUMLClassDiagram

That's not a clean way to reuse a Diagram, but currently, overriding a diagram is not officially supported in Papyrus.


Camille
Previous Topic:Show/Hide contents question
Next Topic:Should the New Papyrus Model action also create complete diagrams for existing UML model elements?
Goto Forum:
  


Current Time: Wed May 22 18:13:50 EDT 2013

Powered by FUDForum. Page generated in 0.04653 seconds