Excerpt
When we began this book, our Grand Vision was to create a complete reference for every aspect of SWT. It was not until we began identifying the range of topics that we would need to cover that we realized that SWT is
big--not big in size but big in terms of features, uses, and the energy that is behind it. The community that has built up around SWT has pushed it in many directions, everything from PDAs, to stand-alone desktop applications on several platforms, to Eclipse and the many commercial IDEs that have been built from it. We had to narrow the focus.
We decided to cover only those aspects of SWT that every developer would need to know.
- How to get and install SWT and how to invoke it from your programs.
- The fundamental systems that make up SWT: mouse and keyboard handling, graphical user interface components, drawing routines, etc.
- The native operating system-based user interface controls.
These topics, covered in depth and with many examples, are exactly what you will find on the following pages.
To give you some idea of the scope of the original problem, here are some of the topics that we are not going to cover in detail.
- Frameworks built from SWT (e.g., JFace and GEF)
- Coding patterns specific to using SWT in Eclipse
- The custom widgets package created for Eclipse
- Drag-and-drop and clipboard support
- Platform-specific features, such as OLE support on Windows
- Building your own new widgets, dialogs, and layouts
- Bidirectional language (BIDI) support
- Implementation strategies used by SWT
- The HTML browser widget
- Printing
- OpenGL support
We touch on these topics when they come up in context and attempt to provide pointers to more information, but as one of our reviewers said, "It cries out for a Volume 2." We are aware of this. Once we get this one out the door and have enough time to remember who our families are again, we will start thinking about it.
Another very interesting element of this book is the inclusion of some of the history behind SWT and the design decisions that led to it having the shape that it does. We felt that, as two of the original designers, we could provide a better insight into this than you are likely to find elsewhere. Although this content represents only a small portion of the total, we hope that you find it interesting.
Contributing to SWT
As you learn more about SWT, it is worth keeping in mind that SWT is not a closed system. If you are new to the open source community, you may be used to thinking in terms of code libraries coming from "somewhere else," in which you have little say in the design, direction, or development. SWT, and indeed the entire Eclipse project, follows a different path.
SWT is supported by a community of developers. Anyone who wants to contribute time and energy can become part of that community. The first step is to keep in mind that whenever you find what you think is a bug in SWT, you should enter a Bugzilla report that describes the problem at https://bugs.eclipse.org/bugs/. SWT developers like bug reports and use them to communicate and organize their work.
If the bug that you have found (or any other bug, for that matter) is causing you grief, ask a question on the SWT newsgroup and start a discussion about it. Given that the entire source for SWT is available, you can also try to fix the problem by doing the following.
- Figuring out what is wrong.
- Changing your copy of the SWT code to make it stop happening.
- Attaching a patch that shows the changes to the Bugzilla report.
If you get stuck, ask the other developers whether they have suggestions. The best place to have this discussion is on the developer's mailing list, which you can find by following the links from http://www.eclipse.org/mail/index.php.
The SWT developers look at every patch that is submitted. Because they have a wide understanding of the implications of a given change, you may be asked to submit a new patch that takes into account aspects of the problem that you missed. Keep trying. When you get to the point where the other developers trust that code you submit can be added and it is clear that you are going to continue to contribute, a vote will be taken to give you the right to change the SWT source that everyone uses. This is called earning your commit rights. If any of this appeals to you, go for it. We would love to have your help!