Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Constrain which values an attribute is allowed to get
Constrain which values an attribute is allowed to get [message #417342] Wed, 05 March 2008 18:38 Go to next message
Eclipse UserFriend
Originally posted by: muba_u.web.de

Hi,
I have the following problem:
I have got a Class Vocable which has an attribute 'translations" of type
EList<Vocable>. Means my Vocable itself refers to another vocables.

Because of that I only have a EList<Vocable> getVocables() and no setter.

I wanna do this.
The Class Vocable has also an attribute 'value' and 'language'.
Currently i am just supporting 2 typs of languages (lets say english and
german).
If the languae is 'german' the translations (which are vocables and thus
have also an attribute 'language') should only be 'english.

In the editor a Popup appears when I want to add translations. Can I
somehow modify that, that there only appears whose vocables which are
actually allowed to be selected?

Of could you tell me how I can basically check a value befor it is
applied to translations?
If there would be a separate set- or add-method of my
translation-attribute I might be able to do something, but since there
is no such thing I am kinda confused how I can influence that part.


Hope you can help me out.

draGy
Re: Constrain which values an attribute is allowed to get [message #417346 is a reply to message #417342] Wed, 05 March 2008 19:48 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
draGy,

Comments below.

draGy wrote:
> Hi,
> I have the following problem:
> I have got a Class Vocable which has an attribute 'translations" of
> type EList<Vocable>. Means my Vocable itself refers to another vocables.
>
> Because of that I only have a EList<Vocable> getVocables() and no setter.
>
> I wanna do this.
> The Class Vocable has also an attribute 'value' and 'language'.
> Currently i am just supporting 2 typs of languages (lets say english
> and german).
> If the languae is 'german' the translations (which are vocables and
> thus have also an attribute 'language') should only be 'english.
>
> In the editor a Popup appears when I want to add translations. Can I
> somehow modify that, that there only appears whose vocables which are
> actually allowed to be selected?
Are you asking the same question as the one Custominzing Pull-down
properties 3 threads above this one?
>
> Of could you tell me how I can basically check a value befor it is
> applied to translations?
> If there would be a separate set- or add-method of my
> translation-attribute I might be able to do something, but since there
> is no such thing I am kinda confused how I can influence that part.
I'm actually not quite sure what you are asking. Maybe when a new child
is created you want the attribute already to be set? You could do that
by modifying the instance created in collectNewChildDescriptors.
>
>
> Hope you can help me out.
The design seems a little odd, because it allow infinite recursion. I
wonder if that's okay...
>
> draGy


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Constrain which values an attribute is allowed to get [message #417349 is a reply to message #417346] Wed, 05 March 2008 20:46 Go to previous message
Eclipse UserFriend
Originally posted by: muba_u.web.de

Yeah I just saw, that the "Customizing Pulldown-property" might be quite
the same as my question, so I will take the answeres on that one to
figure mine out.

And well, yeah you basically could have an infinite recursion, but its
not like that there will ever be an iteration like: go to one vocable
and then to its translations.

And its just an example anyway. Won't be a application or anything, but
just an example I thought of for using EMF on my paper.
Previous Topic:The package .. has the same namespace URI .. as package ..
Next Topic:initializing EMap
Goto Forum:
  


Current Time: Fri Apr 26 17:26:49 GMT 2024

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

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

Back to the top