|
|
|
Re: Features sorted in Ecore [message #419890 is a reply to message #419889] |
Wed, 11 June 2008 11:57 |
Ed Merks Messages: 33139 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------080907040206090304050602
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Waqas,
Yes, it's a very reasonable feature request, especially considering that
it is effectively just some UI for existing capabilities.
Waqas Ilyas wrote:
> Hi Ed,
>
> It would be nice to have that option in the UI too. Should I add a
> feature request for this if it is feasible?
>
> Waqas
>
> "Ed Merks" <merks@ca.ibm.com <mailto:merks@ca.ibm.com>> wrote in
> message news:g2lrtg$8gr$1@build.eclipse.org...
> Waqas,
>
> XSDEcoreBuilder has support for it:
>
> protected boolean useSortedAttributes()
> {
> return true;
> }
>
> protected List<XSDAttributeUse>
> getAttributeUses(XSDComplexTypeDefinition
> xsdComplexTypeDefinition)
> {
> if (useSortedAttributes())
> {
> return xsdComplexTypeDefinition.getAttributeUses();
> }
> else
> {
> List<XSDAttributeUse> result = new
> ArrayList<XSDAttributeUse>(xsdComplexTypeDefinition.getAttributeUses());
> reorderAttributeUses(result,
> xsdComplexTypeDefinition.getAttributeContents());
> return result;
> }
> }
>
> But there's no support for setting the option in the UI
>
>
> Waqas Ilyas wrote:
>> Hi,
>>
>> When generating from a schema the features (types and elements) are sorted
>> alphabetically in the Ecore. Is it possible to control this so that the
>> order of Classes and their attributes is the same as the order in which they
>> are defined in the schema?
>>
>> This does not really hinder any operations just that if the XML file saved
>> is to be viewed by a user then readability could be improved if more
>> commonly used or required attributes (such as 'name') appear before other
>> attributes.
>>
>> Waqas
>>
>>
>>
>
--------------080907040206090304050602
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">
Waqas,<br>
<br>
Yes, it's a very reasonable feature request, especially considering
that it is effectively just some UI for existing capabilities.<br>
<br>
<br>
Waqas Ilyas wrote:
<blockquote cite="mid:g2odsn$urc$1@build.eclipse.org" type="cite">
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta content="MSHTML 6.00.2900.3314" name="GENERATOR">
<style></style>
<div>Hi Ed,</div>
<div> </div>
<div>It would be nice to have that option in the UI too. Should I add
a feature request for this if it is feasible?</div>
<div> </div>
<div>Waqas</div>
<blockquote
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div>"Ed Merks" <<a moz-do-not-send="true"
href="mailto:merks@ca.ibm.com">merks@ca.ibm.com</a>> wrote in
message <a moz-do-not-send="true"
href="news:g2lrtg$8gr$1@build.eclipse.org">news:g2lrtg$8gr$1@build.eclipse.org</a>...</div>
Waqas,<br>
<br>
XSDEcoreBuilder has support for it:<br>
<blockquote><small> protected boolean useSortedAttributes()</small><br>
<small> {</small><br>
<small> return true;</small><br>
<small> }</small><br>
<br>
<small> protected List<XSDAttributeUse>
getAttributeUses(XSDComplexTypeDefinition xsdComplexTypeDefinition)</small><br>
<small> {</small><br>
<small> if (useSortedAttributes())</small><br>
<small> {</small><br>
<small> return xsdComplexTypeDefinition.getAttributeUses();</small><br>
<small> }</small><br>
<small> else</small><br>
<small> {</small><br>
<small> List<XSDAttributeUse> result = new
ArrayList<XSDAttributeUse>(xsdComplexTypeDefin ition.getAttributeUses()); </small><br>
<small> reorderAttributeUses(result,
xsdComplexTypeDefinition.getAttributeContents());</small><br >
<small> return result;</small><br>
<small> }</small><br>
<small> }</small><br>
</blockquote>
But there's no support for setting the option in the UI<br>
<br>
<br>
Waqas Ilyas wrote:
<blockquote cite="mid:g2lrjj$7vm$1@build.eclipse.org" type="cite">
<pre wrap="">Hi,
When generating from a schema the features (types and elements) are sorted
alphabetically in the Ecore. Is it possible to control this so that the
order of Classes and their attributes is the same as the order in which they
are defined in the schema?
This does not really hinder any operations just that if the XML file saved
is to be viewed by a user then readability could be improved if more
commonly used or required attributes (such as 'name') appear before other
attributes.
Waqas
</pre>
</blockquote>
<br>
</blockquote>
</blockquote>
<br>
</body>
</html>
--------------080907040206090304050602--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03235 seconds