[
https://issues.apache.org/jira/browse/PIVOT-677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057840#comment-13057840
]
Chris Bartlett commented on PIVOT-677:
--------------------------------------
I'd like to clarify too. The keyboard 'navigation' as I have referred to it
will both select *and* focus a button, not *just* transfer focus while awaiting
selection via a mouse click or SPACE key press. Focus can still be transferred
with the TAB or SHIFT+TAB keys as usual (when the
'intraGroupFocusTransferEnabled' property is set).
This solution delegates to Component#transferFocus(FocusTraversalDirection)
when the 'intraGroupFocusTransferEnabled' property is false. It is used to
determine how focus should be transferred away from the group, treating the
group as a single entity for focusability via the TAB/SHIFT+TAB key presses.
Maintaining a single List of Buttons is not much of a chore, and serves to keep
all the logic in one place. I did consider changing ButtonGroup's internal
collection to a List (enforcing uniqueness) from a Group so that
RadioButtonGroup could reuse it too. However the few LOC that might be saved
didn't seem to warrant it, and it didn't smell right!
The 'Container 1' to 'Container 6' scenario (from the previously mentioned demo
app) uses a RadioButtonGroup to allow RadioButtons to behave as a group (with
keyboard navigation) even each buttons is in a different container. I can't
see how Component#transferFocus would help in this case, but I don't think you
were considering such a scenario.
> 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