Working with Other Tree Styles

So far, the examples have used just the SWT.SINGLE tree style. The Tree class also supports other styles. SWT.MULTI creates a tree that enables the user to make multiple selections. This is of limited use in Tree-type interfaces, which normally permit only one item in the tree to be active at a time (again, Windows Explorer is an example; you can work only in one folder at a time).

SWT.CHECK-style Tree objects are another matter. SWT.CHECK creates a Tree whose items have a checkbox incorporated, as in Figure 13-6.

The CHECK-style tree

Figure 13-6. The CHECK-style tree

Get SWT: A Developer's Notebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.