Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Is there an api for writing classes from a dsl?
Is there an api for writing classes from a dsl? [message #470234] Mon, 18 May 2009 09:30 Go to next message
steve orobec is currently offline steve orobec
Messages: 156
Registered: July 2009
Senior Member
Hi

I have a DSL & GMF editor which references uml.ecore.

I can load UML classes into a list within my GMF editor.

I would like to display these classes (a subset of a uml
model with 1000+ classes) in a uml class diag editor for
editing, subclassing. Save then have my DSL store the saved
uml edits. Rather than saving the DSL classes to a file
is there a way to pass them back and forth through RAM?

ie press button on DSL editor and the classes open a new
class diag editor, press a button on the class diag and the
edits are saved in the DSL.

regards
Steve
Re: Is there an api for writing classes from a dsl? [message #470237 is a reply to message #470234] Fri, 29 May 2009 05:51 Go to previous message
Patrick Tessier is currently offline Patrick Tessier
Messages: 142
Registered: July 2009
Senior Member
Hi,
In papyrus, I will be possible to acces to the model in memory.
--> add a plugin with the extension popup menu. (for example in the class
diagram)
<extension point="org.eclipse.ui.popupMenus">
<objectContribution adaptable="false"
id=" org.eclipse.papyrus.diagram.clazz.objectContribution.depende ncybranchdeletion "
objectClass=" org.eclipse.papyrus.diagram.clazz.edit.parts.DependencyBranc hEditPart ">
<action
class=" org.eclipse.papyrus.diagram.clazz.custom.command.DependencyB ranchDeletion "
definitionId=" org.eclipse.papyrus.diagram.clazz.dependencybranchdeletionID "
enablesFor="1" icon="icons/Delete_16x16.gif"
id=" org.eclipse.papyrus.diagram.clazz.dependencybranchdeletionAc tionID "
label="Delete dependency branch " menubarPath="editGroup">
</action>
</objectContribution>
</extension>
->create an action that can be run on a editpart for example :
org.eclipse.papyrus.diagram.clazz.custom.command.DisplayAllA ssociationBranchCommand
in the class diagram. In your case, look for a DiagramEditPart.

The diagram is always associated to a notation node . if you execute
getElement on this done you will get the uml element. In the case of
diagram, you will access to package model or profile uml Element. this is
your model in memory. If you want to obtain the tip package of you model,
verify if this the case by testing owner == null on package uml element.

In the future, we will add plugin example that access to the model in order
to help people to add plugin in htis environment.

-------------------------
Patrick

"Bill Hinge" <steve.orobec@btopenworld.com> a
Re: Is there an api for writing classes from a dsl? [message #586299 is a reply to message #470234] Fri, 29 May 2009 05:51 Go to previous message
Patrick Tessier is currently offline Patrick Tessier
Messages: 142
Registered: July 2009
Senior Member
Hi,
In papyrus, I will be possible to acces to the model in memory.
--> add a plugin with the extension popup menu. (for example in the class
diagram)
<extension point="org.eclipse.ui.popupMenus">
<objectContribution adaptable="false"
id=" org.eclipse.papyrus.diagram.clazz.objectContribution.depende ncybranchdeletion "
objectClass=" org.eclipse.papyrus.diagram.clazz.edit.parts.DependencyBranc hEditPart ">
<action
class=" org.eclipse.papyrus.diagram.clazz.custom.command.DependencyB ranchDeletion "
definitionId=" org.eclipse.papyrus.diagram.clazz.dependencybranchdeletionID "
enablesFor="1" icon="icons/Delete_16x16.gif"
id=" org.eclipse.papyrus.diagram.clazz.dependencybranchdeletionAc tionID "
label="Delete dependency branch " menubarPath="editGroup">
</action>
</objectContribution>
</extension>
->create an action that can be run on a editpart for example :
org.eclipse.papyrus.diagram.clazz.custom.command.DisplayAllA ssociationBranchCommand
in the class diagram. In your case, look for a DiagramEditPart.

The diagram is always associated to a notation node . if you execute
getElement on this done you will get the uml element. In the case of
diagram, you will access to package model or profile uml Element. this is
your model in memory. If you want to obtain the tip package of you model,
verify if this the case by testing owner == null on package uml element.

In the future, we will add plugin example that access to the model in order
to help people to add plugin in htis environment.

-------------------------
Patrick

"Bill Hinge" <steve.orobec@btopenworld.com> a
Previous Topic:Is there an api for writing classes from a dsl?
Next Topic:bug in UML validation
Goto Forum:
  


Current Time: Fri Jul 25 06:38:18 EDT 2014

Powered by FUDForum. Page generated in 0.01559 seconds