Skip to content

Eclipse editor plugin dev

xtitter edited this page Apr 20, 2012 · 1 revision

links

grab the eclipse plugin dev example plugin - java editor

This is a nice example editor plugin to check out. Refer to it when you read the eclipse help page on editors.

First, get the examples installed in your Eclipse RCP. Follow the directions at the [eclipse help page in the plugin dev guide] (http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fjface%2Ftext%2FITextViewer.html). Although this page is sometimes wrong, in that the update manager has been broken for a while. You can grab the zip file, though, and either stick it in the dropins directory (we've had a problem or two with this as well); or, which has always worked

  • grab the zip file for the examples, stick it somewhere
  • in eclipse, go to Help | Install new software
  • Click Add... in the upper right to add another install site. Click Archive... and find the zip file. This is going to put an entry in the "available software sites" preferences, which you can shortcut to in the link on this Install New Software dialog.
  • Grab all the examples, or just the editor. Next or Finish.

Now, bring in the example as a project. Import a new plugin or fragment project:

  • File | Import..., select Plug-in Development | Plug-ins and Fragments
  • in the "Import Plugins and Fragments" dialog, stick with the active target platform, since that is where you installed the new software! Grab the projects with source files, though, in the radio button at the bottom
  • In the "selection" dialog, filter with the string "javaeditor" to find the plugin "org.eclipse.ui.examples.javaeditor". Or, filter by "examples" to see tons. Add it to the right panel, and Finish.
  • You should have a new project named "org.eclipse.ui.examples.javaeditor", which should have a "javaeditorexamplesrc" package with a ton of java files to look at.