ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nickda...@apache.org
Subject cvs commit: jakarta-ant/src/antidote/org/apache/tools/ant/gui/modules/edit DtdAttributePropertyEditor.java
Date Wed, 11 Apr 2001 20:41:31 GMT
nickdavis    01/04/11 13:41:31

  Modified:    src/antidote/org/apache/tools/ant/gui/modules/edit
                        DtdAttributePropertyEditor.java
  Log:
  sort elements in the combobox
  
  Revision  Changes    Path
  1.2       +8 -2      jakarta-ant/src/antidote/org/apache/tools/ant/gui/modules/edit/DtdAttributePropertyEditor.java
  
  Index: DtdAttributePropertyEditor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/modules/edit/DtdAttributePropertyEditor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DtdAttributePropertyEditor.java	2001/04/06 15:54:01	1.1
  +++ DtdAttributePropertyEditor.java	2001/04/11 20:41:30	1.2
  @@ -66,7 +66,7 @@
   /**
    * Custom property editor for the DtdAttributes.
    *
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    * @author Nick Davis<a href="mailto:nick_home_account@yahoo.com">nick_home_account@yahoo.com</a>
    */
   public class DtdAttributePropertyEditor extends AbstractPropertyEditor {
  @@ -181,13 +181,14 @@
        */
       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,9 +198,14 @@
           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));
           }
       }
   
  
  
  

Mime
View raw message