Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Fragments and RAP projects
Fragments and RAP projects [message #498326] Mon, 16 November 2009 13:46 Go to next message
Charlie Kelly is currently offline Charlie KellyFriend
Messages: 276
Registered: July 2009
Senior Member
(This question does not apply only to RAP projects.)

I'm following the RAP examples using fragments.

I've used the PDE wizard to create a fragment project,
and listed its host project.

However, the host project generates compile errors (xxx cannot be
resolved to a type) when it references the classes from the fragment
project. Similar errors are reported for import statements.

Does the host project need to be modified to find classes from the
fragemnt? If yes, how?

If not, I will appreciate suggestions on how to solve the problem.

Thanks

Charlie
Re: Fragments and RAP projects [message #498329 is a reply to message #498326] Mon, 16 November 2009 13:58 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 338
Registered: July 2009
Senior Member
Hi,

the intention of a fragment is not to expand the classpath of the host
bundle. Means: you're not allowed to call from the host to the fragment,
only the other way around. Take a look at the single sourcing webinar or
the guide. There we explain how you can use fragments + a delegate
pattern to single source your applications.

Regards,
Ben

Charlie Kelly wrote:
> (This question does not apply only to RAP projects.)
>
> I'm following the RAP examples using fragments.
>
> I've used the PDE wizard to create a fragment project,
> and listed its host project.
>
> However, the host project generates compile errors (xxx cannot be
> resolved to a type) when it references the classes from the fragment
> project. Similar errors are reported for import statements.
>
> Does the host project need to be modified to find classes from the
> fragemnt? If yes, how?
>
> If not, I will appreciate suggestions on how to solve the problem.
>
> Thanks
>
> Charlie


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Re: Fragments and RAP projects [message #498356 is a reply to message #498329] Mon, 16 November 2009 15:08 Go to previous messageGo to next message
Jochen Krause is currently offline Jochen KrauseFriend
Messages: 4
Registered: July 2009
Junior Member
There is a way to "extend" the API of the host bundle. It is not OSGi standard compliant and should only be used in special cases.

MANIFEST.MF parameter:
Eclipse-ExtensibleAPI: true

E.g. SWT (and RWT) are providing this capability.

The best practice is using an interface or abstract class in the host bundle as described in the RAP single sourcing webinar.

Jochen
http://eclipsesource.com/
Re: Fragments and RAP projects [message #498375 is a reply to message #498356] Mon, 16 November 2009 16:34 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 338
Registered: July 2009
Senior Member
Yes but this only allows you to extend the API from the host. But I
think Charlie is trying to "access" fragment classes from the host
bundle itself. This only works trough reflection as a host bundle
doesn't know anything about it's fragments (that's also the way we
describe in the webinar/single sourcing guide).

Regards,
Ben

Jochen Krause wrote:
> There is a way to "extend" the API of the host bundle. It is not OSGi
> standard compliant and should only be used in special cases.
>
> MANIFEST.MF parameter:
> Eclipse-ExtensibleAPI: true
>
> E.g. SWT (and RWT) are providing this capability.
>
> The best practice is using an interface or abstract class in the host
> bundle as described in the RAP single sourcing webinar.
>
> Jochen
> http://eclipsesource.com/


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Re: Fragments and RAP projects [message #498382 is a reply to message #498375] Mon, 16 November 2009 17:01 Go to previous message
Jochen Krause is currently offline Jochen KrauseFriend
Messages: 4
Registered: July 2009
Junior Member
You are right, you can't access the fragment code from within the host bundle with extensible api.
Previous Topic:ClassFormatError on RAP 1.3 M3
Next Topic:RAP 1.3 M3
Goto Forum:
  


Current Time: Thu Apr 25 15:18:32 GMT 2024

Powered by FUDForum. Page generated in 0.02911 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top