diff --git a/src/antidote/org/apache/tools/ant/gui/modules/edit/DtdAttributePropertyEditor.java b/src/antidote/org/apache/tools/ant/gui/modules/edit/DtdAttributePropertyEditor.java index 718e94391..73f11a8c7 100644 --- a/src/antidote/org/apache/tools/ant/gui/modules/edit/DtdAttributePropertyEditor.java +++ b/src/antidote/org/apache/tools/ant/gui/modules/edit/DtdAttributePropertyEditor.java @@ -181,13 +181,14 @@ public class DtdAttributePropertyEditor extends AbstractPropertyEditor { */ private void updateComboBox() { _combo.removeAllItems(); + ArrayList array = new ArrayList(); // Add the optional attributes String[] valueArray = _attributes.getOptionalAttributes(); if (valueArray != null) { for(int i = 0; i < valueArray.length; i++) { if (_attributes.getProperty(valueArray[i]) == null) { - _combo.addItem(valueArray[i]); + array.add(valueArray[i]); } } } @@ -197,10 +198,15 @@ public class DtdAttributePropertyEditor extends AbstractPropertyEditor { if (valueArray != null) { for(int i = 0; i < valueArray.length; i++) { if (_attributes.getProperty(valueArray[i]) == null) { - _combo.addItem(valueArray[i]); + array.add(valueArray[i]); } } } + + Collections.sort(array); + for(int i = 0; i < array.size(); i++) { + _combo.addItem(array.get(i)); + } } /**