set a stereotype property value [message #476930] |
Wed, 13 February 2008 04:50  |
Eclipse User |
|
|
|
Hi all,
I've defined a profile with several sterotypes. I need to set a property
value of a stereotype manually in Java.
I know that it can be done with the followings lines:
namedElement.setValue(stereotype, property.getName(), value);
It's OK when I set a property with a primitive type like String.
Now I need to set a property which reference another Stereotype.
Example:
Profile myProfile
- Stereotype s1
- Stereotype s2
- Property name:String
- Property s1_reference: s1
I would like to set the "s1_reference" but I have problems with type.
Thanks for help,
|
|
|
|
|
|
Re: set a stereotype property value [message #626030 is a reply to message #476930] |
Wed, 13 February 2008 10:40  |
Eclipse User |
|
|
|
Hi Emilien,
I'm not sure what you mean by "I have problems with type". Could you
elaborate? Do you mean that you are not sure what to set as the type of
the property? or do you have an issue with setValue() not working?
Cheers,
- James.
"Emilien Perico" <emilien.perico@atosorigin.com> wrote in message
news:91254c76c8c107bdcd2b1d78cba82c7c$1@www.eclipse.org...
> Hi all,
>
> I've defined a profile with several sterotypes. I need to set a property
> value of a stereotype manually in Java.
>
> I know that it can be done with the followings lines:
> namedElement.setValue(stereotype, property.getName(), value);
>
> It's OK when I set a property with a primitive type like String.
> Now I need to set a property which reference another Stereotype.
>
> Example:
>
> Profile myProfile
> - Stereotype s1
> - Stereotype s2
> - Property name:String
> - Property s1_reference: s1
>
> I would like to set the "s1_reference" but I have problems with type.
>
> Thanks for help,
|
|
|
Re: set a stereotype property value [message #626031 is a reply to message #476931] |
Wed, 13 February 2008 11:32  |
Eclipse User |
|
|
|
Thanks for reply James,
I mean I don't succed to set the value for a referenced stereotype.
I don't know what to set as the type of the property when this one
references another stereotype.
When I get a same type, previously added from the modeller, I get a
DynamicEObjectImpl.
Do I have to build an object with the same type ? How ?
|
|
|
|
Powered by
FUDForum. Page generated in 0.10742 seconds