[
https://issues.apache.org/jira/browse/PIVOT-677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057859#comment-13057859
]
Greg Brown commented on PIVOT-677:
----------------------------------
ButtonGroup was designed to accommodate both scenarios - where all buttons have
the same parent as well as different parents. The purpose of a button group is
simply to enforce that only a single button can be selected at a time. The idea
was that any navigation would be the responsibility of the buttons' containers.
By defining two sequences of buttons (RadioButtonGroup as well as the parent
container), we create a situation where traversal order could get out of sync
(if I define the buttons in one order in the RadioButtonGroup but another order
in the container). I understand that it isn't likely, but could generate
confusion. It also requires the caller to explicitly define the sequence twice
- once in the container and once in the group.
So what I'm saying is that I don't personally think extending ButtonGroup is
the right solution to this problem. FWIW, in the case where the buttons do not
share a parent, they will most likely share some common ancestor - the key
listener could perhaps be attached to that container instead.
> Add ability to navigate a ButtonGroup of RadioButtons using the keyboard
> ------------------------------------------------------------------------
>
> Key: PIVOT-677
> URL: https://issues.apache.org/jira/browse/PIVOT-677
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Environment: n/a
> Reporter: Chris Bartlett
> Assignee: Chris Bartlett
> Priority: Minor
> Fix For: 2.1
>
>
> LEFT or UP arrows would select the previous enabled button in the group.
> RIGHT or DOWN arrows would select the next enabled button in the group.
> Optionally, HOME & END would select the first or last enabled button in
> respectively.
> This functionality could be added to the existing
> org.apache.pivot.wtk.ButtonGroup class, or a new class named RadioButtonGroup
> could be created.
> The ButtonGroup would track the order that the buttons were added and use it
> to select the appropriate button.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira