SWT Standard Widget Toolkit - Development Resources

SWT Component Development Resources
Index
Bugs
Documents
Plug-ins

The SWT component consists of the following plug-ins (follow link to access code in CVS):

The 3.0 javadoc for the SWT packages can be accessed below:

Experimental OpenGL Plug-in

An OpenGL plug-in has been developed and is available for download here. The plugin consists of a library that provides bindings for all native OpenGL functions, and the classes that facilitate the use of these bindings for drawing on an SWT Canvas. Note that this plug-in is purely experimental in nature and is not intended to be part of the standard SWT distribution.
Mailing Lists
Port Status
This section has capsule summaries of all SWT ports whose status is known. (Note: the headings are of the form "os/ws".)

aix/motif
Running well. Accessibility support is still required.

You can run SWT applications using the VM from IBM Developer Kit for AIX version 1.3.0 or greater. The IBM Developer Kit for AIX can be downloaded from: http://www.ibm.com/developerworks/java/jdk/aix/service.html . Note that to run eclipse a VM of version 1.4.2 or greater is required.

To run SWT applications on AIX, you must ensure that your AIX install includes the necessary service updates. Please use the following command to determine the service level of an AIX fileset on your machine:

  • lslpp -l | grep FilesetName

Please see the section below that corresponds to your AIX release.

AIX Version 4.3.3:
For fileset X11.base.lib:

  • If service level < 4.3.3.79, you must apply APAR IY27694

For fileset X11.motif.lib:
  • If service level > 4.3.3.81, you must apply APAR IY41939

AIX Version 5.1:
For fileset X11.base.lib:

  • If service level < 5.1.0.25, you must apply APAR IY27695

For fileset X11.motif.lib:
  • If service level > 5.1.0.36, you must apply APAR IY41942

AIX Version 5.2:
For fileset X11.motif.lib:

  • If service level > 5.2.0.0, you must apply APAR IY41944

IBM APARs can be downloaded from:
http://techsupport.services.ibm.com/server/fixes

hpux/motif
Running well. Accessibility support is still required.

On HP-UX, the JVM process that runs the SWT application does not always terminate upon closing the workbench. This can be fixed by passing the -XdoCloseWithReadPending VM option to the VM on startup.

linux/gtk
The GTK port of SWT is based on GTK2. It is feature complete except for printing support. It is stable but there is an ongoing GTK performance investigation.

linux/motif
The performance of this port is now comparable to win32 version for most uses. Accessibility support is still required.

linux/qt
SWT for Qt/E will be included in the next release of the IBM WebSphere Micro Environment and WebSphere Customer Environment products. We are currently working on determining the feasibility of releasing SWT for Qt/E to the Eclipse project.

macos/carbon
The Mac OS X port of SWT is based on Carbon and runs on Jaguar and Panther. It is stable but needs performance tuning. Printing and Drag and Drop were added in release 3.0. Drag and Drop is only supported within the same application (not between applications). The Browser widget requires Panther and embeds the Safari browser.

qnx/photon
Running reasonably, but needs performance tuning. QNX has a hard limit on file name lengths (48 characters) that may be hit by some Eclipse users. Accessibility, Drag and Drop and Printing support is still required.

solaris/gtk
The GTK port of SWT is based on GTK2. It is feature complete except for printing support. It is stable but there is an ongoing GTK performance investigation.

solaris/motif
Running well. No obvious problems other than some poor default font choices. Accessibility support is still required.

win32/win32
The win32 version is stable and feature complete. Incremental bug fixing is going on, and some new development, but our focus is largely on the other platforms.

win32-ce/win32
Essentially complete with respect to the embedded subset of SWT. No outstanding serious issues. Note: This is an *embedded* SWT target only; we are not (yet) attempting to make Eclipse run on WinCE. We are actively working to decrease the size of both the jar and the dll.
Test Plan

The current version of the test plan is updated to reflect the current release under development.

Tools

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

  • Sleak plug-in for Eclipse (zip file)
    • Requires Eclipse 2.1.0 or later.
    • Extract the zip file above into the eclipse/plugins/ folder.
    • Copy the .option file from eclipse/plugins/org.eclipse.ui/ to the eclipse/ folder.
    • Add the following lines to the .options file:
      org.eclipse.ui/debug=true
      org.eclipse.ui/trace/graphics=true
    • Launch Eclipse with the "-clean -debug" option on the command line.
  • Sleak for standalone applications (Sleak.java)

JniGen is a tool that generates JNI wrappers for creating the SWT Platform Interface.

  • Retrieve the org.eclipse.swt.tools project from dev.eclipse.org.
  • Run the org.eclipse.swt.tools.internal.JNIGeneratorAppUI class inside the JNI Generation folder.

SWT Spy plug-in for Eclipse is a simple tool that prints out information about the widget under the cursor. Currently, this includes style, layout and parent information.

  • Requires Eclipse 3.0 or later.
  • Extract org.eclipse.swt.spy_1.0.0.zip into the eclipse/plugins/ folder.
  • Launch eclipse with "-clean" argument (clears caches so eclipse will pick up new plugin).
  • Open the SWT Spy view (Window -> Show View -> Other ... -> Tools -> SWT Spy.
  • Enable collection of info by clicking on the "Monitor" button in Spy view.
  • Move cursor over the control of interest and see data printed in Spy view.
  • To start or stop data collection while over a control, toggle the monitor action using ALT+SHIFT+".".
Snippets

There have been a significant number of small example code fragments posted to the newsgroup which provide insights into some aspect of SWT programming. This section is an attempt to capture these for future reference. Most of these have been written by one of the SWT committers, but in some cases they were created by modifying examples provided by other readers of the newsgroup. For simplicity, no attempt has been made to attribute these to a particular author. If you see something you wrote here, and want that to be noted, please email platform-swt-dev@eclipse.org and a by-line will be added.

You should also remember that examples from the newsgroup are often edited for brevity rather than completeness. They are intended to guide the reader towards the correct solution, rather than be finished products. NOTE: Snippets are tested against the HEAD stream and may reference new API or require bug fixes from there.

Note also that the best way to report an SWT bug is to write your own snippet showing the problem and paste it into the bug report. For a snippet template, see: "What is a snippet?" in the SWT FAQ.

If you are new to SWT and need help compiling and running snippets, click here for instructions.

Snippets for Pocket PC