Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0-beta-6
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
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.
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() {
{ widget(datepicker1) widget(widget:datepicker2, timezone: "GMT-2") widget(timezone: "GMT-2", format="yy:MM-hh/dd", datepicker3) }vbox()
}