swt - technical deep dive

24
1 SWT : Technical Deep Dive “Eclipse Day Bangalore 2014” Niraj Modi Eclipse SWT Committer @ IBM Software Labs [email protected] Arun Kumar Thondapu Eclipse SWT Co-Lead @ IBM Software Labs [email protected]

Upload: eclipse-day-india

Post on 18-Dec-2014

140 views

Category:

Technology


1 download

DESCRIPTION

SWT - Technical Deep Dive

TRANSCRIPT

Page 1: SWT - Technical Deep Dive

1

SWT : Technical Deep Dive“Eclipse Day Bangalore 2014”

Niraj ModiEclipse SWT Committer @ IBM Software [email protected]

Arun Kumar ThondapuEclipse SWT Co-Lead @ IBM Software [email protected]

Page 2: SWT - Technical Deep Dive

2

Agenda

10 features you may not know! What have we been doing? Useful Tools in the SWT world… How to “Contribute” to SWT? What’s next?

Page 3: SWT - Technical Deep Dive

3

10 features you may not know! SWT as a stand-alone application

independent download (swt.jar is ~6MB)

SWT as a Java Web Start application www.eclipse.org/swt/jws/controlexample.jnlp

Display#syncExec,Display#asyncExec special access methods to allow non-UI

threads to perform operations on objects belonging to the UI-thread

SWT implements a single threaded UI model called apartment threading

Page 4: SWT - Technical Deep Dive

4

10 features you may not know! Browser widget: Embeds native renderers

based on creation style and native OS

Windows – Trident (IE), Gecko (mozilla/XULRunner) and WebKit

Mac OS X – WebKit, Gecko

Linux – WebKitGTK, Gecko

Page 5: SWT - Technical Deep Dive

5

10 features you may not know! OLE/ActiveX support

OLE Documents, such as Word, Excel or PowerPoint can be embedded into SWT applications (using COM)

ActiveX Controls (can be used to embed IE)

Accessibility APIs for making applications accessible to Assistive Technology products on all major platforms

Page 6: SWT - Technical Deep Dive

6

10 features you may not know!

Custom widgets StyledText CCombo CLabel CTabFolder SashForm

Page 7: SWT - Technical Deep Dive

7

10 features you may not know! OpenGL support

OpenGL is a vendor-neutral, multi-platform standard for creating high-performance 2D and 3D graphics.

Touch and gesture support If your hardware supports it, you can listen for

touches or gestures on SWT controls. Four standard gestures are supported: two-finger panning, rotation, magnification, and swipe (three fingers on Mac OS X, flicks on Windows).

You can also listen for 'raw' touches.

Page 8: SWT - Technical Deep Dive

8

10 features you may not know! Custom draw for Table and Tree Items

allows clients to create items with custom appearances

custom drawing is done on a per-cell basis

SWT.MeasureItem: allows a client to specify the dimensions of a cell's content

SWT.EraseItem: allows a client to custom draw a cell's background and/or selection, and to influence whether the cell's foreground should be drawn

SWT.PaintItem: allows a client to custom draw or augment a cell's foreground and/or focus rectangle

Page 9: SWT - Technical Deep Dive

9

10 features you may not know!

Custom draw examples

Page 10: SWT - Technical Deep Dive

10

10 features you may not know! Virtual Tables/Trees

virtual Tables and Trees allow developers to quickly create Tables and Trees with large amounts of data and populate them efficiently.

items are created on an on-demand basis.

reduces computational effort and memory footprint, preserves UI responsiveness for large data sets.

Page 11: SWT - Technical Deep Dive

11

What have we been doing? CSS styling support for widgets (partial)

Added support for Mozilla/XULRunner 24.x and 64-bit support on Windows

Experimental support for WebKit2 on Linux is available

Default Browser renderer setting has been introduced

Page 12: SWT - Technical Deep Dive

12

Eclipse in Dark Theme

Page 13: SWT - Technical Deep Dive

13

What have we been doing? Various BiDi text and widget orientation

related enhancements

SWT#isLoadable () API

UI timing API SWT.PreEvent and SWT.PostEvent which

are sent before and after all events and async runnables.

Page 14: SWT - Technical Deep Dive

14

What have we been doing?

Porting SWT to GTK+ 3.x

GTK+ 3.x is API and binary incompatible with GTK+ 2.x

A number of functions, and in some cases, entire widgets have been deprecated

Uses GIO for launching applications Uses cairo for all drawing

Page 15: SWT - Technical Deep Dive

15

Useful Tools in the SWT world… Sleak

Sleak is a simple tool that monitors the creation and disposal of SWT graphics resources.

SWT Spy SWT Spy plug-in for Eclipse is a simple tool

that prints out information about the widget under the cursor.

style, layout and parent information

Page 16: SWT - Technical Deep Dive

16

Useful Tools in the SWT world…

SWTBot UI/functional testing tool for testing SWT,

Eclipse and GEF based applications. integrates with Eclipse PDE, Eclipse

headless testing framework, Ant and Tycho

WindowBuilder WYSIWYG visual GUI designer

Page 17: SWT - Technical Deep Dive

17

How to contribute to SWT: SWT dev environment setup

Channels to contribute

Creating a fix patch for any of the bugzilla request

Page 18: SWT - Technical Deep Dive

18

SWT dev environment setup: Instructions to setup SWT code

http://eclipse.org/swt/git.php

SWT Code snippets/Examples http://eclipse.org/swt/snippets/

SWT sources Git repositories:http://git.eclipse.org/gitroot/platform/eclipse.platform.swt.githttp://git.eclipse.org/gitroot/platform/eclipse.platform.swt.binaries.git

Page 19: SWT - Technical Deep Dive

19

SWT dev environment setup:

Page 20: SWT - Technical Deep Dive

20

Channels to contribute Report any SWT bug/enhancement@Bugzilla:

http://www.eclipse.org/swt/bugs.php

Contribute to existing issue Analyze the issue & come up with code snippet to

reproduce it(if missing) or point to existing snippet Identify problem area in the SWT code if any Participate in bug discussion Try to come up with a fix

Participate in SWT community discussions:http://www.eclipse.org/forums/index.php/f/100/

Page 21: SWT - Technical Deep Dive

21

Creating a fix patch for any of the Bugzilla request: There are two ways to create a fix

patch: A less recommended (but straight forward) way is to attach

an standard Eclipse patch to the Bugzilla bug:

Page 22: SWT - Technical Deep Dive

22

Creating a fix patch for any of the Bugzilla request: Preferred way is a Gerrit patch with review support:

http://www.vogella.com/tutorials/Gerrit/article.html

Page 23: SWT - Technical Deep Dive

23

What’s next?

Interoperability with JavaFX Continue adding support for newer

Browser runtimes Enhance support for Retina and

other high-resolution displays Wayland - a display server protocol

that is intended to replace the X Window System

Page 24: SWT - Technical Deep Dive

24

Interoperability with JavaFX?