25
Customizing RCP UI using the Presentations API Sébastien Moran Eclipse Summit Europe 2009 1 Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

ESE 2009 - Customize RCP UI using Presentations API

Embed Size (px)

DESCRIPTION

The RCP framework allows us to create applications really fitting our needs. But we often want it to look different than a classical Eclipse Workbench. We already have our perspectives, our views, but we want them to be presented differently. That's exactly what the Presentations API is designed for.This talk will present a case study of the customization of an RCP application using the Presentations API and other UI tricks that can be used to build a sexy UI on top of RCP and SWT.It will highlight the key concepts of the Presentations API, and give a general feedback on how easy it is (or sometimes not!) to customize an Eclipse UI.

Citation preview

Page 1: ESE 2009 - Customize RCP UI using Presentations API

Customizing RCP UI using the Presentations API

Sébastien Moran

Eclipse Summit Europe 2009

1 Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 2: ESE 2009 - Customize RCP UI using Presentations API

Agenda

Context

RCP Customization & Presentations API

Demo

UI Tips & Tricks

Conclusion

Questions

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 3: ESE 2009 - Customize RCP UI using Presentations API

3

Sierra Wireless

• Formerly know as “Anyware Technologies”

• Third quarter of 2009 : Sierra Wireless - Solutions & Services

AirCard® Embedded

Solutions & Services

IntelligentGateways

Four product categories…

…serving a diversified set of segments in

mobile computing and machine-to-

machine

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 4: ESE 2009 - Customize RCP UI using Presentations API

4

Expresso

Discovery & Learn tool

• Fast configuration of modems

• Easy access to basic features

User friendly

• Intuitive graphical user interface

• One click shows both ATCommand & its result

Features

• SMS & Voice call configuration

• AT Console View

• Photographic help system

• …

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 5: ESE 2009 - Customize RCP UI using Presentations API

5

Initial work

“Classical” RCP Application

OS native look & feel

Eclipse visual flavor

Several Perspectives

One per discovery thematic

Aggregates several views

Several Views

One per specific discovery feature

Can be used in several

perspectives

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 6: ESE 2009 - Customize RCP UI using Presentations API

6 Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 7: ESE 2009 - Customize RCP UI using Presentations API

7

“Great ! It works like a charm.

But … it really looks like Eclipse... We have to

add some UI love !”

Product Manager remarks

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 8: ESE 2009 - Customize RCP UI using Presentations API

8

Graphical Designer Mockup

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 9: ESE 2009 - Customize RCP UI using Presentations API

9

Developer thoughts

What am I gonna do ?!

Ask my best friends :

Use Presentations API !

&

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 10: ESE 2009 - Customize RCP UI using Presentations API

Agenda

Context

RCP Customization & Presentations API

Demo

UI Tips & Tricks

Conclusion

Questions

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 11: ESE 2009 - Customize RCP UI using Presentations API

11

Why ?

Over heard

“[..] It really looks like Eclipse [..]

“Do I need Eclipse to use your application ?”

Eclipse Look & Feel ?

The way editors and views are shown.

Custom tabs Look & Feel

Perspectives switcher

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 12: ESE 2009 - Customize RCP UI using Presentations API

12

If you don’t like it – change it !

Presentations API

• Control the look and feel of views and editors

Workbench Customization

• Customize the content area

• Customize the window’s shape

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 13: ESE 2009 - Customize RCP UI using Presentations API

13

Presentations API Concepts

Presentation

Look & Feel extension for Workbench

parts

Manage the trim and layout of

parts’ areas (Part stacks)

Presentation Part

Editor

View

Presentation Factory

Editors presentation

stacks

Views presentation

stacks

Extension Point

Register a presentation

factory

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 14: ESE 2009 - Customize RCP UI using Presentations API

14

Presentation Responsibilities

Create part stacks’ trim

Tabs

Title

System menu

Part management buttons

Borders

Control layout & visibility

Parts

Toolbars

View menus

Drag & Drop regions

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 15: ESE 2009 - Customize RCP UI using Presentations API

15

More details

Eclipse Con 2005 presentation slides• eclipsecon2005-presentationsAPI.ppt

Retrieve them from eclipse CVS repository• org.eclipse.ui.examples.presentation

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 16: ESE 2009 - Customize RCP UI using Presentations API

16

Workbench customization

Next step : change the application window's layout

• WorbenchWindowAdvisor participates in window creation

• Control things in the Worbench that regular plug-ins can't

• Perfect Presentations API's complement

• Adapt Workbench default layout to your needs

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 17: ESE 2009 - Customize RCP UI using Presentations API

17

Expresso Customizations

Presentations API

• Customize Parts' stacks display

Workbench customization

• Specific window’s shape

• Specific workbench layout

• Specific perspective switcher

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 18: ESE 2009 - Customize RCP UI using Presentations API

Expresso Customizations

18 Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 19: ESE 2009 - Customize RCP UI using Presentations API

Agenda

Context

RCP Customization & Presentations API

Demo

UI Tips & Tricks

Conclusion

Questions

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 20: ESE 2009 - Customize RCP UI using Presentations API

Agenda

Context

RCP Customization & Presentations API

Demo

UI Tips & Tricks

Conclusion

Questions

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 21: ESE 2009 - Customize RCP UI using Presentations API

Three states widgets

21

Single image containing all

widget’s states

• Normal

• Hover

• Clicked & Selected

Specific image's region is

paint depending on the state

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 22: ESE 2009 - Customize RCP UI using Presentations API

Shells decorations

22

Custom dialog without trim• SWT.NO_TRIM

Create SWT Regions to

define the Shell's shape• org.eclipse.mylyn.commons.ui

• AbstractNotificationPopup.java

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 23: ESE 2009 - Customize RCP UI using Presentations API

Agenda

Context

RCP Customization & Presentations API

Demo

UI Tips & Tricks

Conclusion

Questions

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 24: ESE 2009 - Customize RCP UI using Presentations API

24

Conclusion

First of all: You NEED a Graphic Designer

StackPresentation implementation is the most tricky part

• Start from the examples– org.eclipse.ui.examples.presentation

– org.eclipse.ui.presentations.r21

SWT Graphics knowledge

• Mandatory for Shell's shape customization & custom widgets

• Eclipse article– http://www.eclipse.org/articles/Article-SWT-graphics/SWT_graphics.html

Eclipse's future of UI customization : e4

• Modeled Workbench

• CSS styling

Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0

Page 25: ESE 2009 - Customize RCP UI using Presentations API

Questions ?

Sébastien Moran

[email protected]

25 Customizing RCP UI using the Presentations API - © 2009 Sierra Wireless, made available under EPL V1.0