reprogrammer
reprogrammer

Reputation: 14718

How can we automatically disable an Eclipse plug-in on target platforms?

We have developed an Eclipse plug-in called CodingSpectator that collects some data about the usage of various Java development tools in Eclipse. This data helps us better understand how developers use Eclipse and how we can improve Eclipse to better suit the needs of programmers. CodingSpectator captures data from every workspace that is opened in Eclipse. Some of our users develop RCP applications or Eclipse plug-ins. Therefore, they run new instances of Eclipse from their main instance of Eclipse. However, we don't want CodingSpectator to collect data from the target platforms (new instances of Eclipse opened from within the main Eclipse). So, we instruct our users to configure their target platform to exclude CodingSpectator (See http://codingspectator.cs.illinois.edu/resources/documentation/user-guide.html#htoc6). But, configuring the target platform manually is not convenient. And, we are looking for better ways to stop capturing data from target platforms.

How can we automatically disable CodingSpectator on the target platforms of our users?

Upvotes: 3

Views: 301

Answers (3)

reprogrammer
reprogrammer

Reputation: 14718

I used Platform.inDevelopmentMode() to determine if the instance Eclipse is run from within another instance of Eclipse.

Upvotes: 2

Tonny Madsen
Tonny Madsen

Reputation: 12718

One way could be to look for the -dev application argument. This argument is always added by PDE when launching an application from within Eclipse.

Upvotes: 2

Andy Thomas
Andy Thomas

Reputation: 86381

For at least RCP applications, it's likely that a target has already been defined, for stability across a team and a release.

But for those cases where someone wants to test a plug-in using the developer's version of Eclipse, perhaps you could provide a utility to make the target.

A target can be defined by a file in a project. You could provide a utility that generates the file. All the user would have to do would be:

  1. Run your utility
  2. Refresh the project (if necessary).
  3. Open the generated target file in the Target Editor.
  4. [OPTIONAL] Modify the generated target further.
  5. Click on the "Set as Target Platform" link in the upper-left of the Target Editor.

Upvotes: 0

Related Questions