Documentation for writing plugins [message #297015] |
Fri, 06 January 2006 11:16  |
Eclipse User |
|
|
|
1. Is there good documentation that explains how to interact with Eclipse
2.1 and Eclipse 3.0? For example, I had to dig through newsgroups to find
answers to:
- How to get the selected editor from the menu
- How to get the selected file from the navigator
- How to update the status bar
Questions that I still have -
- Is there any API for doing a global search of a workspace?
- How to determine the target ID for a JSP editor
- How to determine selected text in an editor - How to enable/disable
menu items
- How to add a plugin to a perspective - I found the target ID for the
perspective and changed plugin.xml but the plugin was not automatically
added to the perspective.
2. Are there good examples of the correct way to write plugins?
3. I have learned a lot by debugging in the PDE and looking at variables.
But is there any easy way to find what Eclipse code is getting called
with different actions and look at it in the debugger. For example, if I
wanted to see the code when File -> Save or Search -> File or the Open
Type action is called and set a method breakpoint, how do I find the
specific code getting called to look at these methods?
|
|
|
Re: Documentation for writing plugins [message #297034 is a reply to message #297015] |
Fri, 06 January 2006 12:50  |
Eclipse User |
|
|
|
Originally posted by: automatic.javalobby.org
1. I'm not sure what you mean by 'interacting with Eclipse 2.1 and 3.0'. I'm hoping you mean 'How do I use Eclipse 2.1 and How do I use Eclipse 3.0' rather than 'How do Eclipse 2.1 and 3.0 work with each other'.
In any case, you can read the on-line help associated with eclipses at:
<a href="http://help.eclipse.org/help31/">http://help.eclipse.org/help31</a>
<a href="http://help.eclipse.org/help30/">http://help.eclipse.org/help30</a>
<a href="http://help.eclipse.org/help21/">http://help.eclipse.org/help21</a>
There's a lot of good documentation in the Platform Plug-in developer guide.
There's also a couple of good books. Official Eclipse 3.0 FAQs (John Arthorne, Chris Laffra) would be an excellent book for answering "How-do-I-do" questions. There's an O'Reilly book by Steve Northerner (I think) called Eclipse Cookbook which is a similar vein.
EclipseWiki (<a href="http://eclipsewiki.editme.com/">http://eclipsewiki.editme.com/</a>) may be useful.
Plugins aren't added to perspectives, but views are. You can get a view by using the Show Views menu from the Window menu, as long as the plugin is installed.
2. There's a bunch of plugins around, some good, some bad. Most of the time it's whether a plugin is close to what you want to do or nor. For example, if you're writing an IDE, I'd recommend looking at http://www.radrails.org (Ruby on Rails) because a lot of what they've done is very nice. If you want to have an RSS reader, look at http://www.rcpapps.com (disclaimer; I'm slowly writing it, so it's not finished yet :-)
3. Yes, it's possible, but you need to go through hoops.
Find the name on the action (like Show View). Search the .properties files in the plugins you expect it to be in to find out what the label is (e.g. org.eclipse.core.ui.ShowViewLabel=Show View). (If you have internationalised packs installed, then you can also resolve the localised text to the label key). Then look for the key in the plugin.xml file, which will associate that key with an action ID (e.g. org.eclipse.core.ui.ShowViewID). You might then find that will correspond with an action (also defined in plugin.xml) like org.eclipse.ui.internal.actions.ShowViewAction, and you can then look at that in Eclipse.
Bit of a long way around :-)
If you've put in your own menu before (and know what sequence of things need to be done to get it there) then it's essentially working backwards through this chain.
Easiest way to search is to import plugins as source, because then you can do the search in Eclipse. I personally have a workspace dedicated to Eclipse plugins as source, so whenever I want to find something I can fire up a second Eclipse and do a search against the source. I don't have it as my main development workspace, because otherwise it would be really slow :-)
Hope that helps,
Alex.
|
|
|
Powered by
FUDForum. Page generated in 0.04322 seconds