groovy
  1. groovy
  2. GROOVY-333

Allow for custom widget types using SwingBuilder

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0-beta-6
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      3

      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.

      1. Console.groovy
        7 kB
        Danno Ferrin
      2. GROOVY-333-patch.txt
        16 kB
        Danno Ferrin
      3. SwingBuilder.java
        25 kB
        Danno Ferrin

        Activity

        Hide
        Danno Ferrin added a comment -

        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) }

        }

        Show
        Danno Ferrin added a comment - 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) } }
        Hide
        Danno Ferrin added a comment -

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

        Show
        Danno Ferrin added a comment - I heard there are problems with my diffs, attaching the whole file
        Hide
        Guillaume Laforge added a comment -

        Could you please update your patch according to CVS HEAD ?

        Show
        Guillaume Laforge added a comment - Could you please update your patch according to CVS HEAD ?
        Hide
        Danno Ferrin added a comment -

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

        Show
        Danno Ferrin added a comment - The patch is in GROOVY-501 , updated as well. So applying that will close 328, 329, 333, and 391.
        Hide
        Guillaume Laforge added a comment -

        Fixed by GROOVY-501

        Show
        Guillaume Laforge added a comment - Fixed by GROOVY-501

          People

          • Assignee:
            Guillaume Laforge
            Reporter:
            Rapheal Kaplan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: