-
Bug
-
Resolution: Fixed
-
P4
-
1.1.4
-
1.2beta4
-
generic
-
generic
The gestures for focus traversal are platform specific (TAB and Shift-TAB in
Windows and Motif environments but different in other windowing systems).
java.awt.Window hardcodes TAB and Shift-TAB to implement focus traversal which
means that other Windowing environments need to change the shared code for
their native scheme. This is not desirable as the shared code should be portable.
The problem in Window.java is the postProcessKeyEvent method which calls
handleTabEvent prior to consuming the event. Instead of calling handleTabEvent
it should instead call a peer class which decides if a focus traversal has
been requested -- eg: the peer code for Win32 should check for TAB and
shift-TAB.
This issue has been uncovered as part of the JAE port to the Psion EPOC32
environment (palm top computer). The native windowing system in this
environment is called EIKON and the use of the TAB key conflicits with the
native environment.
The following extract from src/share/java/java/awt/Window.java demonstrates
the problem :-
/* Handle TAB and Shift-TAB events. */
private boolean handleTabEvent(KeyEvent e) {
if (e.getKeyCode() != '\t' || (e.getSource() instanceof TextArea)) {
return false;
}
if ((e.getModifiers() & ~InputEvent.SHIFT_MASK) > 0) {
return false;
}
int id = e.getID();
if (id == KeyEvent.KEY_RELEASED || id == KeyEvent.KEY_TYPED) {
return true;
}
if (e.isShiftDown()) {
return focusMgr.focusPrevious();
} else {
return focusMgr.focusNext();
}
}
void postProcessKeyEvent(KeyEvent e) {
if (handleTabEvent(e)) {
e.consume();
return;
}
}
Windows and Motif environments but different in other windowing systems).
java.awt.Window hardcodes TAB and Shift-TAB to implement focus traversal which
means that other Windowing environments need to change the shared code for
their native scheme. This is not desirable as the shared code should be portable.
The problem in Window.java is the postProcessKeyEvent method which calls
handleTabEvent prior to consuming the event. Instead of calling handleTabEvent
it should instead call a peer class which decides if a focus traversal has
been requested -- eg: the peer code for Win32 should check for TAB and
shift-TAB.
This issue has been uncovered as part of the JAE port to the Psion EPOC32
environment (palm top computer). The native windowing system in this
environment is called EIKON and the use of the TAB key conflicits with the
native environment.
The following extract from src/share/java/java/awt/Window.java demonstrates
the problem :-
/* Handle TAB and Shift-TAB events. */
private boolean handleTabEvent(KeyEvent e) {
if (e.getKeyCode() != '\t' || (e.getSource() instanceof TextArea)) {
return false;
}
if ((e.getModifiers() & ~InputEvent.SHIFT_MASK) > 0) {
return false;
}
int id = e.getID();
if (id == KeyEvent.KEY_RELEASED || id == KeyEvent.KEY_TYPED) {
return true;
}
if (e.isShiftDown()) {
return focusMgr.focusPrevious();
} else {
return focusMgr.focusNext();
}
}
void postProcessKeyEvent(KeyEvent e) {
if (handleTabEvent(e)) {
e.consume();
return;
}
}