Patch(revised): GLightweightPeer,Toolkit allow creation and display of lightweight components
Scott Gilbertson
scottg@mantatest.com
Tue May 13 16:13:00 GMT 2003
Tom> Honestly I don't know much about lightweight components.
Tom> It seems incorrect to bless one particular lightweight component
Tom> implementation in Toolkit. I think this should depend on the
Tom> particular Toolkit.
The key point about lightweights is that they don't do anything
themselves -- all requests are passed through to the nearest heavyweight
container (with appropriate clipping or whatever), using the methods
provided in java.awt.Container. That's why I think it's correct to have a
default LightweightPeer provided by java.awt.Toolkit, rather than
implementing createComponent in the xlib peer code. If we put it in the
specific toolkits, we'd be repeating the same code for each one.
Tom> So I think the code in your Toolkit change should go into
Tom> XToolkit.java.
In that case, why isn't createComponent abstract in java.awt.Toolkit? I
think the API originators expected to have java.awt.Toolkit return something
useful. It's not final, though, so I guess they wanted to leave open the
possibility of a specific toolkit overriding the default createComponent.
Tom> It's likely I'm missing something. If it does make sense to bless a
Tom> particular lightweight component implementation, then this should be
Tom> dealt with in Classpath first.
I've posted questions to the Classpath list in case someone who's there but
not here has an opinion.
More information about the Java-patches
mailing list