To modify a core eclipse plugin - eclipse

In order to modify an eclipse plugin, what are the steps to find its editable code ?
I read and debug source provided with eclipse distribution but to try a fix in org.eclipse.jdt.internal.corext.codemanipulation behavior I need to make it editable.

Well, the source repository is available at eclipse.org, the plugin compiled with the source should be available from the standard eclipse update site.
I'm guessing you are considering changing the source, recompiling and using your plugin instead of the standard one? There is a different way to change functionality, its with fragments. For example, look at a question I asked earlier, follow the links in my text and Andrews answer for more information.

Related

How can I customise the Selenium IDE export?

Within Selenium IDE for Firefox, under Options -> C# / NUnit / Webdriver, there is a button 'Source' to view the conversion formatter.
It is displayed in read-only format.
Is it possible to get access to this file in order to customise the export process?
Sorry if this seems like a trivial question, I've found plenty of people complaining about not being able to perform various tasks online and a few responses that indicate that custom export is supported, but I can't seem to find a way to access the file to perform the work.
Thanks
I think I found a solution to this problem.
Though you can't customize any of the built in exports, like C# / NUnit / Webdriver, you can create a completely new exporter. I'd recommend modifying an excising one.
Get the source exporter you would like to modify. Ex Options->Options->Formats->C#/NUnit/Webdriver->Source. And copy it to a text editor.
Edit this code.
Options->Options->Formats->Add(button) and paste your new exporter.
I think you have to copy and paste the text, there is not file upload.
This worked for Selenium IDE 2.5.0
Hope this helps!
EDIT: In addition to my answer above, it may be easier to just write your own parser for the Source of your IDE Test.
The source is read-only because it has been provided by a Selenium IDE Plugin.
The source is usually helpful if you want to make a very simple formatter. Usually a better way is to create your own customised version of the formatter and package it in a plugin. Take a look at the source itself and the plugin tutorial at http://docs.seleniumhq.org/projects/ide/plugins.jsp
You can find some more information and slides about Selenium IDE plugins on my blog.
Cheers,
Samit Badle
Selenium IDE Maintainer. Twitter: #samitbadle
Blog: http://blog.reallysimplethoughts.com/

Extend or configure Eclipse compare files functionality

Eclipse has built in functionality for comparing files, but how can I configure that functionality? Say I create a new file type and want an external program do perform the diff. How do I set that up?
Can I create an Eclipse plugin to add my own plugin for handling file comparisons? Or perhaps that is the answer to the first question...
You may want to look at the EMF Compare Project which helps build compare editors for EMF models. If you don't have an EMF model for your file type, you can either create one or look through the source code of EMF Compare to see how it works.
The developer guide explains how to use the code to write your custom viewers.
There is a plugin integrating Beyond Compare into Eclipse. As it is open source, you might get a clue by looking at its sources.

Can I write Eclipse plugins using Groovy?

Groovy seems to fix a lot of the things I dislike about Java, and I was wondering if it would be possible to actually write an Eclipse plugin in Groovy instead of Java.
Does anyone know if this is possible, and if so how to go about it?
I've just found a blog entry which says it's not officially supported but is actually possible.
Not yet tested to see if it works, but it seems promising:
Writing Eclipse plugins with Groovy, by Jörn Dinkla
#Peter, I do not think that the blog post you linked to is complete or if it will really work. It is pointing to the old version of Groovy-Eclipse, which is no longer supported and is out of date.
Yes. It is possible to create your own plugins in Groovy.
First, install the Groovy-Eclipse plugin from here:
http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.7/
Then you can create a new plugin project and add the Groovy Nature.
Remove the Groovy Libraries classpath container
Instead, add the org.codehause.groovy as a required bundle
Create your Groovy code as normal
Now, the tricky part is exporting the plugin using PDE. See this blog post for how to do that: http://contraptionsforprogramming.blogspot.com/2010/08/groovy-pde-redux.html
One important thing to note is that you will need at least one Java file in your project for PDE to compile anything, It can be a dummy, empty file (this is a bug that has not yet been fixed).
Rejoice!
As an example, here is the codenarc Eclipse plugin that was written completely in Groovy:
http://sourceforge.net/projects/codenarceclipse/
You can also use JRuby, or Javascript ...
JAM Circle is a great example showing how to make great use of a scripting language in an Eclipse plugin, by allowing the end user to write his own actions and load them at runtime.
There's a proxy-like plugin that allows you to implement the plugin virtually in any language that supports JSR223 (javax.scripting)

How do I get support for GPB in Eclipse?

I'm trying to use Google Protocol Buffers in my project and I'd like to have some tooling support from Eclipse. In particular, I want Eclipse to call protoc every time I make changes to the .proto files and then rebuild all code that depends on the generated code.
I tried to set up a Custom Builder but it keeps bugging me with errors I don't understand, most often it complains that the .proto file is not on the path given by --proto-path, which it should be by all I can tell. Also, because I use ${build_files}, Eclipse passes all changed files to the compiler (instead of those that I have configured to trigger the build).
NetBeans seems to have a protobuf-Plugin, but I can't find one for Eclipse. Is there one?
Theres a protoclipse plugin on googlecode, which is in the initial stages:
http://code.google.com/p/protoclipse/
Not sure if there is a builder, but I did find a plugin for syntax highlighting for protocol buffers.
You can define an external builder on the plugin that invokes an ant task. It is an ugly kludge, but until there is a better solution this may serve your purposes.
In practice, syntax highlighting turned out to not be that important, I hardly edit these files, and they tend to be very small. Maven and the m2eclipse plugin handle the building side of things great.
I recommend using Google's "Protocol Buffers Development Tools". It is a plugin for Eclipse that features automagic regeneration and error checking, among other things. It's available here: http://code.google.com/p/protobuf-dt/ .
While this question is close to other Eclipse plugin for working with protobuf, answers here are different.
Well, yes, if you use maven/gradle to invoke protoc (Protobuf compiler), than you may need no Eclipse plugin at all.
Colorizing editor helps for long file or with many comments. Know there are 2 editor plugins for Eclipse.

Problem with update site categories in Eclipse 3.4

I am using Eclipse 3.4 (ganymede official, not the service pack).
I have an update site that organizes features into categories; everything looks great in the editor and in the XML.
Once the site is online, accessing it in the usual manner tells me that all the features are "uncategorized". I've tried from multiple computers running 3.4 and the same problem persists.
What is curious is that I used Eclipse 3.3, and it saw the categories well, though of course it wasn't able to instlal the plugins which are made from 3.4.
Am I doing something wrong or is this a known problem?
It appears to be a known problem, due to the new 'p2' provisioning system.
See this discussion, and this bug. What it seems to say is... "stay put until 3.5M3, and then try it again".
This solution works for me:
Use the PDE update site project to create the site.xml and build your plugins. Make sure you set the category here.
Delete the artifacts.xml and content.xml created by the update site build.
Use the P2 Metadata Generator to generate your artifacts and content files. I use the compress option so I'm getting jars.
The update site should include: the site.xml, content & artifacts jars, features and plugins folders.
If you follow this procedure, it will work just fine in Eclipse 3.3 and 3.4. Naturally, you should automate this process with Ant.
Important notes:
I never got the metadata generator Ant task to work, so I invoke it in its' Java form (the second example in the link above).
Make sure you clear the artifacts and content xmls before the generation
Inputs: site.xml and built plugins/features folders
Specify the metadataRepositoryName which is the update site title (shown to the user in some cases)
I'll do my best to blog about it soon...
Let me know if you have any questions.
What seems to work for me is to put the tag, defining the category in the site.xml, before the tag including the other category tag. If you add the category with eclipse's editor after adding the feature, it'll have messed that up...
A no-brainer for most..but it can be a problem for newbies on Eclipse update sites: be sure to add your feauture as a child under the category:
See http://ekkescorner.wordpress.com/2010/04/18/who-eats-the-categories-from-update-sites/