SWT/JFace in Action
GUI Design with Eclipse 3.0
Matthew Scarpino, Stephen Holder, Stanford Ng, and Laurent Mihalkovic
  • November 2004
  • ISBN 9781932394276
  • 496 pages
  • printed in black & white

An excellent work! It is timely, comprehensive, and interestingly presented.

Phil Hanna, SAS Institute Inc., author of JSP: The Complete Reference

SWT/JFace in Action covers the territory, from simple widgets to complex graphics. It guides you through the process of developing Eclipse-based GUIs and shows how to build applications with features your users will love. The authors share their intimate knowledge of the subject with you in a friendly, readable style.

This book encourages you to learn through action. Each topic provides extensive code to show you how SWT/JFace works in practical applications. Not only do these examples help you understand the subject, they are a working set of programs you can reuse in your own interfaces.

Table of Contents detailed table of contents



about this book

about the authors

about the title

about the cover illustration

1. Overview of SWT and JFace

1.1. What is SWT/JFace?

1.1.1. Building GUIs with SWT

1.1.2. Simplifying GUI development with JFace

1.2. Looking under the hood

1.2.1. The old standby: Swing

1.2.2. The newcomer: SWT/JFace

1.2.3. The SWT/Swing debate

1.3. SWT/JFace: licensing and platform support

1.3.1. The Common Public License

1.3.2. Platforms supported

1.4. The WidgetWindow

1.5. Summary

2. Getting started with SWT and JFace

2.1. Programming in SWT

2.1.1. The HelloSWT program

2.1.2. The Display class

2.1.3. The Shell class

2.2. Programming in SWT/JFace

2.2.1. Model-based adapters

2.2.2. The HelloSWT_JFace program

2.2.3. Coding in JFace and SWT/JFace

2.2.4. The ApplicationWindow class

2.3. Beginning the WidgetWindow application

2.4. Summary

3. Widgets: part 1

3.1. Introducing the Widget and Control classes

3.1.1. Understanding the Widget class

3.1.2. Working with Control objects

3.2. Labels

3.2.1. Styles and separators

3.2.2. Label methods

3.3. Involving the user with buttons

3.3.1. Causing action with push buttons and SWT.PUSH

3.3.2. Moving on with arrow buttons and SWT.ARROW

3.3.3. Changing state with toggle buttons and SWT.TOGGLE

3.3.4. Choosing with check buttons and SWT.CHECK

3.3.5. Making a single choice with radio buttons and SWT.RADIO

3.4. Containing components with Composites

3.4.1. Understanding the Composite class

3.4.2. Groups

3.4.3. SashForms

3.4.4. TabFolders

3.5. Updating WidgetWindow

3.5.1. Creating the Ch3_Composite class

3.5.2. Creating the WidgetWindow TabFolder

3.6. Summary

4. Working with events

4.1. Event processing in SWT

4.1.1. Using typed listeners and events

4.1.2. Adapters

4.1.3. Keyboard events

4.1.4. Customizing event processing with untyped events

4.1.5. An SWT listener/event application

4.2. Event processing in JFace

4.2.1. Understanding actions and contributions

4.2.2. Creating Action classes

4.2.3. Implementing contributions in an ApplicationWindow

4.2.4. Interfacing with contributions

4.2.5. Exploring the Action class

4.3. Updating the WidgetWindow

4.3.1. Building the chapter 4 Composite

4.3.2. Adding Ch4_Composite to the WidgetWindow

4.4. Summary

5. More widgets

5.1. Editing text with SWT

5.1.1. The basic Text widget

5.1.2. The StyledText widget

5.2. JFace text support

5.2.1. Obtaining the JFace text packages

5.2.2. TextViewer and Document

5.2.3. A JFace example

5.3. The Combo widget

5.4. ToolBarManager

5.4.1. ControlContribution

5.4.2. Creating toolbars by hand

5.5. CoolBar

5.6. Slider

5.7. ProgressBar

5.8. ProgressIndicator

5.9. Summary

6. Layouts

6.1. The fill layout

6.2. The row layout

6.2.1. Customizing individual layout cells

6.3. The grid layout

6.3.1. GridData

6.4. The form layout

6.4.1. Using FormData

6.4.2. Specifying relations using FormAttachment

6.4.3. Laying out controls using a form layout

6.5. Custom layouts

6.5.1. Calculating the layout’s size

6.5.2. Laying out the widgets

6.5.3. Updating WidgetWindow

6.6. Summary

7. Graphics

7.1. The graphic context

7.1.1. Creating a GC object

7.1.2. Drawing shapes on a Canvas

7.1.3. Painting and PaintEvents

7.1.4. Clipping and Canvas styles

7.2. Programming with colors

7.2.1. Color development with SWT

7.2.2. Additional color capability with JFace

7.3. Displaying text with fonts

7.3.1. Using fonts with SWT

7.3.2. Coding with fonts

7.3.3. Improved font management with JFace

7.4. Incorporating images in graphics

7.4.1. Allocating images

7.4.2. Coding graphics with images

7.4.3. Creating a bitmap with ImageData

7.4.4. Manipulating images with ImageData

7.4.5. Managing images with JFace

7.5. Updating the WidgetWindow

7.5.1. Building the chapter 7 composite

7.5.2. Adding Ch7_Composite to the WidgetWindow

7.6. Summary

8. Working with trees and lists

8.1. Viewers and the Viewer framework

8.1.1. Providers

8.1.2. Listeners

8.1.3. Filters and sorters

8.2. Trees

8.2.1. SWT trees

8.2.2. JFace TreeViewers

8.3. Using the List widget

8.3.1. SWT lists

8.3.2. JFace ListViewers

8.4. Updating WidgetWindow

8.5. Summary

9. Tables and menus

9.1. Tables

9.1.1. Understanding SWT tables

9.1.2. JFace TableViewers

9.2. Creating menus

9.2.1. Accelerator keys

9.2.2. Creating menus in SWT

9.2.3. Using JFace actions to add to menus

9.3. Updating WidgetWindow

9.4. Summary

10. Dialogs

10.1. SWT dialogs

10.1.1. ColorDialog

10.1.2. DirectoryDialog

10.1.3. FileDialog

10.1.4. FontDialog

10.1.5. MessageBox

10.2. JFace dialogs

10.2.1. Message dialogs

10.2.2. Error dialogs

10.2.3. Input dialogs

10.2.4. Progress monitor dialogs

10.2.5. Custom dialogs

10.3. Updating WidgetWindow

10.4. Summary

11. Wizards

11.1. Multipage dialogs

11.1.1. IDialogPage

11.1.2. IWizardPage

11.1.3. WizardPage

11.2. The wizard

11.2.1. IWizard

11.2.2. Wizard

11.3. Putting it all together

11.3.1. Wizard containers

11.3.2. WizardDialog

11.4. Combining wizards

11.4.1. WizardSelectionPage

11.4.2. IWizardNode

11.5. Persistent wizard data

11.5.1. DialogSettings

11.6. Updating WidgetWindow

11.7. Summary

12. Advanced features

12.1. Transferring data

12.1.1. The Transfer class

12.1.2. Drag-and-drop capability

12.1.3. Using the clipboard

12.1.4. The filesystem browser

12.2. Preferences

12.2.1. Preference pages

12.2.2. Field editors

12.2.3. Preference page containers

12.2.4. Persistent preferences

12.3. Label decorators

12.3.1. ILabelDecorator

12.3.2. DecoratingLabelProvider

12.3.3. An example

12.4. The Browser widget

12.5. Summary

13. Looking beyond SWT/JFace: the Rich Client Platform

13.1. Understanding RCP workbenches

13.1.1. Entering data with editors

13.1.2. Displaying information with views

13.1.3. Combining editors and views with perspectives

13.2. RCP: Looking under the hood

13.2.1. Creating and configuring an RCP project

13.2.2. Building the application class

13.2.3. Adding a WorkbenchAdvisor

13.3. Adding views and perspectives

13.3.1. Building views

13.3.2. Arranging workbench windows with a perspective

13.3.3. Executing an RCP application

13.3.4. Reviewing the RCP process

13.4. Populating forms with Eclipse Forms widgets

13.4.1. Using FormToolkit and the Eclipse Forms containers

13.5. Building a standalone RCP application

13.5.1. Exporting RCPExample to an application directory

13.5.2. Adding plug-ins to the application directory

13.5.3. Executing the application

13.6. Summary

Appendix A: Creating projects with SWT/JFace

Appendix B: OLE and ActiveX in SWT/JFace

Appendix C: Changeable GUIs with Draw2D

Appendix D: The Graphical Editing Framework (GEF)


About the Technology

SWT and JFace are Eclipse's graphical libraries. They enable you to build nimble and powerful Java GUIs—but this is only the beginning. With Draw2D and the Graphical Editing Framework, you can go beyond static applications and create full-featured editors. And with the Rich Client Platform, you can build customized workbenches whose capabilities far exceed those of traditional interfaces.

What's inside

  • Understanding SWT/JFace design
  • Creating workbenches with the Rich Client Platform
  • Building editors with Draw2D and the Graphical Editing Framework
  • Integrating SWT with Microsoft's COM
  • And much more

About the authors

Matthew Scarpino has over ten years of software design and engineering experience. He uses Eclipse to build editing software for reconfigurable computing and has submitted code for Eclipse's graphical library. He lives in Fort Worth, TX.

Stephen Holder is a software engineer who has worked as a consultant for several large commercial and government agencies on enterprise level Java projects, including writing Eclipse plugins to streamline the development process. He currently resides in Tustin, California.

Stanford Ng is the cofounder of Nuglu, LLC and currently working on improving back-end systems at Automotive.com, a top 5 automotive e-commerce site. He is also a co-conspirator with Dr. Robert Nideffer behind the International award-winning Proxy/MAM research project.

Laurent Michalkovic is a technology consultant with 10 years' experience designing solutions in C/C++/Java/COM. He currently lives between Vancouver and Toronto, Canada.

combo $44.95 pBook + eBook
eBook $35.99 pdf + ePub + kindle

FREE domestic shipping on three or more pBooks

I recommend this book to anyone getting into development with the Eclipse libraries.

Steve Gutz, Senior Software Developer, IBM, author of Up to Speed with Swing

I really enjoy the authors' style. It was easy to read, and the information stayed with me.

Carl Hume, Software Architect

... a good and useful treatment. There is no other book like it in the market.

Robert D. McGovern, co-author of Eclipse in Action