| JavaTM Look and Feel Design Guidelines: Advanced Topics > Part II: Special Topics > 5: Idioms > Container-and-Contents Idiom | ![]() |
Users sometimes need to view a hierarchy of containers--for example, a set of file folders--while also viewing the contents of a selected container--for example, the list of documents in a selected folder. You can provide this capability by using the Container-and-Contents idiom, which consists of a split pane displaying a different view in each of its two panes:
For a description of split panes, see Chapter 7 of Java Look and Feel Design Guidelines, 2d ed.
Figure 62 shows the Container-and-Contents idiom used in the upper two panes of an email application.
Figure 62 Container-and-Contents Idiom in an Email Application
In the Container-and-Contents idiom, the left and right panes work together. Changing the selection in the left pane (the tree) changes which object's contents are displayed in the right pane (the table).
In the right pane, if a user opens a subcontainer:
In Figure 62, the right pane displays the contents of only one container--labeled Inbox in the left pane--so this behavior does not apply to the figure.
The container-and-contents uses a single-selection model--that is, the selection can contain only one object at the time, although that object can be a container.
The following guidelines apply to the Container-and-Contents idiom:
Ensure that clicking a container in the left pane causes the right pane to
display that container's contents.
Ensure that double-clicking a collapsed container in the left pane expands
that container and makes its subnodes visible in the right pane. Likewise,
ensure that double-clicking an expanded container in the left pane collapses
that container and causes its subnodes to be become visible in the right pane.
| Java Look and Feel Design Guidelines: Advanced Topics.
Copyright 2001. Sun Microsystems, Inc. All Rights Reserved. |
![]() |