Uploaded image for project: 'Pivot'
  1. Pivot
  2. PIVOT-292

Create new ButtonGroup class that implements org.apache.pivot.collections.Group and Iterable<Button>

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.4
    • wtk
    • None

    Description

      Move Button.Group out into its own top-level class that implements org.apache.pivot.collections.Group. Currently, there is no way to enumerate a group's contents, and it seems like there should be (Swing's ButtonGroup class does support this).

      We'd end up with something along these lines:

      ButtonGroup : Group, Iterable<Button> {
      add(Button):void
      remove(Button):boolean

      getSelection():Button
      setSelection(Button):void
      }

      ButtonGroupListener {
      selectionChanged(previousSelection:Button):void
      }

      Button {
      ...

      getGroup():ButtonGroup
      setGroup(ButtonGroup):void
      }

      ButtonGroup#add() and remove() would call Button#setGroup(), and vice versa. Similarly, ButtonGroup#setSelection() would call Button#setSelected(), and vice versa. We'd also move the named group dictionary to ButtonGroup.

      Attachments

        Activity

          People

            gbrown Gregory K. Brown
            gbrown Gregory K. Brown
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: