Defacto, AWT doesn't support plugin toolkits. There're quite a few hidden dependencies b/w public and private code in AWT. However, it's probably worth making a few steps towards the developers community showing interest in this question. This CR requests AWT to make some change in its private code that would allow to overcome one of the barriers on the way of plugging in a custom toolkit. Namely, AWT should consider providing a new sun.awt.KeyboardFocusManagerPeerProvider interface that would determine a KeyboardFocusManagerPeer getter for the toolkit. As it can be seen from the following code in the java.awt.KeyboardFocusManager: private void initPeer() { if (Toolkit.getDefaultToolkit() instanceof HeadlessToolkit){ peer = ((HeadlessToolkit)Toolkit.getDefaultToolkit()). createKeyboardFocusManagerPeer(this); } if (Toolkit.getDefaultToolkit() instanceof SunToolkit) { peer = ((SunToolkit)Toolkit.getDefaultToolkit()). createKeyboardFocusManagerPeer(this); } } the KFM peer entry point is strictly tied to the SunToolkit - AWT private implementation. In the Suggested Fix area there have been put a prototype of the fix allowing to break this dependency.
|