|
Re: How to set an attribute value to the value of another attribute in the EMF editor? [message #417043 is a reply to message #417040] |
Sun, 24 February 2008 13:11 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------070208080009010001020401
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Reinhold,
That happens because getLiteral is hand implemented as follows such that
if there is no explicitly set literal, the name is used as the literal.
| /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
*public *String getLiteralGen()
{
*return *literal;
}
*public *String getLiteral()
{
String result = getLiteralGen();
*return *result == *null *? getName() : result;
}|
Reinhold Bihler wrote:
> Hello,
>
> if I set the value of the name attribute of an EEnumLiteral in the
> Sample Ecore Model Editor the value of the literal attribute is
> automatically set accordingly.
>
> How is this done? Can this behavior be set somewhere in the
> Gen Model or is it done by extending the editor code?
>
> Thanks,
>
> Reinhold
>
>
--------------070208080009010001020401
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Reinhold,<br>
<br>
That happens because getLiteral is hand implemented as follows such
that if there is no explicitly set literal, the name is used as the
literal.<br>
<blockquote>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = --><!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td align="left" nowrap="nowrap"
valign="top"> <code><font color="#ffffff"> </font><font
color="#3f5fbf">/**</font><br>
<font color="#ffffff"> </font><font color="#3f5fbf">* </font><font
color="#7f7f9f"><!-- begin-user-doc --> </font><br>
<font color="#ffffff"> </font><font color="#3f5fbf">* </font><font
color="#7f7f9f"><!-- end-user-doc --> </font><br>
<font color="#ffffff"> </font><font color="#3f5fbf">* @generated</font><br>
<font color="#ffffff"> </font><font color="#3f5fbf">*/</font><br>
<font color="#ffffff"> </font><font color="#7f0055"><b>public </b></font><font
color="#000000">String getLiteralGen</font><font color="#000000">()</font><br>
<font color="#ffffff"> </font><font color="#000000">{</font><br>
<font color="#ffffff"> </font ><font color="#7f0055"><b>return </b></font><font
color="#000000">literal;</font><br>
<font color="#ffffff"> </font><font color="#000000">}</font><br>
<br>
<font color="#ffffff"> </font><font color="#7f0055"><b>public </b></font><font
color="#000000">String getLiteral</font><font color="#000000">()</font><br>
<font color="#ffffff"> </font><font color="#000000">{</font><br>
<font color="#ffffff"> </font ><font color="#000000">String result = getLiteralGen </font><font
color="#000000">()</font><font color="#000000">;</font><br>
<font color="#ffffff"> </font ><font color="#7f0055"><b>return </b></font><font
color="#000000">result == </font><font color="#7f0055"><b>null </b></font><font
color="#000000">? getName</font><font color="#000000">() </font><font
color="#000000">: result;</font><br>
<font color="#ffffff"> </font><font color="#000000">}</font></code>
</td>
<!-- end source code --> </tr>
</tbody>
</table>
</div>
<!-- = END of automatically generated HTML code = -->
<!-- ======================================================== --></blockquote>
<br>
Reinhold Bihler wrote:
<blockquote cite="mid:fprn74$8ei$1@build.eclipse.org" type="cite">
<pre wrap="">Hello,
if I set the value of the name attribute of an EEnumLiteral in the
Sample Ecore Model Editor the value of the literal attribute is
automatically set accordingly.
How is this done? Can this behavior be set somewhere in the
Gen Model or is it done by extending the editor code?
Thanks,
Reinhold
</pre>
</blockquote>
<br>
</body>
</html>
--------------070208080009010001020401--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02945 seconds