796 |
currentValue, |
currentValue, |
797 |
-1, |
-1, |
798 |
isPressed, |
isPressed, |
799 |
isPressed); |
hasFocus); |
800 |
if (! comboBox.isEnabled()) |
if (! comboBox.isEnabled()) |
801 |
comp.setEnabled(false); |
comp.setEnabled(false); |
802 |
|
|
1127 |
*/ |
*/ |
1128 |
public void intervalRemoved(ListDataEvent e) |
public void intervalRemoved(ListDataEvent e) |
1129 |
{ |
{ |
1130 |
// must determine if the size of the combo box should change |
|
1131 |
// FIXME: need to implement |
// recalculate display size of the JComboBox. |
1132 |
|
largestItemSize = getLargestItemSize(); |
1133 |
|
comboBox.repaint(); |
1134 |
} |
} |
1135 |
} |
} |
1136 |
|
|
1144 |
{ |
{ |
1145 |
} |
} |
1146 |
|
|
1147 |
|
/** |
1148 |
|
* This method is invoked whenever bound property of JComboBox changes. |
1149 |
|
*/ |
1150 |
public void propertyChange(PropertyChangeEvent e) |
public void propertyChange(PropertyChangeEvent e) |
1151 |
{ |
{ |
1152 |
if (e.getPropertyName().equals(JComboBox.ENABLED_CHANGED_PROPERTY)) |
if (e.getPropertyName().equals(JComboBox.ENABLED_CHANGED_PROPERTY)) |
1153 |
{ |
{ |
|
// disable arrow button |
|
1154 |
arrowButton.setEnabled(comboBox.isEnabled()); |
arrowButton.setEnabled(comboBox.isEnabled()); |
1155 |
|
|
1156 |
if (comboBox.isEditable()) |
if (comboBox.isEditable()) |
1173 |
comboBox.revalidate(); |
comboBox.revalidate(); |
1174 |
comboBox.repaint(); |
comboBox.repaint(); |
1175 |
} |
} |
1176 |
|
else if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY)) |
1177 |
|
{ |
1178 |
|
// remove ListDataListener from old model and add it to new model |
1179 |
|
ComboBoxModel oldModel = (ComboBoxModel) e.getOldValue(); |
1180 |
|
if (oldModel != null) |
1181 |
|
oldModel.removeListDataListener(listDataListener); |
1182 |
|
|
1183 |
|
if ((ComboBoxModel) e.getNewValue() != null) |
1184 |
|
comboBox.getModel().addListDataListener(listDataListener); |
1185 |
|
} |
1186 |
|
|
1187 |
// FIXME: Need to handle changes in other bound properties. |
// FIXME: Need to handle changes in other bound properties. |
1188 |
} |
} |