Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to detect that code is running in Development environment or in generic Eclipse using Plugins?
How to detect that code is running in Development environment or in generic Eclipse using Plugins? [message #1060719] Tue, 28 May 2013 04:49 Go to next message
Ashish Rawat is currently offline Ashish Rawat
Messages: 14
Registered: June 2012
Junior Member
Hi,

I am developing some plug-ins. The issue that I am facing is, there is some piece of code which I want to execute, if and only if the plugin is installed in Eclipse. While developing the plugin that code shall not execute.

This is the case where, I have some files which I am extracting to the project directory. Now if in development environment I run the code, the files get copied or overwritten because of that block of code. I want to block this extracting feature in development phase. But want this to be available when any user extracts or installs the plug-in in eclipse.

Do any one have idea, how I can achieve this?

I have already tried following implementations:
1. Adding flag via VM arguments. This did worked but I do not want to force every developer to add this argument in their development environment.
2. Comparing paths if it is from "jar:" or from "file:". In both the cases I find the path starting from "bundleresource:". This also didn't worked.
3. System.console(). In both the cases it returned "null".

If there is any other way to fix this issue, please help me with it.

Regards,
Ashish
Re: How to detect that code is running in Development environment or in generic Eclipse using Plugin [message #1060922 is a reply to message #1060719] Wed, 29 May 2013 03:32 Go to previous message
Christoph Keimel is currently offline Christoph Keimel
Messages: 297
Registered: December 2010
Location: Germany
Senior Member
Hi Ashish

just a thought, but maybe Platform.getInstallLocation() can help in some way ...

Greetings
Christoph
Previous Topic:Hide caret in Text widget
Next Topic:ExpandItem header height?
Goto Forum:
  


Current Time: Sun Apr 20 07:02:31 EDT 2014

Powered by FUDForum. Page generated in 0.01445 seconds