Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Eclipse Plug-in Development. Who am I? Scott Kellicker Java, C++, JNI, Eclipse.

Similar presentations


Presentation on theme: "Introduction to Eclipse Plug-in Development. Who am I? Scott Kellicker Java, C++, JNI, Eclipse."— Presentation transcript:

1 Introduction to Eclipse Plug-in Development

2 Who am I? Scott Kellicker Java, C++, JNI, Eclipse. scott.kellicker@acm.org

3 Credits Some slides are derivative, based on Eclipse presentations. Copyright (c) 2002, 2003 IBM Corporation and others. All rights reserved. This content is made available to you by Eclipse.org under the terms and conditions of the Common Public License Version 1.0 ("CPL").

4 Agenda Plug-in Architecture Eclipse Platform Example

5 What is Eclipse? Java VM Standard Java2 Virtual Machine Platform Eclipse Platform Java development tools JDTPDE Plug-in development environment A free Java IDE A tool integration platform Open, extensible architecture based on plug-ins

6 Eclipse Plug-in Architecture Plug-in - smallest unit of Eclipse functionality Big example: HTML editor Small example: Action to backup files Extension point - named entity for collecting “contributions” Example: workbench preference UI extension point Extension - a contribution Example: specific backup preferences

7 Eclipse Plug-in Architecture Each plug-in Extends 1 or more extension points Depends on 1 or more plug-ins Lives in its own sub-directory May contain Java code or other files May export own Java APIs May declare its own extension points Details spelled out in the plug-in manifest Manifest declares contributions Code implements contibutions and provides API

8 Plug-in Manifest <plugin id = “com.example.tool" name = “Example Plug-in Tool" class = "com.example.tool.ToolPlugin"> <page id = "com.example.tool.preferences" icon = "icons/knob.gif" title = “Tool Knobs" class = "com.example.tool.ToolPreferenceWizard“/> Declare contribution this plug-in makes Declare new extension point open to contributions from other plug-ins Location of plug-in’s code Other plug-ins needed Plug-in identification plugin.xml

9 Eclipse Plug-in Architecture Plug-in A Declares extension point P Declares interface I to go with P Plug-in B Implements interface I with its own class C Contributes class C to extension point P Plug-in A instantiates C and calls its I methods plug-in A plug-in B class C interface I extension point P extension Typical arrangement contributes creates, calls implements

10 Plug-in Activation Eclipse Platform Runtime is micro-kernel All functionality supplied by plug-ins Eclipse Platform Runtime handles start up Discovers plug-ins installed on disk Contributions processed without plug-in activation Example: Menu constructed from manifest info for contributed items Plug-ins are “lazy loaded” as needed Example: Plug-in activated only when user selects its menu item

11 Plug-in Architecture - Summary All functionality provided by plug-ins Includes all aspects of Eclipse Platform itself Load on demand by separating declaration from implementation Communication via extension points Contributing does not require plug-in activation Easy to install and manage plug-ins

12 Agenda Plug-in Architecture Eclipse Platform Example

13 Eclipse Platform  Eclipse Platform is the common base  Consists of several key components Platform Runtime Eclipse Platform Workspace Workbench SWT JFace TeamHelp Debug Ant “Core” “UI”

14 Workspace Component Resources: files, folders, projects Projects map to directories in file system Workspace holds 1 or more top-level projects Tools read, create, modify, and delete resources in workspace Tree of folders and files

15 Workbench Component SWT – generic low-level graphics and widget set JFace – UI frameworks for common UI tasks Workbench – UI look and feel of Eclipse Platform Workbench SWT JFace

16 SWT SWT = Standard Widget Toolkit Generic graphics and GUI widget set buttons, lists, text, menus, trees, styled text... OS-independent API Uses native widgets where available Emulates widgets where unavailable Workbench SWT JFace

17 JFace is higher level UI framework built on SWT Classes for handling common UI tasks API and implementation are window-system independent Dialogs, preferences, wizards, tree, table, list widgets Workbench SWT JFace

18 Workbench Component Workbench is UI personality of Eclipse Platform UI paradigm centered around Editors Views Perspectives Workbench SWT JFace

19 Workbench Terminology Tool bar Perspective and Fast View bar Resource Navigator view Stacked views Properties view Tasks view Outline view Bookmarks view Menu bar Message area Editor Status area Text editor

20 Editors Editors appear in workbench editor area Contribute actions to workbench menu and tool bars Open, edit, save, close lifecycle Extension point for contributing new types of editors Example: JDT provides Java source file editor Extensive text editor API and framework

21 Views Views provide information on some object Views augment editors Example: Outline view summarizes content Views augment other views Example: Properties view describes selection Extension point for new types of views Eclipse Platform includes many standard views Resource Navigator, Outline, Properties, Tasks, Bookmarks, Search, …

22 Perspectives Perspectives are arrangements of views and editors Different perspectives suited for different user tasks Extension point for new perspectives Eclipse Platform includes standard perspectives Resource, Debug, … Perspective API

23 Eclipse Platform - Summary Eclipse Platform is the nucleus of IDE products Plug-ins, extension points, extensions Open, extensible architecture Workspace, projects, files, folders Common place to organize & store development artifacts Workbench, editors, views, perspectives Common user presentation and UI paradigm

24 Agenda Plug-in Architecture Eclipse Platform Example

25 Plug-in example Create a simple Backup Plug-in. Why? Eclipse has Export Functionality I use it often, don’t like typing, and want it tailored.

26 Requirements Time stamp each backup Copy to a preset location Backup all open projects Backup all selected projects

27 Resources www.eclipse.org Java Developer’s Guide To Eclipse, D’Anjou, et.al. www.planeteclipse.org IBM DeveloperWorks articles C Judd: Building Eclipse plug-ins using Templates S Kellicker: Eclipse for Visual Studio Developers scott.kellicker@acm.org

28 Questions ?


Download ppt "Introduction to Eclipse Plug-in Development. Who am I? Scott Kellicker Java, C++, JNI, Eclipse."

Similar presentations


Ads by Google