SurfMan
unread,Dec 2, 2010, 10:12:34 AM12/2/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to JavaBuilders
Hi,
I' ll start with a quick intro of what I am trying to accomplish here.
My application has the ability to download serverside information
generated by our Drupal CMS. It should be able to display dates,
labels, buttons, textfields etc. To make this generic, it soon started
to get messy: if (type.equals("date")), so I used Google to run into
this project, and decided to give this a spin. I use MigLayout
extensively in my application, and I love it. That's why I was really
excited to see the support from JavaBuilder like this.
My new idea was to generate a YAML String using PHP on the server,
send that to the component that displays the news using JavaBuilder. I
got the basics working and now I run into two MigLayout issues:
1) If I execute SwingJavaBuilder.build(this, someYamlString) multiple
times, I have the feeling that the MigLayout instance is reused. If I
remove the initial [[debug]] in my YAML String, reload my component,
i.e. execute SwingJavaBuilder.build(...) again, the debugging grid
stays. Is there a way to tell JavaBuilder *not* to reuse instances of
MigLayout?
2) I can't seen to omit the components names in the MigLayout. For
example, I have this YAML String, but it doesn't spit out my labels:
JPanel(name=mainpanel):
- JLabel(name=label1, text=Ideo Saluto)
- JLabel(name=label2, text=Pagus Letalis Aptent Os Molior Importunus
Abbas)
- JLabel(name=label3, text=Dignissim)
- MigLayout : |
[[wrap 1]]
This will tell MigLayout that after each component a new line begins.
This is the same what I often do in code:
JPanel mainpanel = new JPanel( new MigLayout("wrap 1"));
mainpanel.add(label1);
mainpanel.add(label2);
mainpanel.add(label3);
If I mention all the labels they will display:
JPanel(name=mainpanel):
- JLabel(name=label1, text=Ideo Saluto)
- JLabel(name=label2, text=Pagus Letalis Aptent Os Molior Importunus
Abbas)
- JLabel(name=label3, text=Dignissim)
- MigLayout : |
[[wrap 1]]
label1
label2
label3
Is there a way to tell the MigLayout in the YAML String to just add
all components to the end?
Thanks for the awesome stuff that you are creating. Keep up the good
work!
WarnerJan Veldhuis
The Netherlands