1 / 6

Plug-In example

Plug-In example. We want to contribute a new view – “Java files” view The view will contain a list of java files selected in the “Resource Navigator view”. Selection changes in the “Resource Navigator view” have to be properly reflected in the “Java files” view

hammer
Download Presentation

Plug-In example

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Plug-In example • We want to contribute a new view – “Java files” view • The view will contain a list of java files selected in the “Resource Navigator view”. • Selection changes in the “Resource Navigator view” have to be properly reflected in the “Java files” view • “Java files” view should also respond to user’s “double-clicks” by opening an editor for selected file.

  2. Plug-in manifest file. <?xml version="1.0" encoding="UTF-8"?> <plugin id="edu.neu.ccs.eclipse.LoDChecker" name="LoDChecker plugin" version="1.0.0" provider-name="CCS NEU"> <requires> <import plugin="org.eclipse.core.resources"/> <import plugin="org.eclipse.ui"/> <import plugin="org.eclipse.swt"/> </requires> <runtime> <library name="checker.jar"> <export name="*"/> </library> </runtime> <extension point="org.eclipse.ui.views"> <category name="Checker Views“ id="edu.neu.ccs.eclipse.LoDChecker.views"/> <view id="edu.neu.ccs.eclipse.LoDChecker.JFView" name="Java Files View" icon="icons/view.gif" category="edu.neu.ccs.eclipse.LoDChecker.views“ class="edu.neu.ccs.eclipse.LoDChecker.JFView" /> </extension> </plugin>

  3. edu.neu.ccs.eclipse.LoDChecker. JFView • Must implement org.eclipse.ui.IViewPart • Have to represent selected objects in the list form • Implementation will use • org.eclipse.ui.part.ViewPart as base class for View class • org.eclipse.jface.viewers.ListViewer for representation selected java files as list.

  4. Viewer framework Viewer Label Provider Displays domain objects by first converting them into items with Content Provider and by obtaining text/image for each from Label Provider Provides images or/and text for each item in the viewer text/images Input Content Provider items Knows how to transform input into viewer items. Keeps viewer in sync with domain model. Domain objects model. Domain change notifications

  5. How to start? • Documentation (plug-in developer section) dev.eclipse.org:8080/help/help.jsp • Articles on www.eclipse.org/articles • “Your First Plug-in” Jim Amsden  • “Creating an Eclipse View” Dave Springgay • “How do use the JFace Tree Viewer” Chris Grindstaff • API (documentation) • Source code. AspectJ plug-in source code (www.eclipse.org/ajdt) is a good place to learn about plug-in development techniques.

More Related