|Java TM Look and Feel Design Guidelines: Advanced Topics > Part II: Special Topics > 2: Windows > Property Windows||
For a discussion of the remaining characteristics, see Chapter 8 of Java Look and Feel Design Guidelines , 2d ed.
Table 2 describes each main behavioral characteristic that can apply to property windows.
Only a few combinations of the characteristics in Table 2 are recommended, so choosing the correct property window characteristics is simpler than it might seem. This section describes how to make the correct choices. Later sections describe each property window characteristic in detail.
Figure 7 shows a primary window, an inspecting property window, and a non-inspecting property window.Figure 7 Property Windows and a Primary Window
For information about positioning a property window in relation to its parent window, see Positioning Secondary Windows.
Before choosing characteristics for your application's property windows, consider how users should interact with each window. A property window's intended use determines its correct window characteristics. Figure 8 helps you choose the correct characteristics for property windows.Figure 8 Steps for Choosing Property Window Characteristics
Of the sets of property window characteristics in Figure 8, only two sets are typically used in applications. Table 3 provides examples of property windows whose characteristics match those of the typical sets.
|Property Window Characteristics||Example|
A dedicated property window affects only objects already selected when the property window opened. Changing the selection while a dedicated property window is open does not change which objects the property window affects.
In contrast, a non-dedicated property window affects only objects currently selected--even if the selection changes while the property window is open. In other words, a non-dedicated property window affects whichever objects are currently selected when a user clicks the window's OK button or Apply button. In a non-dedicated property window, a user can change which objects the window affects. To do so, the user can select different objects while the window is open.
Figure 9 shows an inspecting property window.Figure 9 Inspecting Property Window
An inspecting property window displays the values of the selected object. If a user changes the selection, the values in the property window also change immediately to reflect the newly selected object. An inspecting property window continuously updates its view of an object's property values, even if those values change outside a user's control. Most inspecting property windows are modeless.
If your application has many types of objects, avoid creating a separate inspecting property window for each type. Instead, create a single inspecting property window whose contents change depending on the properties of the selected object.
If users need to update two or more interdependent property values, do not provide an inspecting property window. Instead, provide a non-inspecting property window, thereby ensuring that changes to interdependent properties occur at the same time.
Here is an example of why inspecting property windows are inappropriate for updating interdependent property values. An application has a Customer object for which users can enter an address that includes a city and country--such as Paris, France. As a user types the address, the Customer object automatically verifies that the specified city (
Paris) is in the specified country (
In an inspecting property window, if a user tries to change the city name from
Tokyo, the Customer object rejects the change because the user has not changed the country name from
Japan. If the user then tries to change the country name, the change is again rejected, because the city name has not been changed from
A non-inspecting property window is a property window that displays a static view, or snapshot, of the selected object's property values--accurate as of the time that the property window opened. Figure 10 shows a non-inspecting property window.Figure 10 Non-Inspecting Property Window
If a user changes property values in a non-inspecting property window, those changes take effect only if the user clicks the window's OK button or Apply button. Changes that take place beyond the user's control are not reflected in the window until it opens again.
To enable users to open a property window, place an item labeled Properties on the Object menu, if there is one. ( Object stands for the type of the object whose properties the window displays--for example, Document.) If your application has no Object menu, place the Properties item on the Edit menu. Label the item Object Properties if the Edit menu also contains items for other property windows.
Property windows include title text, displayed in the title bar, as shown in Figure 11.Figure 11 Title Text in the Title Bar of a Property Window
In Figure 11, the window represents an object named SuperRivet. The command that opened the window is Alloy Properties.
In property windows, format the title text as Object Name - Command , as shown in Figure 11. Object Name stands for the name of the currently displayed object. Precede the hyphen by one space and follow it by one space. Command stands for the name of the command that opened the property window.)
If a user might not know which application created a particular property window, include the application's name in that window's title text. Format the title text like this: Object Name - Command - Application Name .
(Precede each hyphen by one space and follow it by one space.)
In the title text of inspecting property windows, update the current object's name each time you update the window's contents.
Table 4 describes the command buttons you can place in non-inspecting property windows.
Closes the property window but not the application. If a user has changed the values in the window but has not applied them, the Close button opens an alert box containing the following text: "Your changes have not been saved. To save the changes, click Apply. To discard the changes, click Discard. To cancel your Close request, click Cancel."
If a user will use a property window only once before closing it, then place an OK and a Cancel button--in that order--at the bottom right of the window, as shown in Figure 12.Figure 12 Required Buttons for a Single-Use Property Window
Optionally, you can add a Help button to the right of the Cancel button, as shown in Figure 13.Figure 13 Required and Optional Buttons for a Single-Use Property Window
If a user will use a property window repeatedly before closing it, place an Apply and a Close button--in that order--at the bottom right of the window, as shown in Figure 14.Figure 14 Required Buttons for a Repeated-Use Property Window
Optionally, you can place a Reset button between the Apply button and the Close button, and place a Help button to the right of the Close button, as shown in Figure 15.Figure 15 Required and Optional Buttons for a Repeated-Use Property Window
Make the OK button or the Apply button the default command button. (For more information about default command buttons, see Chapter 10 of Java Look and Feel Design Guidelines , 2d ed.)
Open an alert box if a user clicks the Close button before applying changes entered in the window. In the alert box (which includes a Discard button), display the following text: "Your changes have not been saved. To save the changes, click Apply. To discard the changes, click Discard. To cancel your Close request, click Cancel."
Ensure that clicking the Reset button performs the following operations, in order:
Some controls do not immediately send their updates to the object being inspected. (For example, a text field does not send its updated text until it has lost input focus.) In inspecting property windows, send all pending updates to the window's object when a user clicks the window's Close button or close- window control.
|Java Look and Feel Design Guidelines: Advanced Topics.
Copyright 2001. Sun Microsystems, Inc. All Rights Reserved.