metasim     01/02/09 04:39:59

  Modified:    src/antidote/org/apache/tools/ant/gui/modules
                        TargetMonitor.java
  Log:
  Applied patch from Deryk Sinotte that fixes problem with discontiguous
  selections of multiple targets.
  
  Revision  Changes    Path
  1.4       +8 -4      
jakarta-ant/src/antidote/org/apache/tools/ant/gui/modules/TargetMonitor.java
  
  Index: TargetMonitor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/modules/TargetMonitor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TargetMonitor.java        2001/01/08 19:43:46     1.3
  +++ TargetMonitor.java        2001/02/09 12:39:58     1.4
  @@ -68,7 +68,7 @@
   /**
    * A widget for displaying the currently selected targets.
    * 
  - * @version $Revision: 1.3 $ 
  + * @version $Revision: 1.4 $ 
    * @author Simeon Fitch 
    */
   public class TargetMonitor extends AntModule {
  @@ -144,13 +144,17 @@
   
               if(selected != null && selected.length > 0) {
                   StringBuffer buf = new StringBuffer();
  +                String name = null;
   
                   for(int i = 0; i < selected.length; i++) {
                       if(selected[i] instanceof ACSTargetElement) {
  -                        if(buf.length() > 0) {
  -                            buf.append(", ");
  +                        name = ((ACSTargetElement)selected[i]).getName();
  +                        if( buf.toString().indexOf( name ) < 0 ) {
  +                            if(buf.length() > 0) {
  +                                buf.append(", ");
  +                            }
  +                            buf.append( name );
                           }
  -                        
buf.append(((ACSTargetElement)selected[i]).getName());
                       }
                   }
   
  
  
  

Reply via email to