Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Setting stereotype of an UML element
Setting stereotype of an UML element [message #60087] Fri, 17 July 2009 12:29 Go to next message
Eclipse UserFriend
Hi @all,

my grammar imports the uml metamodel and contains following rule:

MyClass returns umlMM::Class: 'className' name=ID;

Is it possible to set the stereotype of the class element? If yes, which
steps are required to do that?

Thanks
ILyas
Re: Setting stereotype of an UML element [message #60232 is a reply to message #60087] Fri, 17 July 2009 14:09 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ilyas,

yes it should definitly be possible to set the stereotype.
What did you try to do so?
Do you want to set it in your dsl file? Or do you want to apply a
stereotype to a class based on other conditions?

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


Am 17.07.2009 18:29 Uhr, schrieb Ilyas Keser:
> Hi @all,
>
> my grammar imports the uml metamodel and contains following rule:
>
> MyClass returns umlMM::Class: 'className' name=ID;
>
> Is it possible to set the stereotype of the class element? If yes, which
> steps are required to do that?
>
> Thanks
> ILyas
>
Re: Setting stereotype of an UML element [message #60276 is a reply to message #60232] Fri, 17 July 2009 14:51 Go to previous messageGo to next message
Eclipse UserFriend
Hi Sebastian,

I am trying to set the stereotype as default value. Can I do it by
extending the class Linking.java and then by overriding the method
setDefaultValueImpl() (see your posting at
http://dev.eclipse.org/newslists/news.eclipse.modeling.tmf/m sg00403.html)?

ILyas



Sebastian Zarnekow wrote:

> Hi Ilyas,

> yes it should definitly be possible to set the stereotype.
> What did you try to do so?
> Do you want to set it in your dsl file? Or do you want to apply a
> stereotype to a class based on other conditions?

> Regards,
> Sebastian
Re: Setting stereotype of an UML element [message #61278 is a reply to message #60276] Mon, 20 July 2009 09:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ilyas.keser.gmail.com

Hi @all,

I defined an UML profile with 3 stereotypes: <<Window>>, <<InputField>>
and <<Button>>. In this profile a window can contain input fields and
buttons. I defined a simple grammar:

grammar org.xtext.example.MyDsl with org.eclipse.xtext.common.Terminals

import "http://www.eclipse.org/uml2/3.0.0/UML" as umlMM

generate myDsl "http://www.xtext.org/example/MyDsl"

....

Window:
'Window' name=ID '{'
(inputFields+=InputField)*
(buttons+=Button)*
'}';

InputField:
'Input' name=ID;

Button:
'Button' name=ID;

Just, I want that the rule Window returns a class and apply the
stereotype <<Window>>. To do that, the rule should return umlMM::Class:

Window returns umlMM::Class:
'Window' name=ID '{'
(inputFields+=InputField)*
(buttons+=Button)*
'}';

Logically, this is not possible, because: "Cannot find compatible
feature inputFields in sealed EClass Class from imported package
http://www.eclipse.org/uml2/3.0.0/UML."

Is it possible define a window rule which returns umlMM::Class and owns
additional features. Or do I need a M2M transformation? Any ideas?


Thanks
ILyas
Re: Setting stereotype of an UML element [message #61303 is a reply to message #61278] Mon, 20 July 2009 10:08 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ilyas,

I think a M2M transformation is your way to go. Other opportunities like
implementing a custom IAstFactory require in-depth knowledge about the
framework and its internals and are likely to cause trouble with the
serialization as they will break the bidirectionality of the parser and
the serializer.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 20.07.2009 15:52 Uhr, schrieb Ilyas Keser:
> Hi @all,
>
> I defined an UML profile with 3 stereotypes: <<Window>>, <<InputField>>
> and <<Button>>. In this profile a window can contain input fields and
> buttons. I defined a simple grammar:
>
> grammar org.xtext.example.MyDsl with org.eclipse.xtext.common.Terminals
>
> import "http://www.eclipse.org/uml2/3.0.0/UML" as umlMM
>
> generate myDsl "http://www.xtext.org/example/MyDsl"
>
> ....
>
> Window:
> 'Window' name=ID '{'
> (inputFields+=InputField)*
> (buttons+=Button)*
> '}';
>
> InputField:
> 'Input' name=ID;
>
> Button:
> 'Button' name=ID;
>
> Just, I want that the rule Window returns a class and apply the
> stereotype <<Window>>. To do that, the rule should return umlMM::Class:
>
> Window returns umlMM::Class:
> 'Window' name=ID '{'
> (inputFields+=InputField)*
> (buttons+=Button)*
> '}';
>
> Logically, this is not possible, because: "Cannot find compatible
> feature inputFields in sealed EClass Class from imported package
> http://www.eclipse.org/uml2/3.0.0/UML."
>
> Is it possible define a window rule which returns umlMM::Class and owns
> additional features. Or do I need a M2M transformation? Any ideas?
>
>
> Thanks
> ILyas
Re: Setting stereotype of an UML element [message #62182 is a reply to message #61303] Tue, 21 July 2009 18:57 Go to previous message
Eclipse UserFriend
Hi Sebastian,

thanks for your answer. I will try to use M2M transformations.

Regards,
ILyas

Sebastian Zarnekow schrieb:
> Hi Ilyas,
>
> I think a M2M transformation is your way to go. Other opportunities like
> implementing a custom IAstFactory require in-depth knowledge about the
> framework and its internals and are likely to cause trouble with the
> serialization as they will break the bidirectionality of the parser and
> the serializer.
>
> Regards,
> Sebastian
Previous Topic:[Xtext] Did you forget to configure the corresponding metamodel?
Next Topic:[Xtext-0.7.1] some problems with the first steps
Goto Forum:
  


Current Time: Thu Jun 05 18:53:20 EDT 2025

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

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

Back to the top