Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show...

19

Transcript of Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show...

Page 1: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.
Page 2: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

Goals

• Give you a feeling of what Eclipse is.

• Introduce the basic mechanisms behind the scene.

• Show how to contribute to the Eclipse environment by example.

Page 3: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

What is Eclipse?• Eclipse is a kind of universal tool

platform - an open extensible IDE for anything and nothing in particular. (www.eclipse.org)

• Eclipse is a platform for integrating development tools. (www.eclipse.org)

• Place where development tools live and collaborate.

Page 4: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

What is Eclipse? User’s view.• Eclipse is designed to be used by developers.• Eclipse allows user to manage project resources

(files, folders).• Editors allow user to edit resources.• Views assist user by providing structured

information about edited/selected resource. • Perspectives arrange editors and views in order to

suit current developer task best.

Page 5: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

Workbench window

Tool bar

PerspectiveandFast Viewbar

ResourceNavigatorview

Stackedviews

Propertiesview

Tasksview

Outlineview

Bookmarksview

Menu bar

Messagearea

EditorStatusarea

Texteditor

Page 6: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

What is Eclipse? Plug-in developer view.

• Environment providing you with an extensive set of facilities (API) for creating development tools.

• Concepts and mechanisms allowing you to extend and/or collaborate with existing solutions seamlessly.

• Set of frameworks you may want to implement in your product.

Page 7: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

General structure

www.eclipse.org

Java VMStandard Java2Virtual Machine

PlatformEclipse Platform

Java development tools

JDT

PDEPlug-in developmentenvironment

Page 8: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

Platform architecture.

www.eclipse.org

Page 9: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

Platform runtime

• Starts the platform and discovers plug-ins

• Defines mechanisms for attaching plug-ins to the environment

• Designed to use plug-ins only if needed

• Maintains plug-in registry

• org.eclipse.core.runtime

Page 10: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

Workspace

• Central hub for user’s data files• Resource management

– Projects

– Folders

– Files

– Specialized resources

• Builders, Project Natures, Resource Markers• Resources plug-in. org.eclipse.core.resources

Page 11: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

Workbench

• Eclipse UI• Frame that can represent various visual parts

– Views– Editors

• Defines 27 extension points. Basics are:– org.eclipse.ui.views– org.eclipse.ui.editors– org.eclipse.ui.viewActionss– org.eclipse.ui.editorActions– org.eclipse.ui.popupMenus

• Extensive set of API classes and interfaces

Page 12: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

JFace & SWT.

• Standard widget toolkit (SWT)– Portable API

– Tight integration with native OS

• JFace. – Provides higher level interface than SWT

– Contains a lot of facilities to use in your plug-ins (wizards, preferences etc.)

– Defines useful frameworks, such as viewer MVC model

Page 13: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

Help and Team support

• Help– HTML format

– .toc (Table of Contens) files are used to represent documentation structure

– org.eclipse.help.toc extension

• Team support– additional API that allow plug-ins to integrate the function of a

versioning and configuration management repository

– API allows different repository plug-ins to work with the system

– Multiple repository providers can coexist peacefully within the platform

Page 14: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

Extension point• Functionality to the system is contributed via so-

called “extension points”.• In essence each extension point is an interface

contributors have to implement.• The extension point mechanism is the only way of

contributing functionality to the system.• Plug-ins can define their own extension points, so

that other plug-ins can integrate tightly with them.

Page 15: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

Extension• Extension is a piece of functionality contributed via

corresponding extension point. • Extension is just an implementation of interface

defined by extension point.• Extensions are typically written in Java using the

platform APIs. Extension=Java class!• Some extension points accommodate extensions

provided as platform executables, ActiveX components, or developed in scripting languages. In general, only a subset of the full platform functionality is available to non-

Java extensions.

Page 16: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

Plug-In• Contains one or more extensions• Can optionally declare new extension points• Depends on a set of other plug-ins• Contains Java code libraries and other files.• Lives in its own plug-in subdirectory • Introduced to the Platform by a manifest file

(plugin.xml) • Loaded to the Eclipse registry on a start-up

Page 17: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

Plug-in manifest (plugin.xml)

• Introduces plug-in interface to the Platform

• Contains– plug-in version, id, provider, class– plug-in dependency information– plug-in java library name(s)– extensions implemented– defines new extension points (optionally)

Page 18: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

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 Cinterface I

extensionpoint P

extension

• Typical arrangement

contributes

creates, calls

implements

www.eclipse.org

Page 19: Goals Give you a feeling of what Eclipse is. Introduce the basic mechanisms behind the scene. Show how to contribute to the Eclipse environment by example.

Plug-in installation• Plug-in have to be installed into a directory underneath the platform's plug-in

directory. This directory corresponds to our plug-in id, which must be unique. The standard practice for plug-in directory names is to use the plug-in's fully qualified id, including the dots. (i.e. org.aspectj.ajde plug-in is rooted to {platform's plug-in directory}/org.aspectj.ajde_1.0.6 /)

• The plug-in directory is named plugins and is typically located underneath the main directory where you installed the platform.

• All the plug-in files (java libraries,manifest, images etc.) have to be located within plug-in directory system.

• All the plug-in code have to be in the jar format. The names of the jar files should correspond to the values of the name attribute of the library tag inside the corresponding plug-ins manifest file.

• Each plug-in must have it’s own plugin.xml located at the top level of plug-in directory system

• A plug-in typically contains some extra files (images, docs, etc) which can be located at any place within plug-in directory system