1 |
/* BasicComboBoxUI.java -- |
/* BasicComboBoxUI.java -- |
2 |
Copyright (C) 2004 Free Software Foundation, Inc. |
Copyright (C) 2004, 2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
1146 |
*/ |
*/ |
1147 |
public void propertyChange(PropertyChangeEvent e) |
public void propertyChange(PropertyChangeEvent e) |
1148 |
{ |
{ |
1149 |
if (e.getPropertyName().equals(JComboBox.ENABLED_CHANGED_PROPERTY)) |
if (e.getPropertyName().equals("enabled")) |
1150 |
{ |
{ |
1151 |
arrowButton.setEnabled(comboBox.isEnabled()); |
arrowButton.setEnabled(comboBox.isEnabled()); |
1152 |
|
|
1154 |
comboBox.getEditor().getEditorComponent().setEnabled(comboBox |
comboBox.getEditor().getEditorComponent().setEnabled(comboBox |
1155 |
.isEnabled()); |
.isEnabled()); |
1156 |
} |
} |
1157 |
else if (e.getPropertyName().equals(JComboBox.EDITABLE_CHANGED_PROPERTY)) |
else if (e.getPropertyName().equals("editable")) |
1158 |
{ |
{ |
1159 |
if (comboBox.isEditable()) |
if (comboBox.isEditable()) |
1160 |
{ |
{ |
1170 |
comboBox.revalidate(); |
comboBox.revalidate(); |
1171 |
comboBox.repaint(); |
comboBox.repaint(); |
1172 |
} |
} |
1173 |
else if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY)) |
else if (e.getPropertyName().equals("dataModel")) |
1174 |
{ |
{ |
1175 |
// remove ListDataListener from old model and add it to new model |
// remove ListDataListener from old model and add it to new model |
1176 |
ComboBoxModel oldModel = (ComboBoxModel) e.getOldValue(); |
ComboBoxModel oldModel = (ComboBoxModel) e.getOldValue(); |