7 messages in org.codehaus.groovy.userRe: [groovy-user] ordered bean proper...
FromSent OnAttachments
David Durham, Jr.Oct 8, 2008 1:27 pm 
Guillaume LaforgeOct 8, 2008 1:39 pm 
Guillaume LaforgeOct 8, 2008 2:09 pm 
David Durham, Jr.Oct 8, 2008 4:32 pm 
Jose NohedaOct 9, 2008 12:16 am 
David Durham, Jr.Oct 9, 2008 7:38 am 
Guillaume LaforgeOct 9, 2008 7:42 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [groovy-user] ordered bean propertiesActions...
From:Jose Noheda (jose@gmail.com)
Date:Oct 9, 2008 12:16:37 am
List:org.codehaus.groovy.user

Probably annotating them would be easier

On Thu, Oct 9, 2008 at 1:32 AM, David Durham, Jr. <davi@gmail.com

wrote:

On Wed, Oct 8, 2008 at 3:39 PM, Guillaume Laforge <glaf@gmail.com> wrote:

There are ways to get the list of properties, for instance with Customer.metaClass.properties, but it's not necessarily in order. Then, there may be a way to visit the AST to visit the properties in order, but it's a bit more complicated, and you need to have the source code of your classes available. Out of curiosity, what do you need to find properties with their order?

I'm just tinkering around with SwingBuilder and creating forms from a Model and I'd like it to display fields in the order I declare them. Maybe we could get something like "orderProperties" to go along with the "properties" magic in Groovy, or just order them by default. I understand that java.lang.Class does not return fields in any particular order.