Home » Eclipse Projects » Remote Application Platform (RAP) » Using Drawable interface for class binary compability
|Re: Using Drawable interface for class binary compability [message #120384 is a reply to message #120327]
||Wed, 04 February 2009 05:17
Originally posted by: evolanakis.innoopract.com|
maybe I'm misunderstanding what you try to do, but...
RWT (i.e. RAP) offers compile-time compatibility with SWT, _not_ runtime
compatibility. That means you won't be able to use the same class files
for both RCP and RAP, if those classes have dependencies to UI (SWT,
Of course if you are talking about core classes (i.e. datamodels) you
should be able to use those in any setting regardless of the UI technology.
Hope this helps,
Enrico Zanaga wrote:
> I've a project with sources written for both RCP and RAP, but comparing
> the generated .class files I've found some differences.
> I've created a dummy GC class for RAP with empty methods, and in .class
> files for RCP there's a reference to java/lang/Drawable, while in .class
> files for RAP there's a reference to java/lang/Resource.
> I wish to use the same compiled .class files in RCP and RAP.
> Is it possible to create an empty org.eclipse.swt.graphics.Drawable
> interface in RAP libraries and let Control, Device, and Image classes
> implements the Drawable interface (like in SWT)?
|Re: Using Drawable interface for class binary compability [message #120449 is a reply to message #120437]
||Wed, 04 February 2009 16:28
| Enrico Zanaga
Registered: July 2009
Hi Stefan, Elias, and Benny,|
I'm having trouble using GC. I know that GC doesn't exists in RWT, but
I've created a my own GC class.
The difference was that SWT GC class has the constructor GC(Drawable),
while my GC class has 3 constructors: GC(Control), GC(Image),
GC(Device), because Control, Image, and Device don't implement Drawable.
This situation makes .class binary files to differ from RWT and SWT
version of my jars.
I resolved wrapping the SWT GC class and my GC class to another class
called CompabilityGC zipped in 2 compability jar, one for SWT and one
So I can use the same compiled .class files for SWT and RWT, except for
a little compability jar file.
Thanks to all for the attention,
firstname.lastname@example.org ha scritto:
>>> Regarding the class file compatibility - I see your point but
>>> I would not recommend to reuse the same .class files for both platforms
>>> as this can lead to several runtime problems due to missing API.
> Mhmm - we are doing exactly that and actually expected RWT to be binary
> compatible (as far as supported API is concerned).
> We compile against swt.jars once - and at runtime we switch to rwt.jar or
> swt.jar as needed by the deployment.
> This worked without problems so far - of course all incompatibilities
> where abstracted with the common single-sourcing techniques, so of course
> we have a little extra jar compiled against rwt.
> But 95% of the code are compiled against swt.jar.
> I'm wondering, why Enrico gets problems with the Drawable-Interface.
> We use Control, Image and Device as well (but never reference them via the
> Drawable-Interface, because that wouldn't make sense).
> Enrico, could you post a small snippet which causes you trouble ?
Current Time: Wed Jan 26 09:26:32 GMT 2022
Powered by FUDForum
. Page generated in 0.02005 seconds