Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » More Path Issues
More Path Issues [message #453419] Sat, 29 July 2006 16:38 Go to next message
J. Michael Dean, M.D. is currently offline J. Michael Dean, M.D.Friend
Messages: 218
Registered: July 2009
Senior Member
I earlier asked questions concerning reading a text file from an RCP and
received several helpful replies that did not work. However, I stopped
trying to put this text file in any specific location, added it to the
binary build, and postponed the problem.

When I execute the program as a product from inside Eclipse, but not
exporting it as a separate application, I can load the text file
successfully from the plugin start() routine.

When I export the application and try this, the file is not loaded.

I added another place in the application where I can try again to load the
file, from a menu driven action. This works.

My conclusion is that at the time the start() routine of the main bundle is
called, the paths don't yet exist, when I have an RCP that has been exported
cmpletely. But when running from inside the Eclipse environment, apparently
this path does exist.

Two questions: One, am I nuts? Two, if I have reconstructed this
correctly, when is the right point to make the file load? That is, when
does the bundle start() get called relative to other parts of the RCP
startup?

Thanks.
Re: More Path Issues [message #453420 is a reply to message #453419] Sat, 29 July 2006 19:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dittmar.steiner.web.de

J Michael Dean schrieb:
> I earlier asked questions concerning reading a text file from an RCP and
> received several helpful replies that did not work. However, I stopped
> trying to put this text file in any specific location, added it to the
> binary build, and postponed the problem.
>
> When I execute the program as a product from inside Eclipse, but not
> exporting it as a separate application, I can load the text file
> successfully from the plugin start() routine.
>
> When I export the application and try this, the file is not loaded.
>
> I added another place in the application where I can try again to load the
> file, from a menu driven action. This works.
>
> My conclusion is that at the time the start() routine of the main bundle is
> called, the paths don't yet exist, when I have an RCP that has been exported
> cmpletely. But when running from inside the Eclipse environment, apparently
> this path does exist.
>
> Two questions: One, am I nuts? Two, if I have reconstructed this
> correctly, when is the right point to make the file load? That is, when
> does the bundle start() get called relative to other parts of the RCP
> startup?
>
> Thanks.
>
Hi Michael,

One, i don't know ;-)

Two, hard to say.
Please sent some code snippets next time.

If you store/load files within your plugin's scope (which is generally a good idea) then try this:
// Activatior.start()/stop():
ConfigurationScope configurationScope = new ConfigurationScope();
File directory= configurationScope.getLocation().toFile();
// do sth. with the directory

The ConfigurationScope works privately for the actual Plugin. Also usable within View/Editors or where ever you want.
The classes plugin membership will decide.

At last a hint:
You can open the "Debug..."/"Run..." Dialog (the little arrow right in the button).
There you can modify your start options like "Main/Clear workspace data before launching" and
"Configuration/Clear configuration area before launching"

sincerly
Dittmar

--
Quidquid latine dictum sit, altum sonatur.
- Whatever is said in Latin sounds profound.
Re: More Path Issues [message #453421 is a reply to message #453420] Sat, 29 July 2006 23:15 Go to previous message
J. Michael Dean, M.D. is currently offline J. Michael Dean, M.D.Friend
Messages: 218
Registered: July 2009
Senior Member
Thanks. I moved the routine into the postStartup procedure and everything
works. But your code snippet may be helpful. Thank you again.

- Mike


On 7/29/06 1:35 PM, in article eagdad$1gq$1@utils.eclipse.org, "Dittmar
Steiner" <dittmar.steiner@web.de> wrote:

> J Michael Dean schrieb:
>> I earlier asked questions concerning reading a text file from an RCP and
>> received several helpful replies that did not work. However, I stopped
>> trying to put this text file in any specific location, added it to the
>> binary build, and postponed the problem.
>>
>> When I execute the program as a product from inside Eclipse, but not
>> exporting it as a separate application, I can load the text file
>> successfully from the plugin start() routine.
>>
>> When I export the application and try this, the file is not loaded.
>>
>> I added another place in the application where I can try again to load the
>> file, from a menu driven action. This works.
>>
>> My conclusion is that at the time the start() routine of the main bundle is
>> called, the paths don't yet exist, when I have an RCP that has been exported
>> cmpletely. But when running from inside the Eclipse environment, apparently
>> this path does exist.
>>
>> Two questions: One, am I nuts? Two, if I have reconstructed this
>> correctly, when is the right point to make the file load? That is, when
>> does the bundle start() get called relative to other parts of the RCP
>> startup?
>>
>> Thanks.
>>
> Hi Michael,
>
> One, i don't know ;-)
>
> Two, hard to say.
> Please sent some code snippets next time.
>
> If you store/load files within your plugin's scope (which is generally a good
> idea) then try this:
> // Activatior.start()/stop():
> ConfigurationScope configurationScope = new ConfigurationScope();
> File directory= configurationScope.getLocation().toFile();
> // do sth. with the directory
>
> The ConfigurationScope works privately for the actual Plugin. Also usable
> within View/Editors or where ever you want.
> The classes plugin membership will decide.
>
> At last a hint:
> You can open the "Debug..."/"Run..." Dialog (the little arrow right in the
> button).
> There you can modify your start options like "Main/Clear workspace data before
> launching" and
> "Configuration/Clear configuration area before launching"
>
> sincerly
> Dittmar
Previous Topic:language packs MacOS X 3.2
Next Topic:Activator - What is it?
Goto Forum:
  


Current Time: Sat Nov 09 17:53:50 GMT 2024

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

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

Back to the top