|
Re: Representation of depended parameter [message #869785 is a reply to message #869554] |
Fri, 04 May 2012 09:58 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Morten,<br>
<br>
Comments below.<br>
<br>
On 03/05/2012 5:19 PM, Morten MacFly wrote:
<blockquote cite="mid:jnu7m3$394$1@xxxxxxxxe.org" type="cite">
<pre wrap="">Dear all,
let me explain my use case first:
I have two models:
- the first one conteins a list of items (EList) and each has a name (a
string).
- the second model references exactly one of these elements by its name
and adds aditional parameters
The sencond model must be independent from the first for distribution,
but the first (the "master" model) integrates the second one.
What I want for the second "stand-alone" model (Editor) is representing
the name as a string in a text box property, that's fine with the
generated code. But when used inside the "master model" (in another
Editor) I would like to have a different visual representstion (a
combo-cox) offering all available names only.
My question: How can I change the UI representation of such an element
that is of type string to be a combo-box and where I can control its
choices?</pre>
</blockquote>
In the generated property descriptor, you'll want to specialize its
getChoiceOfValues method. When that returns a non-null collection
of values, the properties view will produce a drop down with exactly
those choices. This should give you the idea:<br>
<blockquote><a
href="http://wiki.eclipse.org/index.php/EMF-FAQ#How_can_I_control_which_instances_are_available_as_choices_when_editing_a_property_in_the_properties_view.3F"><span
class="tocnumber">2.46</span> <span class="toctext">How can I
control which instances are available as choices when editing
a property in the properties view?</span></a><br>
</blockquote>
<blockquote cite="mid:jnu7m3$394$1@xxxxxxxxe.org" type="cite">
<pre wrap="">
With regards, Morten.
Ps.: I am not exactly sure if this question belongs here, please guide
me in the right diretion, if not.
</pre>
</blockquote>
</body>
</html>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Representation of depended parameter [message #870218 is a reply to message #869785] |
Mon, 07 May 2012 10:10 |
Morten MacFly Messages: 69 Registered: July 2009 |
Member |
|
|
Oh - should it really be that simple... I'll try that. I thought the UI
representation is more coupled...
Thanks Ed, if you don't hear again in this thread you made my day! :-)
On 04.05.2012 11:58, Ed Merks wrote:
> Morten,
>
> Comments below.
>
> On 03/05/2012 5:19 PM, Morten MacFly wrote:
>> Dear all,
>>
>> let me explain my use case first:
>> I have two models:
>> - the first one conteins a list of items (EList) and each has a name (a
>> string).
>> - the second model references exactly one of these elements by its name
>> and adds aditional parameters
>>
>> The sencond model must be independent from the first for distribution,
>> but the first (the "master" model) integrates the second one.
>>
>> What I want for the second "stand-alone" model (Editor) is representing
>> the name as a string in a text box property, that's fine with the
>> generated code. But when used inside the "master model" (in another
>> Editor) I would like to have a different visual representstion (a
>> combo-cox) offering all available names only.
>>
>> My question: How can I change the UI representation of such an element
>> that is of type string to be a combo-box and where I can control its
>> choices?
> In the generated property descriptor, you'll want to specialize its
> getChoiceOfValues method. When that returns a non-null collection of
> values, the properties view will produce a drop down with exactly those
> choices. This should give you the idea:
>
> 2.46 How can I control which instances are available as choices when
> editing a property in the properties view?
> <http://wiki.eclipse.org/index.php/EMF-FAQ#How_can_I_control_which_instances_are_available_as_choices_when_editing_a_property_in_the_properties_view.3F>
>
>>
>> With regards, Morten.
>>
>> Ps.: I am not exactly sure if this question belongs here, please guide
>> me in the right diretion, if not.
|
|
|
Powered by
FUDForum. Page generated in 0.02881 seconds