Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » How to import exported packages from an own plugin?(In any kind of project)
icon5.gif  How to import exported packages from an own plugin? [message #649083] Mon, 17 January 2011 14:59 Go to next message
Tom Brandenburg is currently offline Tom BrandenburgFriend
Messages: 58
Registered: October 2010
Location: Abstatt, Germany
Member
Hello all,

currently I want to make exported packages of my plugin available for any kind of project. Regardless if it is a simple java project or plugin project or something else.
If I have a plugin project I just make it dependent on my own plugin (with the exported package) and I can use the exported package with "import my.package;".
Once I want to do the same (import my.package) in a simple java workspace project, my only idea to make this work is to add the jar of the plugin to the build path. Otherwise I havn't found a way to do so.
So my questions are: Is this the only way to do so? and: Is my general approach of having a plugin which publishes packages appropriate for this task?

Thanks and bye
Tom Smile
Re: How to import exported packages from an own plugin? [message #649100 is a reply to message #649083] Mon, 17 January 2011 16:38 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26226
Registered: July 2009
Senior Member
Tom,

Why not make everything be plug-in projects? Such projects can still be
used to produce a jar that runs on a normal classpath. That's what we
do wtih EMF.


Tom Brandenburg wrote:
> Hello all,
>
> currently I want to make exported packages of my plugin available for
> any kind of project. Regardless if it is a simple java project or
> plugin project or something else.
> If I have a plugin project I just make it dependent on my own plugin
> (with the exported package) and I can use the exported package with
> "import my.package;".
> Once I want to do the same (import my.package) in a simple java
> workspace project, my only idea to make this work is to add the jar of
> the plugin to the build path. Otherwise I havn't found a way to do so.
> So my questions are: Is this the only way to do so? and: Is my general
> approach of having a plugin which publishes packages appropriate for
> this task?
>
> Thanks and bye
> Tom :)
Re: How to import exported packages from an own plugin? [message #649102 is a reply to message #649100] Mon, 17 January 2011 16:47 Go to previous messageGo to next message
Tom Brandenburg is currently offline Tom BrandenburgFriend
Messages: 58
Registered: October 2010
Location: Abstatt, Germany
Member
Ed Merks wrote on Mon, 17 January 2011 11:38
Tom,

Why not make everything be plug-in projects? Such projects can still be
used to produce a jar that runs on a normal classpath. That's what we
do wtih EMF.

Hi Ed,

that's surely a way to do so. And I think I already chummed up with it Smile In the end it's just an advice on how to use my plugin.

Maybe my thought just came up with a try to make everything as simple as possible. But using plugins everytime is a compromise I can live with Smile

Thanks for your answer, Ed and good bye
Tom Smile
Re: How to import exported packages from an own plugin? [message #649802 is a reply to message #649083] Thu, 20 January 2011 15:05 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 2371
Registered: July 2009
Senior Member
On 1/17/11 9:59 AM, Tom Brandenburg wrote:
> Hello all,
>
> currently I want to make exported packages of my plugin available for
> any kind of project. Regardless if it is a simple java project or plugin
> project or something else.
> If I have a plugin project I just make it dependent on my own plugin
> (with the exported package) and I can use the exported package with
> "import my.package;".
> Once I want to do the same (import my.package) in a simple java
> workspace project, my only idea to make this work is to add the jar of
> the plugin to the build path. Otherwise I havn't found a way to do so.
> So my questions are: Is this the only way to do so? and: Is my general
> approach of having a plugin which publishes packages appropriate for
> this task?

It doesn't work that way; ordinary workspace Java projects can't depend
on installed plug-ins. You can depend on plug-in code if the plugin is
loaded as a workspace project (as opposed to being installed into the
running Eclipse instance), but I don't think that's what you're talking
about.

It's possible to write a plugin that modifies workspace projects to add
things to their build path; perhaps that what you want?

Eric
Previous Topic:vet the download and intro web pages with actual new users
Next Topic:Hiding open files of non-active projects
Goto Forum:
  


Current Time: Wed Nov 26 20:34:58 GMT 2014

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

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