plugging into eclipse

Post on 05-Jan-2016

54 Views

Category:

Documents

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

Plugging into Eclipse. Plugging into Eclipse. Eclipse User Interface Extending Eclipse Extension Points. Extending Eclipse. What are they? The only points where Eclipse may be extended. Extension points are where plug-ins plug-in How to use them? - PowerPoint PPT Presentation

TRANSCRIPT

Plugging into Eclipse

Plugging into Eclipse Eclipse User Interface Extending Eclipse Extension Points

Eclipse User Interface

Perspective Selected

Image from Eclipse Help, copyright IBM

Extending Eclipse

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

Image from Eclipse Help, copyright IBM

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>

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

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);

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:anonymous@dev.eclipse.org:/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