Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Customize "New Diagram" command
Customize "New Diagram" command [message #698754] Wed, 20 July 2011 07:30 Go to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Hi all,

I started to dig a bit deeper into the alomst unlimited possibilities of
customizing papyrus. Now, I was wondering whether it would be somehow easily
possible to adapt the "New Diagram" command slightly in a way that a
stereotype will be automatically applied when the diagram was created.

In my case, I'd like to create activity diagrams with an stereotype <<XYZ>>
applied to the activity acting as the canvas for the newly created diagram.
The entry in the context menu would have to look like "Create new XYZ
diagram", the result will simply the stereotyped activity.

I had a look at the extension point org.eclipse.papyrus.core.diagram (or
similar) but this seems to be very overwhelming - actually, I do not want to
create or register a new diagram but rather reuse the command for the
activity diagram instead.

I'm gratefull for any help on this topic.

Timothy
Re: Customize &quot;New Diagram&quot; command [message #699366 is a reply to message #698754] Thu, 21 July 2011 12:26 Go to previous messageGo to next message
Cedric Dumoulin is currently offline Cedric DumoulinFriend
Messages: 35
Registered: July 2009
Member
Hi,

All diagram have a CreateXxxDiagramCommand class, where Xxx is the
name of the diagram (ex: CreateActivityDiagramCommand)) located in the
custom-src/org.eclipse.papyrus.diagram.xxx folder.

You can extend this Class, override the appropriate method (check the
hierarchy) in order to add your stereotype, and then register the
Commandas a toolbar button (by using org.eclipse.ui.menu|command|handler
extensions. Check the plugins.xml of the diagram for an example).

Hope this help,

Cedric

Timothy Marc a écrit :
> Hi all,
>
> I started to dig a bit deeper into the alomst unlimited possibilities of
> customizing papyrus. Now, I was wondering whether it would be somehow
> easily possible to adapt the "New Diagram" command slightly in a way
> that a stereotype will be automatically applied when the diagram was
> created.
>
> In my case, I'd like to create activity diagrams with an stereotype
> <<XYZ>> applied to the activity acting as the canvas for the newly
> created diagram. The entry in the context menu would have to look like
> "Create new XYZ diagram", the result will simply the stereotyped activity.
>
> I had a look at the extension point org.eclipse.papyrus.core.diagram (or
> similar) but this seems to be very overwhelming - actually, I do not
> want to create or register a new diagram but rather reuse the command
> for the activity diagram instead.
>
> I'm gratefull for any help on this topic.
>
> Timothy
crating an eclipse plugin for sysml diagrams [message #1008355 is a reply to message #699366] Tue, 12 February 2013 07:24 Go to previous message
threiveni h.b. is currently offline threiveni h.b.Friend
Messages: 6
Registered: February 2013
Junior Member
hello,

I am developing an eclipse plugin for the railway domain which has sysml model for signalling framework.I have the SysML model developed by my fellow friend.
I know how to draw all those diagrams using UML profile b.y papyrus tool.
My SysML diagrams should be editable once i develop my own eclipse plugin.
This will be use full to designers in the railway domain. I am right now using Eclipse JUNO in what way i can do this i dont know,
can i draw the Class diagrams in papyrus and import them to the new eclipse plugin and make them editable? is it possible?
please guide me if i am going in the wrong direction
Previous Topic:MARTE Basic_NFPTypes
Next Topic:Modeling Papyrus Marte
Goto Forum:
  


Current Time: Thu Dec 18 14:38:53 GMT 2014

Powered by FUDForum. Page generated in 0.02207 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software