All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----com.sgi.sysadm.ui.taskData.TaskDataBinder | +----com.sgi.sysadm.ui.taskData.StringJComboBoxBinder
The idea is that a binder should be created for each item in a JComboBox. Each binder is created with a "value" different from the other binders for the JComboBox. When the task data changes, each binder will be notified, and the one whose "value" matches the task data will make its item the current item. Conversely, when one of the items is selected, its binder updates the task data. For example:
JComboBox heartbeat = new JComboBox(); String hbOn = rs.getString("MainPage.hbOn"); String hbOff = rs.getString("MainPage.hbOff"); heartbeat.addItem(hbOn); heartbeat.addItem(hbOff); taskData.addTaskDataBinder(INVISIBLE_HB, new StringJComboBoxBinder(heartbeat, hbOn, CLIKeys.TRUE_VALUE)); taskData.addTaskDataBinder(INVISIBLE_HB, new StringJComboBoxBinder(heartbeat, hbOff, CLIKeys.FALSE_VALUE));
Note: The item state won't change when the user types into the combobox until the user presses the Enter key or clicks the mouse pointer outside (focus leaves the combobox). To get more dynamic item state updates, use ItemFinder instead.
public StringJComboBoxBinder(JComboBox box, Object entry, String value)
Note: The item state won't change when the user types into the combobox until the user presses the Enter key or clicks the mouse pointer outside (focus leaves the combobox). To get more dynamic item state updates, use ItemFinder instead.
public static void bind(TaskData taskData, String name, JComboBox box, Object entry, String value)
taskData.addTaskDataBinder(name,
new StringJComboBoxBinder(box, entry, value))
public void taskDataChanged(TaskDataEvent event)
All Packages Class Hierarchy This Package Previous Next Index