Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Specifying a description for a structural feature
Specifying a description for a structural feature [message #1300041] Thu, 17 April 2014 09:34 Go to next message
Bertrand Quenin is currently offline Bertrand QueninFriend
Messages: 70
Registered: July 2009
Member
Hi,

I'm wondering if there's a way to specify a description for a "field". For instance, I have the following xcore model:

class Product {
	String runtime_dir = "some runtime dir"
	String install_dir = "some install dir"
}


And this is more or less what I would like to do:

class Product {
        // The runtime directory
	String runtime_dir = "some runtime dir"

        // The installation directory
	String install_dir = "some install dir"
}


Then, at runtime, I would like to be able to fetch this description in order to display it to the user.

I would like to have this in the model in order to have everything in the same place.

I'm not sure how to achieve this.

Regards,
BQ.
Re: Specifying a description for a structural feature [message #1300154 is a reply to message #1300041] Thu, 17 April 2014 11:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Bertrand,

As of now, you can only model features with Xcore, not something that
will map to just fields in the generated implementation class...


On 17/04/2014 11:34 AM, Bertrand Quenin wrote:
> Hi,
>
> I'm wondering if there's a way to specify a description for a "field".
> For instance, I have the following xcore model:
>
>
> class Product {
> String runtime_dir = "some runtime dir"
> String install_dir = "some install dir"
> }
>
>
> And this is more or less what I would like to do:
>
>
> class Product {
> // The runtime directory
> String runtime_dir = "some runtime dir"
>
> // The installation directory
> String install_dir = "some install dir"
> }
>
>
> Then, at runtime, I would like to be able to fetch this description in
> order to display it to the user.
>
> I would like to have this in the model in order to have everything in
> the same place.
>
> I'm not sure how to achieve this.
>
> Regards,
> BQ.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Specifying a description for a structural feature [message #1300184 is a reply to message #1300154] Thu, 17 April 2014 11:44 Go to previous message
Bertrand Quenin is currently offline Bertrand QueninFriend
Messages: 70
Registered: July 2009
Member
Thanks for your answer Ed.

I assume I wasn't clear but anyway I think I've found what I need:

class Product {
        @Ecore(description="The runtime directory")
	String runtime_dir = "some runtime dir"

        @Ecore(description="The installation directory")
	String install_dir = "some install dir"
}


It seems I can get the annotation @ runtime with getAnnotations

Fits my requirements Smile

Regards,
BQ.
Previous Topic:Restricting candidates of a feature.
Next Topic:too big for int
Goto Forum:
  


Current Time: Sun Sep 22 15:22:16 GMT 2024

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

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

Back to the top