rockstar
rockstar

Reputation: 3538

Loading a eclipse pluggin from jar files

I am trying to run a sample plugin

The extracted zip comprises of 2 jar files . So i loaded them into the eclipse by using the New->PluginDevelopment->Plugin form existing jar files wizard .

This loads the plugin but it does not run as expected . Comparing it with a sample Hello world plugin i realize that it does not have a Activator.java file and a SampleAction.java file within the src folder .

How do i get this plugin to work ? Surely there must be a way . enter image description here

Upvotes: 0

Views: 112

Answers (1)

Tom Blodget
Tom Blodget

Reputation: 20772

That example is very old and so is difficult to get going in modern eclipse. It still is a good introduction to writing debugger plugins but after you get the gist of the article, I advise looking at the current source code for any debuggers that you might be familiar with using.

You should note that there are two plugins. Keep them separate. I found it useful to extract the jar and src zip files into their respective plugin projects.

Then you have to upgrade the plugin manifest format. There should be a warning about each item that needs to changed. There might be a upgrade function in some versions of eclipse but I couldn't find in 3.7.1.

Open the manifest in the editor and select the MANIFEST.MF and plugin.xml bottom tabs to see the raw manifest. The work is mostly to move the data from plugin.xml to MANIFEST.MF. You can see it in plugin.xml and the use the editor pages to add the same information. Then delete it from plugin.xml. As you point out, one of the manifest items is the activation class. In the old plugin.xml format, this in in the Plugin/@Class attribute, so move it to the Activator field.

You'll end up with a few warnings about deprecated APIs. You can leave them or rewrite the simple functions that use them.

To run the plugins you need to run an Eclipse Application launch (run/debug configuration).

The two plugins in the example don't create main toolbars or menus. You can see that they are loaded via Help > About > Installation Details > Plug-ins. You should now be able to switch to the Debug perspective and open the Data Stack view. And, also Debug > Debug Configurations > Push Down Automata will list PDA launch configurations. Note: You can set breakpoints in .pda files (Ctrl+Shift+B) but the plugins don't implement vertical editor ruler markers so you can only see them in the Breakpoints view.

Upvotes: 1

Related Questions