Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Handle to Workspace from a Java Application
Handle to Workspace from a Java Application [message #276609] Fri, 26 November 2004 11:01 Go to next message
Eclipse UserFriend
Originally posted by: asd.asd.com

I have created an eclipseRunner class which launches an eclipse instance
as given below..


String arr[]=new String[4];
try {
//set the command line args of eclipse
arr[0]="-data"; ;
arr[1]="D:/eclipse/workspace2";
arr[2]="-application";
arr[3]="org.eclipse.ui.workbench";
//below is org.eclipse.core.launcher.Main class
Main main=new Main();
main.run(arr);//start the execution using my arguements

Now I wish to get workspace Handle in my EclipseRunner class .
ResourcesPlugin.getWorkspace() returns null hwich I had expected.
Can anyone give me something to work on??
Re: Handle to Workspace from a Java Application [message #276686 is a reply to message #276609] Fri, 26 November 2004 18:35 Go to previous message
Eclipse UserFriend
Originally posted by: chaves.inf.no.ufsc.spam.br

Eclipse manages classloading for plug-ins. Your standalone application
can run Eclipse on the same VM, but you will need some trick to be able
to reach code in plug-in from your application. The ResourcesPlugin
class you access from your aplication is not the same available to code
running as plug-ins (that one *is* properly initialized).

So you need to devise some way for communicating with that code. You
could do it by using some shared object (ThreadLocals, for instance) or
using any inter-process communication mechanism. In either way, you
would need a plug-in running in Eclipse to the work in that side.

But honestly, why do you need to do that? Why can't you run your code as
a plug-in?

Rafael

anonymous wrote:
> I have created an eclipseRunner class which launches an eclipse instance
> as given below..
>
>
> String arr[]=new String[4];
> try {
> //set the command line args of eclipse
> arr[0]="-data"; ;
> arr[1]="D:/eclipse/workspace2";
> arr[2]="-application"; arr[3]="org.eclipse.ui.workbench";
> //below is org.eclipse.core.launcher.Main class Main main=new Main();
> main.run(arr);//start the execution using my arguements
>
> Now I wish to get workspace Handle in my EclipseRunner class .
> ResourcesPlugin.getWorkspace() returns null hwich I had expected.
> Can anyone give me something to work on??
>
Previous Topic:Class loading problem
Next Topic:GUI Designer Tutorial?
Goto Forum:
  


Current Time: Thu Jul 25 06:04:57 GMT 2024

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

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

Back to the top