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.