Handle to Workspace from a Java Application [message #276609] |
Fri, 26 November 2004 11:01 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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??
>
|
|
|
Powered by
FUDForum. Page generated in 0.03510 seconds