Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4514858
Votes 0
Synopsis keyboard access to split panes, especially hierarchical splits
Category java:classes_swing
Reported Against 1.3.1
Release Fixed 1.4.1(hopper)
State 10-Fix Delivered, Verified, bug
Priority: 4-Low
Related Bugs 4164779
Submit Date 15-OCT-2001
Description
I'm finding lots of problems with keyboard-only access to split panes:

- If I have hierarchical split panes, I cannot figure out how to get F8 to get focus to the parent splitter bar.  and I cannot figure out how to get F6 to put focus into the "aunt" (sibling of parent) pane.

- If I put focus on the splitter bar with F8, I can't figure out how to get focus back to where it had been before.

- With the mouse, the user can use those little arrows in the splitter bar to jump the splitter-bar all the way to one side, and then jump back to where the bar had been.  With the keyboard, Home and End jump the bar to one side, but there doesn't appear to be any easy way to move the bar back to where it had been.
Work Around
A lot of tabbing through the tab order.  Ugh.
---
You could also redefine F6 to suit your needs, or other bindings for quicking navigation.
Evaluation
Unfortunately it would appear that the bindings are not tuned toward nested split panes. The java look and feel bindings are defined as:

Tab, F6 - Navigates between split panes and gives focus to last element that had focus

Tab is defined in the focus spec, and splitpane doesn't change this behavior, so this defintion should be updated to refer to the focus specification on tab behavior.
Consider when you first click in a splitpane and the other component hasn't yet had focus, should f6 do nothing? Or what if you click from a different window that had focus into a splitpane, should f6 transfer focus back to that window, outside of the splitpane?
For these reasons, F6 is currently implemented to give focus to the opposite component in the splitpane that doesn't have focus. As you could imagine, this is a problem in that if you have nested split panes focus can never get out of the splitpane that currently has focus. Perhaps a better algorithm would be:

void focusNextSide() {
  if (focusInFirstComponent()) {
    transferFocusToLastComponent();
  }
  else if (hasParentSplitPane()) {
    parentSplitPane.focusNextSide();
  }
  else {
    transferFocusToFirstComponent();
  }
}

In words: Transfer focus to the bottom/right component of the splitpane. If the bottom/right Component already has focus, and the splitpane is contained within another splitpane, the parent splitpane should process the request in the same manner. If there are no more parent split panes, then transfer focus to left/top. This will not give splitpanes that only contain splitpanes focus, but that shouldn't be a problem as as long as they have a child that is focusable one of them will get focus.
I've used left/top here, but that would obviously depend upon component orientation.
This would then allow the user to hit F6 to cycle between all the components of the splitpane, much as they would a focus cycle. In essense F6 would behave like tab, except for splitpanes with components that contain other components, in which it would allow you to skip over some of these components.

F8 - Gives focus to splitter bar

This is a problem in that it doesn't indicate what should happen if the splitter bar already has focus. We should give focus to any parent splitter bars if a splitter bar already has focus so that you can resize nested split panes with the keyboard.

I'm going to email Lynn and see if these changes make sense.

 xxxxx@xxxxx  2001-10-15
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang