Upload
luca-donofrio
View
154
Download
1
Tags:
Embed Size (px)
DESCRIPTION
Eclipse Training - Introduction
Citation preview
Eclipse Plug-ins and RCP
Training CourseIntroduction and
Architecture
October 2013Copyright © 2013 Luca D’Onofrio – RCP Solutions1
1. Eclipse Introduction and Architecture2. Standard Widgets Toolkit3. JFace4. Standard Extension Points and APIs5. Defining your own Extension Points6. Rich Client Platforms &
Industrialization
Training Course Agenda
October 2013Copyright © 2013 Luca D’Onofrio – RCP Solutions2
Eclipse IDE is a multi-domain, multi-language Integrated Development Environment
Eclipse is an Extensible platform for tool integration based on industry standards
Cross-platform environment EPL (Eclipse Public License): let you build an
distribute commercially-friendly open/closed source software
Eclipse Foundation and Development Community support
IntroductionWhy Eclipse?
October 20133
Copyright © 2013 Luca D’Onofrio – RCP Solutions
Overcome the following challenges that may arise regularly in the development of tools: Pressure to cut costs Reducing integration time Cost effective, secure and easy maintenance Deliver value and reduce risks Automation of software updates Standardization
IntroductionAdvantages (1/3)
October 20134
Copyright © 2013 Luca D’Onofrio – RCP Solutions
Create a new business model that relies on shifting the commercial value away from the actual products and generating revenue from the auxiliary services around the product: systems integration enrich business solutions support customizations tutorials and documentation
IntroductionAdvantages (2/3)
October 20135
Copyright © 2013 Luca D’Onofrio – RCP Solutions
Proprietary software lack in imagination. They have only one business model: “EULA Ware — Give me money. Now go away. It doesn’t work? Go away.
You want your money back? Read your EULA, and go away. You want to see the software? Go away.”
Open source forces companies to use their imagination. They can’t feed people EULA Ware, so they must make money in other ways: “Support Ware — Pay us money and we’ll support the software. We’ll
answer your questions. Or we’ll try to. Over the phone, on the Web, whatever. Pay us enough and we’ll come over.”
“Project Ware — Need something done? We’ll do it. Pay us for our work, and pay us for the project. Or try our software and buy our hardware.”
“Foundation Ware — Our software has a foundation. (e.g. base your product on the Eclipse related environment and tools)”
The great thing about Eclipse World is that you don’t have to use just one business model. You can mix-and-match as you see fit.
A new business model
October 20136
Copyright © 2013 Luca D’Onofrio – RCP Solutions
Eclipse Releases and Packages
Current releases Eclipse Kepler (4.3)
Archived releases Eclipse Juno (4.2) Eclipse Indigo (3.7) Eclipse Helios (3.6) Eclipse Galileo (3.5)
Main Packages JDT (Java/Java EE) PDE (RCP/RAP) CDT (C/C++) WTP (Web) EMF (Modeling) XML BIRT GIT, SVN, … UML XText
October 2013Copyright © 2013 Luca D’Onofrio – RCP Solutions7
JavaXMLDesign Patterns
Course Pre-Requisites
October 20138
Copyright © 2013 Luca D’Onofrio – RCP Solutions
1. Eclipse General Architecture2. Eclipse UI
a) Workbench, Workspace and Resources, Perspectives, Views and editors, Preference and Properties pages, Menu and Toolbar, Launch configurations.
3. Eclipse Plug-ins Ecosystema) OSGI, Bundles and Manifestb) Plugins, Extensions, Extension Points, Features, RCP
4. Using the PDEa) Creating, debugging and delivering plugins, fragments,
features and update sites.
Agenda
October 20139
Copyright © 2013 Luca D’Onofrio – RCP Solutions
Eclipse General Architecture
October 201310
Copyright © 2013 Luca D’Onofrio – RCP Solutions
The term Workbench refers to the desktop development environment. The Workbench aims to achieve seamless tool integration and controlled openness by providing a common paradigm for the creation, management, and navigation of workspace resources.
Each Workbench window contains one or more perspectives. Perspectives contain views and editors and control what appears in certain menus and tool bars.
More than one Workbench window can exist on the desktop at any given time.
TIP: command line and JVM arguments
Eclipse UIWorkbench
October 201311
Copyright © 2013 Luca D’Onofrio – RCP Solutions
The workspace is the container that allows a user to gather various source code files and resources and work with them as a cohesive unit.
TIP: “Do I have to duplicate then my projects if using with different versions of Eclipse in parallel?” NO, because the workspace folder does not have to have the projects in it (as folders). They can, but it is not needed.
TIP: Workspace preferences TIP: Workspace .metadata (workspace structure and
platform dependent settings)
Eclipse UIWorkspace
October 201312
Copyright © 2013 Luca D’Onofrio – RCP Solutions
Eclipse handles its own file system that manage resources Eclipse file system provides internal features that allow the synchronization between
local platform-dependent file system. Files: Comparable to files as you see them in the file system. Folders: Comparable to directories on a file system. In the Workbench, folders are
contained in projects or other folders. Folders can contain files and other folders. Projects: Contain folders and files. Projects are used for builds, version management,
sharing, and resource organization. Like folders, projects map to directories in the file system. (When you create a project, you specify a location for it in the file system.) ( .project, Working sets). A project is either open or closed.
TIP: closed projects require less memory. Since they are not examined during builds, closing a project can improve build time.
Linked Resources: Folders and files can be linked to locations in the file system outside of the project's location. These special folders and files are called linked resources.
TIP: Different tools that plug into the Workbench use their own specialized types of projects, folders, and files.
Eclipse UIResources
October 201313
Copyright © 2013 Luca D’Onofrio – RCP Solutions
Perspective: A perspective defines the initial set and layout of views in the Workbench
window. Within the window, each perspective shares the same set of editors. Each perspective provides a set of functionality (menus / toolbars) aimed at accomplishing a specific type of task or works with specific types of resources.
Editor: Specialized view that USUALLY operates on file resources and provides
mechanisms for resource life-cycle. ( sync example) Any number of editors can be open at once, but only one can be active at a
time. The main menu bar and toolbar for the Workbench window contain operations (editor contribution) that are applicable to the active editor.
View: Views support editors and provide alternative presentations as well as ways to
navigate the information in your Workbench. ( Project Explorer, Problems, Errors, Properties, …)
Views can have their own menus and toolbars
TIP: Editor can be instantiated more then once; usually there is only one instance of a view.
Eclipse UIPerspectives, Editors and
Views
October 201314
Copyright © 2013 Luca D’Onofrio – RCP Solutions
Menus: Menu bar Popup menu
Toolbars: Workbench main toolbar and editor contributions
Views related toolbar
Preferences: Control the behavior of Workbench features
Properties: Control the behavior of Resources features. Workspace related (.settings)
Eclipse UIMenus, Toolbars, Preference and
Properties
October 201315
Copyright © 2013 Luca D’Onofrio – RCP Solutions
Toobar commands
Popup menu commands
Build-in run configurations Run / Debug External tools
Eclipse UILaunch configurations
October 201316
Copyright © 2013 Luca D’Onofrio – RCP Solutions
Everything can be extended Everything can be referenced by its own id
Eclipse UI Concepts and Terms
October 201317
Platform
PlatformUI
Selection Providers
Selection Events
Resource Change
Jobs
Commands
Handlers
Actions
Multipage Editor
Form Editor
Pref/Prop Pages
Project Natures
Project Builders
Resource PathCopyright © 2013 Luca D’Onofrio – RCP Solutions
Eclipse Plug-ins Ecosystem
OSGI
October 201318
The OSGi technology is a set of specifications that define a dynamic component system for Java.
These specifications enable a development model where applications are (dynamically) composed of many different (reusable) components. Bundles : Bundles are the OSGi components made by the
developers. terms plug-in and bundle are interchangeable ( class hierarchy).
Services : The services layer connects bundles in a dynamic way by offering a publish-find-bind model for plain old Java objects.
Life-Cycle : The API to install, start, stop, update, and uninstall bundles.
Modules : The layer that defines how a bundle can import and export code.
Security : The layer that handles the security aspects. Execution Environment : Defines what methods and classes are
available in a specific platform.
Copyright © 2013 Luca D’Onofrio – RCP Solutions
Manifest-Version Bundle-ManifestVersion: Bundle-Name Bundle-SymbolicName Bundle-Version Bundle-Activator Bundle-Vendor Require-Bundle Bundle-RequiredExecutionEnvironment Bundle-ActivationPolicy Bundle-ClassPath Export-Package
TIP: An Activator class can be «singleton»TIP: Accessing an activator or a plugin class requires the containing plugin to be
loaded, where interacting with the Bundle interface not.
Eclipse Plug-ins Ecosystem
Bundles and Manifest
October 201319
Copyright © 2013 Luca D’Onofrio – RCP Solutions
Eclipse Plug-ins Ecosystem
October 201320
Copyright © 2013 Luca D’Onofrio – RCP Solutions
The PDE provides a comprehensive plug-in development environment. PDE Views
The Plugin registry view The Plugins view The Plugin dependencies view The Plugin Spy (Alt+Shift+F1)
PDE Wizards Plugins Wizard & Extension Templates Features Wizard Update Site Wizard Running and Debugging your plugins
TIP: You can use fragments to extends functionality of another plugin: typically there are used to supply alternative language packs or platform specific implementation classes.
Using the PDE
October 201321
Copyright © 2013 Luca D’Onofrio – RCP Solutions
www.eclipse.org Eclipse SDK update site help.eclipse.org wiki.eclipse.org www.osgi.org
References
October 201322
Copyright © 2013 Luca D’Onofrio – RCP Solutions
Eclipse Plug-ins (3rd Edition): Building Commercial-Quality Plug-ins (Eclipse Series) - Eric Clayberg e Dan Rubel (11 dic. 2008)
Design Patterns: Elements of Reusable Object-Oriented Software - Gamma, Erich, Helm, Richard, Johnson, Ralph e Vlissides, John (31 ott. 1994)
Thinking In Java: The definitive introduction to object-oriented programming in the language of the world wide... - Bruce Eckel (3 feb. 2006)
Xml Bible di Elliotte Rusty Harold e Harold (17 ago. 1999) XML Programming Bible: Bible Series, Book 129
Books
October 201323
Copyright © 2013 Luca D’Onofrio – RCP Solutions