ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meta...@locus.apache.org
Subject cvs commit: jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs ACSBeanDescriptor.java ACSProjectElementBeanInfo.java ACSPropertyElement.java ACSPropertyElementBeanInfo.java ACSTargetElementBeanInfo.java ACSTaskElementBeanInfo.java ACSTreeNodeElement.java BaseBeanInfo.java
Date Thu, 16 Nov 2000 22:38:41 GMT
metasim     00/11/16 14:38:41

  Modified:    src/antidote/org/apache/tools/ant/gui/acs
                        ACSBeanDescriptor.java
                        ACSProjectElementBeanInfo.java
                        ACSPropertyElement.java
                        ACSPropertyElementBeanInfo.java
                        ACSTargetElementBeanInfo.java
                        ACSTaskElementBeanInfo.java ACSTreeNodeElement.java
                        BaseBeanInfo.java
  Log:
  Changed mechanism by which the PropertyEditor editor is instantiated so that it
  uses whatever class is retured by BeanDescriptor.getCustomizerClass() rather
  than assuming DynamicCustomizer. This will allow BeanSpecific customizers to be
  used in leu of the DynamicCustomizer.
  
  Also finally figured out the IllegalAccessException problem with calling the
  NodeList methods in the ACSTreeNodeElement classes, which turned out only to
  happen when jikes was used for compiling. Implemented a work around.
  
  Revision  Changes    Path
  1.2       +2 -3      jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSBeanDescriptor.java
  
  Index: ACSBeanDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSBeanDescriptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ACSBeanDescriptor.java	2000/11/10 20:41:12	1.1
  +++ ACSBeanDescriptor.java	2000/11/16 22:38:40	1.2
  @@ -59,13 +59,12 @@
   /**
    * Specialized BeanDescriptor for providing more descriptive information.
    * 
  - * @version $Revision: 1.1 $ 
  + * @version $Revision: 1.2 $ 
    * @author Simeon Fitch 
    */
   class ACSBeanDescriptor extends BeanDescriptor {
  -    
       public ACSBeanDescriptor(BaseBeanInfo type) {
  -        super(type.getType());
  +        super(type.getType(), type.getCustomizerType());
           setDisplayName(
               type.getResources().getString(type.getClass(), "beanName"));
           setShortDescription(
  
  
  
  1.3       +17 -1     jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSProjectElementBeanInfo.java
  
  Index: ACSProjectElementBeanInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSProjectElementBeanInfo.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ACSProjectElementBeanInfo.java	2000/11/11 04:52:20	1.2
  +++ ACSProjectElementBeanInfo.java	2000/11/16 22:38:40	1.3
  @@ -53,12 +53,13 @@
    */
   package org.apache.tools.ant.gui.acs;
   
  +import org.apache.tools.ant.gui.customizer.DynamicCustomizer;
   import java.beans.*;
   
   /**
    * BeanInfo for the ACSProjectElement class.
    * 
  - * @version $Revision: 1.2 $ 
  + * @version $Revision: 1.3 $ 
    * @author Simeon Fitch 
    */
   public class ACSProjectElementBeanInfo extends BaseBeanInfo {
  @@ -79,6 +80,15 @@
       }
   
   	/** 
  +	 * Get the customizer type.
  +	 * 
  +	 * @return Customizer type.
  +	 */
  +    public Class getCustomizerType() {
  +        return Customizer.class;
  +    }
  +
  +	/** 
   	 * Get the property descriptors.
   	 * 
        * @return Property descriptors.
  @@ -117,4 +127,10 @@
           return retval;
       }
   
  +    /** Customizer for this bean info. */
  +    public static class Customizer extends DynamicCustomizer {
  +        public Customizer() {
  +            super(ACSProjectElement.class);
  +        }
  +    }
   }
  
  
  
  1.2       +2 -2      jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSPropertyElement.java
  
  Index: ACSPropertyElement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSPropertyElement.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ACSPropertyElement.java	2000/11/11 04:54:04	1.1
  +++ ACSPropertyElement.java	2000/11/16 22:38:40	1.2
  @@ -58,7 +58,7 @@
   /**
    * Element containing a property definition.
    * 
  - * @version $Revision: 1.1 $ 
  + * @version $Revision: 1.2 $ 
    * @author Simeon Fitch 
    */
   public class ACSPropertyElement extends ACSTreeNodeElement {
  @@ -85,10 +85,10 @@
           String file = getFile();
   
           if(file == null || file.trim().length() == 0) {
  -            return "Property: " + getName();
  +            return "property: " + getName();
           }
           else {
  -            return "Property File: " + file;
  +            return "property file: " + file;
           }
       }
   
  
  
  
  1.2       +16 -0     jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSPropertyElementBeanInfo.java
  
  Index: ACSPropertyElementBeanInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSPropertyElementBeanInfo.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ACSPropertyElementBeanInfo.java	2000/11/11 04:54:04	1.1
  +++ ACSPropertyElementBeanInfo.java	2000/11/16 22:38:40	1.2
  @@ -53,12 +53,13 @@
    */
   package org.apache.tools.ant.gui.acs;
   
  +import org.apache.tools.ant.gui.customizer.DynamicCustomizer;
   import java.beans.*;
   
   /**
    * BeanInfo for the ACSPropertyElement class.
    * 
  - * @version $Revision: 1.1 $ 
  + * @version $Revision: 1.2 $ 
    * @author Simeon Fitch 
    */
   public class ACSPropertyElementBeanInfo extends BaseBeanInfo {
  @@ -79,6 +80,15 @@
       }
   
   	/** 
  +	 * Get the customizer type.
  +	 * 
  +	 * @return Customizer type.
  +	 */
  +    public Class getCustomizerType() {
  +        return Customizer.class;
  +    }
  +
  +	/** 
   	 * Get the property descriptors.
   	 * 
        * @return Property descriptors.
  @@ -113,4 +123,10 @@
           return retval;
       }
   
  +    /** Customizer for this bean info. */
  +    public static class Customizer extends DynamicCustomizer {
  +        public Customizer() {
  +            super(ACSPropertyElement.class);
  +        }
  +    }
   }
  
  
  
  1.3       +18 -1     jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSTargetElementBeanInfo.java
  
  Index: ACSTargetElementBeanInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSTargetElementBeanInfo.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ACSTargetElementBeanInfo.java	2000/11/11 04:52:21	1.2
  +++ ACSTargetElementBeanInfo.java	2000/11/16 22:38:41	1.3
  @@ -52,13 +52,14 @@
    * <http://www.apache.org/>.
    */
   package org.apache.tools.ant.gui.acs;
  +import org.apache.tools.ant.gui.customizer.DynamicCustomizer;
   
   import java.beans.*;
   
   /**
    * BeanInfo for the ACSTargetElement class.
    * 
  - * @version $Revision: 1.2 $ 
  + * @version $Revision: 1.3 $ 
    * @author Simeon Fitch 
    */
   public class ACSTargetElementBeanInfo extends BaseBeanInfo {
  @@ -79,6 +80,15 @@
       }
   
   	/** 
  +	 * Get the customizer type.
  +	 * 
  +	 * @return Customizer type.
  +	 */
  +    public Class getCustomizerType() {
  +        return Customizer.class;
  +    }
  +
  +	/** 
   	 * Get the property descriptors.
   	 * 
        * @return Property descriptors.
  @@ -127,4 +137,11 @@
           return retval;
       }
   
  +
  +    /** Customizer for this bean info. */
  +    public static class Customizer extends DynamicCustomizer {
  +        public Customizer() {
  +            super(ACSTargetElement.class);
  +        }
  +    }
   }
  
  
  
  1.2       +16 -0     jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSTaskElementBeanInfo.java
  
  Index: ACSTaskElementBeanInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSTaskElementBeanInfo.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ACSTaskElementBeanInfo.java	2000/11/11 04:54:04	1.1
  +++ ACSTaskElementBeanInfo.java	2000/11/16 22:38:41	1.2
  @@ -53,12 +53,13 @@
    */
   package org.apache.tools.ant.gui.acs;
   
  +import org.apache.tools.ant.gui.customizer.DynamicCustomizer;
   import java.beans.*;
   
   /**
    * BeanInfo for the ACSTaskElement class.
    * 
  - * @version $Revision: 1.1 $ 
  + * @version $Revision: 1.2 $ 
    * @author Simeon Fitch 
    */
   public class ACSTaskElementBeanInfo extends BaseBeanInfo {
  @@ -79,6 +80,15 @@
       }
   
   	/** 
  +	 * Get the customizer type.
  +	 * 
  +	 * @return Customizer type.
  +	 */
  +    public Class getCustomizerType() {
  +        return Customizer.class;
  +    }
  +
  +	/** 
   	 * Get the property descriptors.
   	 * 
        * @return Property descriptors.
  @@ -111,4 +121,10 @@
           return retval;
       }
   
  +    /** Customizer for this bean info. */
  +    public static class Customizer extends DynamicCustomizer {
  +        public Customizer() {
  +            super(ACSTaskElement.class);
  +        }
  +    }
   }
  
  
  
  1.2       +16 -4     jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSTreeNodeElement.java
  
  Index: ACSTreeNodeElement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSTreeNodeElement.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ACSTreeNodeElement.java	2000/11/10 20:41:12	1.1
  +++ ACSTreeNodeElement.java	2000/11/16 22:38:41	1.2
  @@ -55,6 +55,7 @@
   
   
   import org.w3c.dom.Node;
  +import org.w3c.dom.NodeList;
   import com.sun.xml.tree.ElementNode;
   import javax.swing.tree.TreeNode;
   import java.util.*;
  @@ -62,7 +63,7 @@
   /**
    * Abstract base class for all ACSElement classes that are also tree node.
    * 
  - * @version $Revision: 1.1 $ 
  + * @version $Revision: 1.2 $ 
    * @author Simeon Fitch 
    */
   public abstract class ACSTreeNodeElement extends ACSElement 
  @@ -80,9 +81,20 @@
           if(_treeNodeCache == null) {
               _treeNodeCache = new ArrayList();
               
  -            for(int i = 0; i < getLength(); i++) {
  -                if(item(i) instanceof TreeNode) {
  -                    _treeNodeCache.add(item(i));
  +            // XXX this crazy casting is to get around an
  +            // inconsistency between jikes and javac whereby
  +            // the call without this cast when compiled with
  +            // jikes causes an IllegalAccessException
  +            // because the implementation of getLength() and
  +            // item() are actually in a package only class
  +            // in the Sun implementation classes.
  +            int len = ((NodeList)this).getLength();
  +
  +            for(int i = 0; i < len; i++) {
  +                Object n = ((NodeList)this).item(i);
  +
  +                if(n instanceof TreeNode) {
  +                    _treeNodeCache.add(n);
                   }
               }
           }
  
  
  
  1.4       +8 -1      jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/BaseBeanInfo.java
  
  Index: BaseBeanInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/BaseBeanInfo.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BaseBeanInfo.java	2000/11/16 21:46:31	1.3
  +++ BaseBeanInfo.java	2000/11/16 22:38:41	1.4
  @@ -62,7 +62,7 @@
   /**
    * Abstract base class for ACS BeanInfo classes.
    * 
  - * @version $Revision: 1.3 $ 
  + * @version $Revision: 1.4 $ 
    * @author Simeon Fitch 
    */
   abstract class BaseBeanInfo extends SimpleBeanInfo {
  @@ -133,6 +133,13 @@
   	 * @return Type.
   	 */
       public abstract Class getType();
  +
  +	/** 
  +	 * Get the type of the customizer to use. 
  +	 * 
  +	 * @return Customizer to use.
  +	 */
  +    public abstract Class getCustomizerType();
   
       /**
        * Gets the beans <code>PropertyDescriptor</code>s.
  
  
  

Mime
View raw message