Browse Source

sort elements in the combobox

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268937 13f79535-47bb-0310-9956-ffa450edef68
master
nickdavis 24 years ago
parent
commit
53ddc59ecc
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      src/antidote/org/apache/tools/ant/gui/modules/edit/DtdAttributePropertyEditor.java

+ 8
- 2
src/antidote/org/apache/tools/ant/gui/modules/edit/DtdAttributePropertyEditor.java View File

@@ -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));
}
}

/**


Loading…
Cancel
Save