Transcript
Page 1: Plugging into Eclipse

Plugging into Eclipse

Page 2: Plugging into Eclipse

Plugging into Eclipse Eclipse User Interface Extending Eclipse Extension Points

Page 3: Plugging into Eclipse

Eclipse User Interface

Perspective Selected

Image from Eclipse Help, copyright IBM

Page 4: Plugging into Eclipse

Extending Eclipse

Plug-ins are custom tools Plug-ins connect to Eclipse through Extension Points

Image from Eclipse Help, copyright IBM

Page 5: Plugging into Eclipse

Extension Points What are they?

The only points where Eclipse may be extended. Extension points are where plug-ins plug-in

How to use them? Implement the correct Java interface for the extension point, and

add an extension point entry to plugin.xml Example entry:

<extension point="org.eclipse.ui.editors"> <editor name="CPS editor" default="false" icon="icons/obj16/cp.gif" extensions="cps" contributorClass="edu.ksu.cis.cadena.frontend.editor.CPSActionContributor" class="edu.ksu.cis.cadena.frontend.editor.CPSEditor" id="edu.ksu.cis.cadena.frontend.editor.CPSEditor"> </editor> </extension>

Page 6: Plugging into Eclipse

Q: What do Extensions know about the IDE around them?

A: Not much.

Extensions are restricted by: Extension Point interfaces The Eclipse API

Plug-ins cannot accomplish the following:1. A menu bar item that opens a custom editor2. A Workbench window without a status bar

Page 7: Plugging into Eclipse

The Eclipse API does allow...

All open resources can be accessed with:

Static class org.eclipse.core.resources.ResourcesPlugin

The workbench can be accessed with:

Static class org.eclipse.ui.PlatformUI

Example (Changing the Perspective):

IPerspectiveRegistry reg = PlatformUI.getWorkbench().getPerspectiveRegistry();IPerspectiveDescriptor persp = reg.findPerspectiveWithId(perspID);replaceCurrentPerspective(persp);

Page 8: Plugging into Eclipse

References Eclipse Homepage: http://www.eclipse.org List of all Extension Points:

http://dev.eclipse.org:8080/help/content/help:/org.eclipse.platform.doc.isv/reference/extension-points/index.html

Eclipse IDE source is available from cvs repository at :pserver:[email protected]:/home/eclipseNote: Eclipse user interface source is under the “org.eclipse.ui” moduleEclipse source is also included with the Eclipse distribution in “eclipse\plugins\org.eclipse.platform.source_2.0.1\src”

Eclipse newsgroup registration: http://eclipse.org/newsgroups/ Eclipse has a thorough help section with excellent searching, Help -> Help Contents


Top Related