You are on page 1of 62

A Guided Tour of the Plane of

the Ecliptic

Presenter: Paul Wells (www.agilej.com)

Material: Marcin Maciukiewicz

1
Session Objective

Gain awareness of what the Eclipse


platform offers the application
developer.

2
Eclipse

”...for anything and for nothing in particular”

3
Session Outline

 Introducing the Platform


 SWT
 JFace
 OSGi
 Eclipse Plugins
 RCP
 Support from the IDE

4
Eclipse Platform Development

Conventional approach Platform approach

 Assembly  Customization
 Adaptation  Configuration
 Construction  Extension

5
Eclipse Platform Development

Advantages Disadvantages

 Agility – running  Up-front decision


system earlier  Knowledge of the
 Many common platform
requirements already
implemented

6
Overview of the Platform

RCP Application Plug-ins Java


Other
Development Development
IDE Text Compare Debug Search Team
Help Update Text
IDE

Rich Client Platform


Workspace
Plug-ins
Workbench JFace
SWT OSGi

Native UI Native Resources

7
History

 1998 IBM started to unify their development


tools platform based on Object Technology
International's IDE.
 2001 Open Source project: Eclipse; intended to
compete against other IDEs such as Microsoft
Visual Studio

8
SWT
(Standard Widget Toolkit)

9
SWT

 Why a whole new GUI toolkit?


 native look and feel
 native performance

10
SWT

11
SWT: Comparison with
AWT/Swing
 AWT: thin wrapper around native UI widgets

AWT SWT
Swing
wrapper wrapper

Native UI widgets

Native Graphics Library

12
SWT: Comparison with
AWT/Swing
 Swing: full-blown 100% Java widgets

AWT SWT
Swing
wrapper wrapper

Native UI widgets

Native Graphics Library

13
SWT: Comparison with
AWT/Swing
 SWT
 wrapper around native UI widgets: GTK+, Motif, win32
 missing functionality is developed in Java at SWT level

AWT SWT
Swing
wrapper wrapper

Native UI Widgets

Native Graphics Library 14


SWT: Comparison with
AWT/Swing
 SWT
 Does not implement Model-View-Controller (JFace)
 Is relatively simple compared with Swing
 No pluggable Look-and-Feel required
 Dispose

15
JFace

16
JFace - Resources

 Provides registries that hold Images and Fonts

17
JFace - User Interaction

 Defines standard dialogs and wizards, and


defines a framework for building complex
interactions with the user

18
JFace - Long-running operations

 Long-running operations that require progress


indicators or allow user cancellation of the
operation.

19
Jobs

 Cannot use the SWT thread for long running


operations.
 User requires feedback of progress and option
to cancel.
 The programmer does not know how long an
operation will take.
 Deadlocks / Livelocks
 Priorities

20
Jobs

 Java 6 has powerful new concurrency


mechanisms
 Jobs pre-date Java 6
 Scheduling Rules
 Jobs serve most applications well enough

21
JFace - Actions

 Actions to allow users to define their own


behavior and to assign that behavior to
components (menu items, tool items, push
buttons, etc.

22
JFace - MVC

 Viewer classes that handle data populating,


sorting, filtering, and updating widgets (the
MVC pattern)
 Your model (Content Provider) can be re-used

23
JFace - SWT

 JFace is completely dependent on SWT, but


SWT is not dependent on JFace.
 The Eclipse Workbench is built on both JFace
and SWT. In some instances, it bypasses
JFace and accesses SWT directly.

Workbench JFace
SWT

Native UI
24
JFace - Summary

 Primary goal is to free the developer up, letting


him or her focus on the implementation of an
application without having to be concerned with
the underlying widget system or solving
problems that are common in almost all UI
applications.

25
OSGi
(Open Services Gateway initiative)

26
OSGi

 OSGi is an independent, non-profit organization


 Open specifications for the delivery of managed
services to networked environments
 The specification defines the OSGi Service
Platform:
 the OSGi framework
 a set of standard service definitions
 The core part of the specifications is a
framework that defines an application life cycle
model and a service registry. 27
OSGi - Services Platform

Service Registry

Publish Discover

Bind
Service Provider Service Requester

Bundle

28
OSGi Service Definition

 A service is defined by:


 the service interface - Java class or interface,
 the service properties - name and value pairs

29
OSGi Services
 Wide range of services is already defined ...

Security; Module; Life Cycle, and Service Layers; Framework API; Package
Admin Service; Start Level Service; Conditional Permission Admin; Permission
Admin Service; URL Handlers Service; Log Service; HTTP Service (runs
servlets); Device Access; Configuration Admin Service; Metatype Service;
Preferences Service; User Admin Service; Wire Admin Service; I/O Connector
Service; Initial Provisioning; UPnP Device Service; Declarative Services; Event
Admin Service; Deployment Admin; Auto Configuration; Application Admin
Service; DMT Admin Service; Monitor Admin Service; Foreign Application
Service; Service Tracker; XML Parser Service; Position; Measurement and
State; Execution Environments

 ... plus all your own services.


30
OSGi Features

 Lazy loading
 Service decoupling
 Mix'n'match services from different vendors
(e.g. Spring Dynamic Modules)
 Lifecycle control
 Each bundle can have its own classpath
 Another layer of privacy - clearer api; internal
packages
31
OSGi Eclipse Equinox

 Equinox is one of many OSGi implementations


 Knopflerfish
 Apache Felix
 Solid base for Eclipse platform

32
Eclipse Plug-ins

33
Eclipse Plug-ins

 OSGi bundle
 Provide extension points
 Contribute to extension points

34
Eclipse Plug-ins
host plug-in exposes extension point

WorkbenchPlugin

plug-in: org.eclipse.ui

extension point

Help -> Help Contents


menu item

plug-in: org.eclipse.help.ui
35
extender plug-in contributes to an extension point
Rich Client Platform (RCP)

36
RCP

 Eclipse RCP is a platform for building and


deploying Rich Client Applications.
 This is the heart of any Eclipse based
application

37
Summary so far...

 SWT (Standard Widgets Toolkit)


 JFace
 OSGi (Open Services Gateway initiative)
 Eclipse Plug-ins
 RCP (Rich Client Platform)
Rich Client Platform

Plug-ins
Workbench JFace
SWT OSGi

Native UI
38
RCP Application

39
RCP Application - General Layout
Menu
Toolbar
View's Toolbar View's Toolbar

Editor View

View

View's Toolbar

View

40
RCP Application - General Layout

41
RCP Application - Flexible Layout

42
RCP Application - Editors

 Edit your data model in a user friendly manner


 Editing ecosystem:
 markers (e.g. error, todo)
 undo/redo
 copy&paste

43
RCP Application - Views

Editor related views


Java class outline Java project structure
Editor
Java errors list Java search results
Java source
editing
Other
Other
Other
Other

Non-related views

44
RCP Application - Perspectives

 Show items related to a task


 Help to focus on primary objectives
 Avoid confusion in the interface
 Customize
 views
 layout
 menu
 toolbar
45
RCP Application - Perspectives

Java Plug-in
Programmer Developer

J2EE
Debug Developer

46
Perspectives

 One layout, actions (context menus), view


content, cannot cover all modes of use.
 Java, Debug, Synchronization, Modelling,
Profiling: each has a perspective.
 Most applications are used by actors in different
roles.

47
Workspace

48
Workspace

RCP Application Plug-ins Java


Other
Development Development
IDE Text Compare Debug Search Team
Help Update Text
IDE

Rich Client Platform


Workspace
Plug-ins
Workbench JFace
SWT OSGi

Native UI Native Resources

49
Workspace

 Why hide the file system?


 Resource listeners,
 Platform portability
 Local history
 Working copies
 Markers
 Projects
 Builders
 Natures 50
Update Manager

 Auto-upgrade
 Version
 License Agreement
 Certificate
 Plugin Registry
 Features
 Fragments

51
Navigation History

 Users expect browser-like navigation


 Workbench-wide
 Application programmer provides Navigation
Location
 Navigation Locations can be merged

52
Operation History

 Editor based vs Workbench based


 Undo context
 Enablement of undo/redo actions
 Undo not always possible
 Must not clash with Navigation History

53
Eclipse Modelling Framework

 Persistence
 Editing
 Validation
 GMF
 Can generate actions

Could fill a session on its own

54
IDE

55
IDE

RCP Application Plug-ins Java


Other
Development Development
IDE Text Compare Debug Search Team
Help Update Text
IDE

Rich Client Platform


Workspace
Plug-ins
Workbench JFace
SWT OSGi

Native UI Native Resources

56
IDE

 Provides solid ground for building development


environment:
 editors
 debug
 search
 compare
 team (code share: cvs, svn)
 Java, C, Python, Ruby
 Any other language you like
57
IDE - Java Development Tooling

 Builds and maintains a Java Model


 The Java Model drives IDE's Java browsing
 Refactoring, Code Completion, Type Hierarchy,
References, Searches
 Project continuous build
 Makes use of many topics we have covered so
far: Resources, Perspectives, Builders,
 It can be useful to build your own support tools
58
IDE - Java Emitting Templates

 Built on JDT
 Numerous uses when run as a project build
step

59
Final Summary...

 RCP Application
 views, perspectives, editors
 Workspace
 IDE Plug-ins Java
Other
Development Development
IDE Text Compare Debug Search Team
IDE
RCP Application

Help Update Text


Workspace

Native Resources 60
Conclusion

Eclipse RPC platform


 A general purpose platform, the Java IDE being
an example use of which.
 Built to fulfil a large number of common
application requirements out of the box.
 Knowledge of its capabilities required from the
outset in order to gain most benefit.

61
References

 http://www.otug.org/groups/javasig/richclient.pdf
 http://www.javaworld.com/javaworld/jw-04-2004/jw-
 http://www.ibm.com/developerworks/library/os-
ecl-osgiconsole/index.html

62

You might also like