Skip to main content


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 08:49 Go to next message
Ashish Rawat is currently offline Ashish RawatFriend
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 07:32 Go to previous message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
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: Thu Apr 25 10:47:18 GMT 2024

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

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

Back to the top