[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[albireo-dev] More focus related fixes and some cleanup
|
I've fixed two more focus related issues.
1) The embedded frame and the JApplet use the default AWT focus
traversal policy. To my surprise I discovered that this default can
change from LayoutFocusTraversalPolicy (set by the Windows L&F) to
LegacyGlueFocusTraversalPolicy if javax.swing.FocusManager.getManager()
is called. To my greater surprise I found that this swing method is
called by the Eclipse runtime itself (see reflection in
org.eclipse.ui.internal.handlers.WidgetMethodHandler). The legacy focus
traversal policy does not work well in our environment and leads to
stack overflow errors when a swing component is focused. So, to avoid
the problem I force the focus traversal policy (on both the frame and
the JApplet) to LayoutFocusTraversalPolicy. Windows only. I don't know
if the problem exists on other platforms.
2) If an app tries to set focus on a SwingControl, and the embedded
Swing control is not focusable, the SwingControl should refuse the focus.
I also did a little cleanup. I removed the SwingControl.checkPopulated
method since it is no longer necessary. I added checkWidget() calls to
all public API in SwingControl except for the accessors for the frame
and swingComponent.