Issue Details (XML | Word | Printable)

Key: GROOVY-333
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Guillaume Laforge
Reporter: Rapheal Kaplan
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy

Allow for custom widget types using SwingBuilder

Created: 26/Mar/04 11:10 PM   Updated: 14/Jul/04 05:00 PM   Resolved: 14/Jul/04 05:00 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0-beta-6

Time Tracking:
Not Specified

File Attachments: 1. File Console.groovy (7 kB)
2. Text File GROOVY-333-patch.txt (16 kB)
3. Java Source File SwingBuilder.java (25 kB)



 Description  « Hide

Currently all the possible swing component types are hard coded in to the SwingBuilder class. Abstracting out how widget types can be added to a swing model allows for users to insert their own custom GUI beans using without using the standard Java methods or having to sub-class SwingBuilder.



Danno Ferrin added a comment - 21/May/04 01:14 AM

Ok, this patch addresses GROOVY-328, GROOVY-329, GROOVY-333, GROOVY-391. I did some enhancements before I realized there was such fine grained bugs against SwingBuilder.

For this bug... a new node type widget().
Passing in just a value will instert that value literally.
Passing in just a map will take the value of widget: as the widget. All other values are set as bean properties
Passing in dictionary values, then an unlabeld item will use the unlabeld item as the value, and the rest of the dictionary will be the bean properties. Useful in the corner case of a property named widget, but you are still out of luck for a property named constraints.

datepicker1 = new BizzareDatePickerWidget()
datepicker2 = new BizzareDatePickerWidget()
datepicker3 = new BizzareDatePickerWidget()

swing.frame() {
vbox() { widget(datepicker1) widget(widget:datepicker2, timezone: "GMT-2") widget(timezone: "GMT-2", format="yy:MM-hh/dd", datepicker3) }
}


Danno Ferrin added a comment - 21/May/04 01:15 AM

I heard there are problems with my diffs, attaching the whole file


Guillaume Laforge added a comment - 14/Jul/04 03:16 PM

Could you please update your patch according to CVS HEAD ?


Danno Ferrin added a comment - 14/Jul/04 03:50 PM

The patch is in GROOVY-501, updated as well. So applying that will close 328, 329, 333, and 391.


Guillaume Laforge added a comment - 14/Jul/04 05:00 PM

Fixed by GROOVY-501