swt - technical deep dive

Post on 18-Dec-2014

140 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

SWT - Technical Deep Dive

TRANSCRIPT

1

SWT : Technical Deep Dive“Eclipse Day Bangalore 2014”

Niraj ModiEclipse SWT Committer @ IBM Software Labsniraj.modi@in.ibm.com

Arun Kumar ThondapuEclipse SWT Co-Lead @ IBM Software Labsarunkumar.thondapu@in.ibm.com

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?

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

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

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

6

10 features you may not know!

Custom widgets StyledText CCombo CLabel CTabFolder SashForm

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.

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

9

10 features you may not know!

Custom draw examples

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.

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

12

Eclipse in Dark Theme

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.

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

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

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

17

How to contribute to SWT: SWT dev environment setup

Channels to contribute

Creating a fix patch for any of the bugzilla request

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

19

SWT dev environment setup:

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/

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:

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

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

24

Interoperability with JavaFX?

top related