All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object
|
+----com.sgi.sysadm.ui.taskData.TaskDataBinder
|
+----com.sgi.sysadm.ui.taskData.LongJComboBoxBinder
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 typeBox = new JComboBox();
String stringItem = rs.getString("DataPage.stringItem");
typeBox.addItem(stringItem);
taskData.addTaskDataBinder(RESKEY_DATATYPE_INT,
new LongJComboBoxBinder(typeBox, stringItem, STR_TYPE));
String intItem = rs.getString("DataPage.intItem");
typeBox.addItem(intItem);
taskData.addTaskDataBinder(RESKEY_DATATYPE_INT,
new LongJComboBoxBinder(typeBox, intItem, INT_TYPE));
public LongJComboBoxBinder(JComboBox box,
Object item,
long value)
public static void bind(TaskData taskData,
String name,
JComboBox box,
Object item,
long value)
taskData.addTaskDataBinder(name,
new LongJComboBoxBinder(box, item, value))
public void taskDataChanged(TaskDataEvent event)
All Packages Class Hierarchy This Package Previous Next Index