站内搜索: 请输入搜索关键词
当前页面: 图书首页 > SWT: The Standard Widget Toolkit

Chapter 6. Native Widgets - SWT: The Standard Widget Toolkit

Previous Section  < Day Day Up >  Next Section

Chapter 6. Native Widgets

Native widgets are the heart of SWT. We say widget here, rather than control, because this chapter and the ones that follow describe the subclasses of class Widget, which include controls but also menus, items, and other noncontrols. Because this is such a large topic, we will cover it across several chapters.

Basic Controls: the simplest controls in SWT

Tool Bars and Menus: controls that perform actions

Advanced Controls: tree, table, and tab folder controls

Range-Based Controls: controls that describe a numeric range

Controls, Composites, Groups, and Shells: the container controls

Canvas and Caret: drawing area controls

Draggable Controls: controls that can manipulate the user interface

These chapters are essentially a reference manual for the native widgets that are provided with SWT. For controls that have a particular item type[1] associated with them, the item is described with the control. For example, the section on the ToolBar control also describes the ToolItem widgets that are used with ToolBar.

[1] That is, a particular subclass of class Item (which is a subclass of class Widget).

You can certainly read through these chapters if you wish, but a better strategy might be to read just this overview, then skim over the following chapters the first time you read the book. Then go through the details of the sections that describe the widgets that your application will use (and their superclasses). As you work with the native widgets, you can use these chapters as a reference. Each section contains the following.

  1. One or more example screenshots showing what the widget looks like

  2. A picture showing the class hierarchy for the widget

  3. A table of the style constants supported by the widget

  4. A table of the events implemented by the widget[2]

    [2] The table in the Typed Listeners section of the Widget Fundamentals chapter shows the mapping between untyped and typed events for all widgets.

  5. Several sections that describe the usage and API of the widget

Note that in the interest of brevity, the two tables describe only the styles and event types that are added by the widget. To see the full list of supported styles and events, you need to follow the class hierarchy up to class Widget.

The usage sections describe the API for the widget but in addition frequently contain useful hints about the more subtle usage patterns.

    Previous Section  < Day Day Up >  Next Section