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 Adaptation Construction

Customization Configuration Extension

5

Eclipse Platform Development
Advantages

Disadvantages
 

Agility – running system earlier Many common requirements already implemented

Up-front decision Knowledge of the platform

6

Overview of the Platform
RCP Application

Plug-ins Development

Java Development IDE

Other Search Team

Help

Update

Text

IDE Text Compare Debug

Rich Client Platform Workbench JFace SWT Plug-ins OSGi Workspace

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
wrapper

SWT
wrapper

Swing

Native UI widgets Native Graphics Library
12

SWT: Comparison with AWT/Swing

Swing: full-blown 100% Java widgets

AWT
wrapper

SWT
wrapper

Swing

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
wrapper

SWT
wrapper

Swing

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 27 model and a service registry.

OSGi - Services Platform

Service Registry

Publish

Discover

Service Provider

Bind

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 extender plug-in contributes to an extension point

35

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 Workbench JFace SWT Plug-ins 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 Editor
Java source editing Other Other Other Other Java class outline Java errors list Java project structure Java search results

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 Programmer Plug-in Developer

Debug

J2EE 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 Development

Java Development IDE

Other Search Team

Help

Update

Text

IDE Text Compare Debug

Rich Client Platform Workbench JFace SWT Plug-ins OSGi Workspace

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 Help Update Text Plug-ins Development Java Development IDE Other Search Team

IDE Text Compare Debug

Rich Client Platform Workbench JFace SWT Plug-ins OSGi Workspace

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
Plug-ins Development Java Development Debug IDE

Workspace IDE
Other Search Team

IDE Text Compare 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.ibm.com/developerworks/library/osecl-osgiconsole/index.html

http://www.javaworld.com/javaworld/jw-04-2004/jw-

62