DekGenius.com
Previous Section  < Day Day Up >  Next Section

Recipe 8.1 Working with SWT Widgets

8.1.1 Problem

You want to work with SWT, but you need to know what widgets are available to work with.

8.1.2 Solution

See Table 8-1, which lists all the SWT widgets, as well as their styles and events.

8.1.3 Discussion

As a starting point for our work on SWT, Table 8-1 provides a reference for all the SWT widgets.

Table 8-1. The SWT widgets

Widget

Styles

Events

Button

BORDER, CHECK, PUSH, RADIO, TOGGLE, FLAT, LEFT, RIGHT, CENTER, ARROW (with UP, DOWN)

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize, Selection

Canvas

BORDER, H_SCROLL, V_SCROLL, NO_BACKGROUND, NO_FOCUS, NO_MERGE_PAINTS, NO_REDRAW_RESIZE, NO_RADIO_GROUP

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize

Caret

 

Dispose

Combo

BORDER, DROP_DOWN, READ_ONLY, SIMPLE

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize, DefaultSelection, Modify, Selection

Composite

BORDER, H_SCROLL, V_SCROLL

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize

CoolBar

BORDER

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize

CoolItem

DROP_DOWN

Dispose

Group

BORDER, SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_OUT, SHADOW_NONE

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize

Label

BORDER, CENTER, LEFT, RIGHT, WRAP, SEPARATOR (with HORIZONTAL, SHADOW_IN, SHADOW_OUT, SHADOW_NONE, VERTICAL)

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize

List

BORDER, H_SCROLL, V_SCROLL, SINGLE, MULTI

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize, Selection, DefaultSelection

Menu

BAR, DROP_DOWN, NO_RADIO_GROUP, POP_UP

Dispose, Help, Hide, Show

MenuItem

CHECK, CASCADE, PUSH, RADIO, SEPARATOR

Dispose, Arm, Help, Selection

ProgressBar

BORDER, INDETERMINATE, SMOOTH, HORIZONTAL, VERTICAL

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize

Sash

BORDER, HORIZONTAL, VERTICAL

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize, Selection

Scale

BORDER, HORIZONTAL, VERTICAL

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize, Selection

ScrollBar

HORIZONTAL, VERTICAL

Dispose, Selection

Shell

BORDER, H_SCROLL, V_SCROLL, CLOSE, MIN, MAX, NO_TRIM, RESIZE, TITLE (see also SHELL_TRIM, DIALOG_TRIM)

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize, Activate, Close, Deactivate, Deiconify, Iconify

Slider

BORDER, HORIZONTAL, VERTICAL

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize, Selection

TabFolder

BORDER

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize, Selection

TabItem

 

Dispose

Table

BORDER, H_SCROLL, V_SCROLL, SINGLE, MULTI, CHECK, FULL_SELECTION, HIDE_SELECTION

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize, Selection, DefaultSelection

TableColumn

LEFT, RIGHT, CENTER

Dispose, Move, Resize, Selection

TableItem

 

Dispose

Text

BORDER, SINGLE, READ_ONLY, LEFT, CENTER, RIGHT, WRAP, MULTI (with H_SCROLL, V_SCROLL)

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize, DefaultSelection, Modify, Verify

ToolBar

BORDER, FLAT, WRAP, RIGHT, SHADOW_OUT, HORIZONTAL, VERTICAL

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize,

ToolItem

PUSH, CHECK, RADIO, SEPARATOR, DROP_DOWN

Dispose, Selection

Tracker

LEFT, RIGHT, UP, DOWN, RESIZE

Dispose, Move, Resize

Tree

BORDER, H_SCROLL, V_SCROLL, SINGLE, MULTI, CHECK

Dispose, FocusIn, FocusOut, Help, KeyDown, KeyUp, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize, Selection, DefaultSelection, Collapse, Expand

TreeItem

 

Dispose


8.1.3.1 Eclipse 3.0

Eclipse 3.0 also adds a browser widget to the list of SWT widgets.

8.1.4 See Also

Chapter 7 of Eclipse (O'Reilly).

    Previous Section  < Day Day Up >  Next Section