diff options
author | nickdavis <dev-null@apache.org> | 2001-04-11 20:41:30 +0000 |
---|---|---|
committer | nickdavis <dev-null@apache.org> | 2001-04-11 20:41:30 +0000 |
commit | 53ddc59eccb9ca398bcc74db1fc1577bde5b7d45 (patch) | |
tree | befbd0c0f7596c79be8f3ea0d70951a12637bcc5 /src/antidote | |
parent | 3e8ba142125f04a71a3b50221a38d3daa2d802cd (diff) | |
download | ant-53ddc59eccb9ca398bcc74db1fc1577bde5b7d45.tar.gz |
sort elements in the combobox
git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268937 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/antidote')
-rw-r--r-- | src/antidote/org/apache/tools/ant/gui/modules/edit/DtdAttributePropertyEditor.java | 10 |
1 files changed, 8 insertions, 2 deletions
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)); + } } /** |