ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meta...@apache.org
Subject cvs commit: jakarta-ant/src/antidote/org/apache/tools/ant/gui/resources action.properties antidote.properties
Date Wed, 28 Mar 2001 12:26:09 GMT
metasim     01/03/28 04:26:08

  Modified:    src/antidote build.xml
               src/antidote/org/apache/tools/ant/gui/acs ACSFactory.java
                        ACSNamedElement.java ACSPropertyElement.java
                        acs-element.properties
               src/antidote/org/apache/tools/ant/gui/core
                        ActionManager.java AntAction.java
                        EventResponder.java
               src/antidote/org/apache/tools/ant/gui/event
                        ElementSelectionEvent.java
               src/antidote/org/apache/tools/ant/gui/modules/edit
                        ElementNavigator.java
               src/antidote/org/apache/tools/ant/gui/resources
                        action.properties antidote.properties
  Log:
  Applied Nick Davis' patch to support generic elements based on an Ant DTD.
  
  Revision  Changes    Path
  1.9       +1 -0      jakarta-ant/src/antidote/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/build.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- build.xml	2000/11/24 17:09:11	1.8
  +++ build.xml	2001/03/28 12:25:46	1.9
  @@ -70,6 +70,7 @@
         <fileset dir="${src.dir}">
           <include name="**/*.properties" />
           <include name="**/*.gif" />
  +        <include name="**/*.dtd" />
         </fileset>
       </copy>
   
  
  
  
  1.9       +19 -6     jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSFactory.java
  
  Index: ACSFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSFactory.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ACSFactory.java	2001/01/12 20:42:22	1.8
  +++ ACSFactory.java	2001/03/28 12:25:49	1.9
  @@ -60,9 +60,7 @@
   import org.w3c.dom.*;
   import org.xml.sax.SAXException;
   import com.sun.xml.parser.Parser;
  -import com.sun.xml.tree.SimpleElementFactory;
  -import com.sun.xml.tree.XmlDocument;
  -import com.sun.xml.tree.XmlDocumentBuilder;
  +import com.sun.xml.tree.*;
   import java.util.Properties;
   import java.util.Enumeration;
   import com.sun.xml.parser.Resolver;
  @@ -70,7 +68,7 @@
   /**
    * Factory for loading Ant Construction set elements.
    * 
  - * @version $Revision: 1.8 $ 
  + * @version $Revision: 1.9 $ 
    * @author Simeon Fitch 
    */
   public class ACSFactory {
  @@ -92,7 +90,7 @@
                   String name = (String) enum.nextElement();
                   // XXX the name of the class needs to be stored externally.
                   _elementMap.setProperty(
  -                    name, "org.apache.tools.ant.gui.acs.ACSTaskElement");
  +                    name, "org.apache.tools.ant.gui.acs.ACSDtdDefinedElement");
               }
   
               // Then we add/override the local definitions.
  @@ -164,7 +162,6 @@
               sax.parse(location.openStream(), null);
   
               doc = builder.getDocument();
  -
           }
           catch(ParserConfigurationException ex) {
               ex.printStackTrace();
  @@ -235,6 +232,22 @@
           return retval;
       }
   
  +    /** 
  +     * Create a new element.
  +     * 
  +     * @param node the Node to assign the property to.
  +     * @param name the new elements type.
  +     * @return New, unnamed property.
  +     */
  +    public ACSElement createElement(ACSElement node, String name) {
  +        ACSElement retval = (ACSElement) node.
  +            getOwnerDocument().createElement(name);
  +        // XXX fixme.
  +        indent(node, 1);
  +        node.appendChild(retval);
  +        return retval;
  +    }
  +    
       /** 
        * Insert a new line and indentation at the end of the given
        * node in preparation for a new element being added.
  
  
  
  1.4       +2 -3      jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSNamedElement.java
  
  Index: ACSNamedElement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/ACSNamedElement.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ACSNamedElement.java	2001/01/03 14:18:17	1.3
  +++ ACSNamedElement.java	2001/03/28 12:25:50	1.4
  @@ -59,10 +59,10 @@
   /**
    * Class representing an element with a name and description.
    * 
  - * @version $Revision: 1.3 $ 
  + * @version $Revision: 1.4 $ 
    * @author Simeon Fitch 
    */
  -public class ACSNamedElement extends ACSTreeNodeElement {
  +public class ACSNamedElement extends ACSDtdDefinedElement {
       /** The 'name' property name. */
       public static final String NAME = "name";
       /** The discription property name. */
  @@ -73,7 +73,6 @@
   	 * 
   	 */
       public ACSNamedElement() {
  -
       }
   
   	/** 
  
  
  
  1.5       +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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ACSPropertyElement.java	2001/01/03 14:18:17	1.4
  +++ ACSPropertyElement.java	2001/03/28 12:25:51	1.5
  @@ -58,10 +58,10 @@
   /**
    * Element containing a property definition.
    * 
  - * @version $Revision: 1.4 $ 
  + * @version $Revision: 1.5 $ 
    * @author Simeon Fitch 
    */
  -public class ACSPropertyElement extends ACSTreeNodeElement {
  +public class ACSPropertyElement extends ACSDtdDefinedElement {
       /** The 'name' property name. */
       public static final String NAME = "name";
       /** The 'value' property name. */
  
  
  
  1.4       +14 -12    jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/acs-element.properties
  
  Index: acs-element.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/acs/acs-element.properties,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- acs-element.properties	2000/12/14 23:03:25	1.3
  +++ acs-element.properties	2001/03/28 12:25:52	1.4
  @@ -1,12 +1,14 @@
  -#
  -# Property file mapping DOM nodes to Java class names.
  -#
  -
  -# The default element
  -*Element=org.apache.tools.ant.gui.acs.ACSDefaultElement
  -
  -# Specific elements.
  -project=org.apache.tools.ant.gui.acs.ACSProjectElement
  -property=org.apache.tools.ant.gui.acs.ACSPropertyElement
  -target=org.apache.tools.ant.gui.acs.ACSTargetElement
  -task=org.apache.tools.ant.gui.acs.ACSTaskElement
  +#
  +# Property file mapping DOM nodes to Java class names.
  +#
  +
  +# The default element
  +*Element=org.apache.tools.ant.gui.acs.ACSDtdDefinedElement
  +
  +# Specific elements.
  +project=org.apache.tools.ant.gui.acs.ACSProjectElement
  +property=org.apache.tools.ant.gui.acs.ACSPropertyElement
  +target=org.apache.tools.ant.gui.acs.ACSTargetElement
  +task=org.apache.tools.ant.gui.acs.ACSTaskElement
  +
  +
  
  
  
  1.6       +50 -15    jakarta-ant/src/antidote/org/apache/tools/ant/gui/core/ActionManager.java
  
  Index: ActionManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/core/ActionManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ActionManager.java	2001/03/12 19:51:33	1.5
  +++ ActionManager.java	2001/03/28 12:25:56	1.6
  @@ -66,12 +66,14 @@
    * Manager of antidote actions. Receives its configuration from the action
    * ResourceBundle.
    *
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    * @author Simeon Fitch
    */
   public class ActionManager {
       /** Parameters for the Command constructor. */
       private static final Class[] COMMAND_CTOR_PARAMS = { AppContext.class };
  +    private static final Class[] COMMAND_CTOR_PARAMS_WITH_EVENT =
  +        { AppContext.class, EventObject.class };
   
       /** Externalized resources. */
       private ResourceManager _resources = null;
  @@ -207,6 +209,12 @@
   
           for(int i = 0; i < _actionIDs.length; i++) {
               AntAction action = (AntAction) _actions.get(_actionIDs[i]);
  +            
  +            // If the action is hidden do not display it.
  +            if(action.isHidden()) {
  +                continue;
  +            }
  +            
               // If it has an icon, then we add it to the toolbar.
               if(action.getIcon() != null) {
                   if(action.isPreceededBySeparator()) {
  @@ -232,51 +240,78 @@
           return retval;
       }
   
  -	/**
  +	/** 
   	 * Create a popup menu with the given actionIDs.
  -     * XXX check this for object leak. Does the button
  -     * get added to the action as a listener? There are also some
  -     * changes to this behavior in 1.3.
  -	 *
  +         * XXX check this for object leak. Does the button
  +         * get added to the action as a listener? There are also some
  +         * changes to this behavior in 1.3.
  +	 * 
   	 * @param actionIDs List of action IDs for actions
  -     *  to appear in popup menu.
  +         *  to appear in popup menu.
  +	 * @param defaultID Use this action ID if the item 
  +         * from the list is not found.
   	 * @return Popup menu to display.
   	 */
  -    public JPopupMenu createPopup(String[] actionIDs) {
  +    public JPopupMenu createPopup(String[] actionIDs, String defaultID) {
  +       
           JPopupMenu retval = new JPopupMenu();
   
           for(int i = 0; i < actionIDs.length; i++) {
               AntAction action = (AntAction) _actions.get(actionIDs[i]);
  -            if(action != null) {
  +            
  +            // If the ID is not found, use the default.
  +            if (action == null && defaultID != null) {
  +                action = (AntAction) _actions.get(defaultID);
                   AbstractButton button = retval.add(action);
  +                
  +                // Set the button text to the action ID.
  +                button.setText(actionIDs[i]);
                   addNiceStuff(button, action);
  +            } else {
  +                if(action.isPopupPreceededBySeparator() &&
  +                    retval.getComponentCount() > 0) {
  +                    retval.addSeparator();
  +                }
  +                
  +                AbstractButton button = retval.add(action);
  +                addNiceStuff(button, action);
               }
           }
   
           return retval;
       }
   
  -	/**
  +	/** 
   	 * Get the command assocaited with the Action with the given id.
  -	 *
  +	 * 
   	 * @param actionID Id of action to get command for.
   	 * @return Command associated with action, or null if none available.
   	 */
  -    public Command getActionCommand(String actionID, AppContext context) {
  +    public Command getActionCommand(String actionID,
  +                                    AppContext context,
  +                                    EventObject event) {
           Command retval = null;
           AntAction action = (AntAction) _actions.get(actionID);
           if(action != null) {
               Class clazz = action.getCommandClass();
               if(clazz != null) {
                   try {
  -                    Constructor ctor =
  +                    Constructor ctor = 
                           clazz.getConstructor(COMMAND_CTOR_PARAMS);
                       retval = (Command) ctor.newInstance(
                           new Object[] { context });
                   }
                   catch(Exception ex) {
  -                    // XXX log me.
  -                    ex.printStackTrace();
  +                    try {
  +                        Constructor ctor = clazz.getConstructor(
  +                            COMMAND_CTOR_PARAMS_WITH_EVENT);
  +                        retval = (Command) ctor.newInstance(
  +                            new Object[] { context, event });
  +                    }
  +                    catch (Exception ex2) {
  +                        // XXX log me.
  +                        ex.printStackTrace();
  +                    }
                   }
               }
           }
  
  
  
  1.5       +27 -1     jakarta-ant/src/antidote/org/apache/tools/ant/gui/core/AntAction.java
  
  Index: AntAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/core/AntAction.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AntAction.java	2001/03/12 19:51:34	1.4
  +++ AntAction.java	2001/03/28 12:25:57	1.5
  @@ -66,13 +66,14 @@
   /**
    * Class representing an action in the Antidote application.
    *
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    * @author Simeon Fitch
    */
   public class AntAction extends AbstractAction {
       /** Property name for the parent menu item. */
       public static final String PARENT_MENU_NAME = "parentMenuName";
       public static final String SEPARATOR = "separator";
  +    public static final String POPUP_SEPARATOR = "popupSeparator";
       public static final String ACCELERATOR = "accelerator";
       public static final String ENABLED = "enabled";
       public static final String ENABLE_ON = "enableOn";
  @@ -81,6 +82,7 @@
       public static final String CHECKED_TRUE_ON = "checkedTrueOn";
       public static final String CHECKED_FALSE_ON = "checkedFalseOn";
       public static final String COMMAND = "command";
  +    public static final String HIDDEN = "hidden";
   
       /** Property resources. */
       private  ResourceManager _resources =  null;
  @@ -118,6 +120,8 @@
           putValue(SHORT_DESCRIPTION, getString("shortDescription"));
           putValue(PARENT_MENU_NAME, getString(PARENT_MENU_NAME));
           putValue(SEPARATOR, getString(SEPARATOR));
  +        putValue(POPUP_SEPARATOR, getString(POPUP_SEPARATOR));
  +        putValue(HIDDEN, getString(HIDDEN));
   
   
           // Set the default enabled state.
  @@ -268,6 +272,28 @@
           return (Icon) getValue(SMALL_ICON);
       }
   
  +    /** 
  +     * Determine if a separator should appear before the action
  +     * when the popup menu is created.
  +     * 
  +     * @return True if add separator, false otherwise.
  +     */
  +    public boolean isPopupPreceededBySeparator() {
  +        return Boolean.valueOf(
  +            String.valueOf(getValue(POPUP_SEPARATOR))).booleanValue();
  +    }
  +    
  +    /** 
  +     * Determine if the action is hidden and should not
  +     * be displayed from a button.
  +     * 
  +     * @return True the action is hidden.
  +     */
  +    public boolean isHidden() {
  +        return Boolean.valueOf(
  +            String.valueOf(getValue(HIDDEN))).booleanValue();
  +    }
  +    
   	/**
   	 * Get the accelerator keystroke.
   	 *
  
  
  
  1.3       +2 -3      jakarta-ant/src/antidote/org/apache/tools/ant/gui/core/EventResponder.java
  
  Index: EventResponder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/core/EventResponder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EventResponder.java	2001/01/03 14:18:20	1.2
  +++ EventResponder.java	2001/03/28 12:25:58	1.3
  @@ -63,7 +63,7 @@
    * The purpose of this class is to watch for events that require some sort
    * of action, like opening a file.
    * 
  - * @version $Revision: 1.2 $ 
  + * @version $Revision: 1.3 $ 
    * @author Simeon Fitch 
    */
   public class EventResponder {
  @@ -113,9 +113,8 @@
            */
           public boolean eventPosted(EventObject event) {
               String command = ((ActionEvent)event).getActionCommand();
  -
               Command cmd = 
  -                _context.getActions().getActionCommand(command, _context);
  +                _context.getActions().getActionCommand(command, _context, event);
               if(cmd != null) {
                   cmd.run();
                   return false;
  
  
  
  1.7       +164 -160  jakarta-ant/src/antidote/org/apache/tools/ant/gui/event/ElementSelectionEvent.java
  
  Index: ElementSelectionEvent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/event/ElementSelectionEvent.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ElementSelectionEvent.java	2001/01/08 19:43:38	1.6
  +++ ElementSelectionEvent.java	2001/03/28 12:26:01	1.7
  @@ -1,160 +1,164 @@
  -/*
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer.
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  - *
  - * 3. The end-user documentation included with the redistribution, if
  - *    any, must include the following acknowlegement:
  - *       "This product includes software developed by the
  - *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowlegement may appear in the software itself,
  - *    if and wherever such third-party acknowlegements normally appear.
  - *
  - * 4. The names "The Jakarta Project", "Ant", and "Apache Software
  - *    Foundation" must not be used to endorse or promote products derived
  - *    from this software without prior written permission. For written
  - *    permission, please contact apache@apache.org.
  - *
  - * 5. Products derived from this software may not be called "Apache"
  - *    nor may "Apache" appear in their names without prior written
  - *    permission of the Apache Group.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation.  For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  - */
  -package org.apache.tools.ant.gui.event;
  -import org.apache.tools.ant.gui.acs.*;
  -import org.apache.tools.ant.gui.command.Command;
  -import org.apache.tools.ant.gui.command.DisplayErrorCmd;
  -import org.apache.tools.ant.gui.core.AppContext;
  -
  -import java.lang.reflect.Array;
  -import java.util.*;
  -
  -/**
  - * Event indicating that the current set of selected targets has changed.
  - * 
  - * @version $Revision: 1.6 $ 
  - * @author Simeon Fitch 
  - */
  -public class ElementSelectionEvent extends AntEvent {
  -
  -    /** New set of selected elements. */
  -    private ACSElement[] _selected = null;
  -
  -	/** 
  -	 * Standard ctor.
  -	 * 
  -	 * @param context application context.
  -     * @param selected the selected Elements.
  -	 */
  -    protected ElementSelectionEvent(AppContext context, 
  -                                    ACSElement[] selected) {
  -        super(context);
  -        _selected = selected;
  -    }
  -
  -	/** 
  -	 * Current set of selected elements.
  -	 * 
  -     * @return selected element set.
  -	 */
  -    public ACSElement[] getSelectedElements() {
  -        return _selected;
  -    }
  -
  -
  -    /** 
  -     * Get only those events of a specific type.
  -     * 
  -     * @param type Specific type to get values for, or null if none.
  -     */
  -    protected ACSElement[] getFiltered(Class type) {
  -        ACSElement[] retval = null;
  -        List vals = new ArrayList(1);
  -        if(_selected != null) {
  -            for(int i = 0; i < _selected.length; i++) {
  -                if(type.isInstance(_selected[i])) {
  -                    vals.add(_selected[i]);
  -                }
  -            }
  -        }
  -
  -        if(vals.size() > 0) {
  -            retval = (ACSElement[]) Array.newInstance(type, vals.size());
  -            vals.toArray(retval);
  -        }
  -        return retval;
  -    }
  -
  -	/** 
  -	 * Factory method for creating the appropriate specialization of this
  -     * for communicating an element selection.
  -	 * 
  -	 * @param context App context.
  -	 * @param selected The set of selected events. The last elemetn in the 
  -     *                 array is used to determine the specialization of this
  -     *                 that should be returned.
  -	 * @return Event to communicate selection to.
  -	 */
  -    public static ElementSelectionEvent createEvent(AppContext context, 
  -                                                    ACSElement[] selected) {
  -        ElementSelectionEvent retval = null;
  -
  -        if(selected != null && selected.length > 0) {
  -            Class type = selected[selected.length - 1].getClass();
  -            if(type.isAssignableFrom(ACSTargetElement.class)) {
  -                retval = new TargetSelectionEvent(context, selected);
  -            }
  -            else if(type.isAssignableFrom(ACSTaskElement.class)) {
  -                retval = new TaskSelectionEvent(context, selected);
  -            }
  -            else if(type.isAssignableFrom(ACSPropertyElement.class)) {
  -                retval = new PropertySelectionEvent(context, selected);
  -            }
  -            else if(type.isAssignableFrom(ACSProjectElement.class)) {
  -                retval = new ProjectSelectedEvent(
  -                    context, (ACSProjectElement) selected[0]);
  -            }
  -            else {
  -                // For elements without a specific event
  -                // type just send and instance of this.
  -                retval = new ElementSelectionEvent(context, selected);
  -            }
  -        }
  -        else {
  -            retval = new NullSelectionEvent(context);
  -        }
  -
  -        return retval;
  -    }
  -}
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution, if
  + *    any, must include the following acknowlegement:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowlegement may appear in the software itself,
  + *    if and wherever such third-party acknowlegements normally appear.
  + *
  + * 4. The names "The Jakarta Project", "Ant", and "Apache Software
  + *    Foundation" must not be used to endorse or promote products derived
  + *    from this software without prior written permission. For written
  + *    permission, please contact apache@apache.org.
  + *
  + * 5. Products derived from this software may not be called "Apache"
  + *    nor may "Apache" appear in their names without prior written
  + *    permission of the Apache Group.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
  +package org.apache.tools.ant.gui.event;
  +import org.apache.tools.ant.gui.acs.*;
  +import org.apache.tools.ant.gui.command.Command;
  +import org.apache.tools.ant.gui.command.DisplayErrorCmd;
  +import org.apache.tools.ant.gui.core.AppContext;
  +
  +import java.lang.reflect.Array;
  +import java.util.*;
  +
  +/**
  + * Event indicating that the current set of selected targets has changed.
  + * 
  + * @version $Revision: 1.7 $ 
  + * @author Simeon Fitch 
  + */
  +public class ElementSelectionEvent extends AntEvent {
  +
  +    /** New set of selected elements. */
  +    private ACSElement[] _selected = null;
  +
  +	/** 
  +	 * Standard ctor.
  +	 * 
  +	 * @param context application context.
  +     * @param selected the selected Elements.
  +	 */
  +    protected ElementSelectionEvent(AppContext context, 
  +                                    ACSElement[] selected) {
  +        super(context);
  +        _selected = selected;
  +    }
  +
  +	/** 
  +	 * Current set of selected elements.
  +	 * 
  +     * @return selected element set.
  +	 */
  +    public ACSElement[] getSelectedElements() {
  +        return _selected;
  +    }
  +
  +
  +    /** 
  +     * Get only those events of a specific type.
  +     * 
  +     * @param type Specific type to get values for, or null if none.
  +     */
  +    protected ACSElement[] getFiltered(Class type) {
  +        ACSElement[] retval = null;
  +        List vals = new ArrayList(1);
  +        if(_selected != null) {
  +            for(int i = 0; i < _selected.length; i++) {
  +                if(type.isInstance(_selected[i])) {
  +                    vals.add(_selected[i]);
  +                }
  +            }
  +        }
  +
  +        if(vals.size() > 0) {
  +            retval = (ACSElement[]) Array.newInstance(type, vals.size());
  +            vals.toArray(retval);
  +        }
  +        return retval;
  +    }
  +
  +	/** 
  +	 * Factory method for creating the appropriate specialization of this
  +     * for communicating an element selection.
  +	 * 
  +	 * @param context App context.
  +	 * @param selected The set of selected events. The last elemetn in the 
  +     *                 array is used to determine the specialization of this
  +     *                 that should be returned.
  +	 * @return Event to communicate selection to.
  +	 */
  +    public static ElementSelectionEvent createEvent(AppContext context, 
  +                                                    ACSElement[] selected) {
  +        ElementSelectionEvent retval = null;
  +
  +        if(selected != null && selected.length > 0) {
  +            Class type = selected[selected.length - 1].getClass();
  +            if(ACSTargetElement.class.isAssignableFrom(type)) {
  +                retval = new TargetSelectionEvent(context, selected);
  +            }
  +            else if(ACSTaskElement.class.isAssignableFrom(type)) {
  +                retval = new TaskSelectionEvent(context, selected);
  +            }
  +            else if(ACSPropertyElement.class.isAssignableFrom(type)) {
  +                retval = new PropertySelectionEvent(context, selected);
  +            }
  +            else if(ACSProjectElement.class.isAssignableFrom(type)) {
  +                retval = new ProjectSelectedEvent(
  +                    context, (ACSProjectElement) selected[0]);
  +            }
  +            else if(ACSDtdDefinedElement.class.isAssignableFrom(type)) {
  +                retval = new DtdDefinedElementSelectionEvent(
  +                    context, selected);
  +            }
  +            else {
  +                // For elements without a specific event
  +                // type just send and instance of this.
  +                retval = new ElementSelectionEvent(context, selected);
  +            }
  +        }
  +        else {
  +            retval = new NullSelectionEvent(context);
  +        }
  +
  +        return retval;
  +    }
  +}
  
  
  
  1.6       +71 -12    jakarta-ant/src/antidote/org/apache/tools/ant/gui/modules/edit/ElementNavigator.java
  
  Index: ElementNavigator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/modules/edit/ElementNavigator.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ElementNavigator.java	2001/01/12 19:02:46	1.5
  +++ ElementNavigator.java	2001/03/28 12:26:03	1.6
  @@ -68,7 +68,7 @@
   /**
    * Module for navigating build file elemenets.
    * 
  - * @version $Revision: 1.5 $ 
  + * @version $Revision: 1.6 $ 
    * @author Simeon Fitch 
    */
   public class ElementNavigator extends AntModule {
  @@ -138,6 +138,9 @@
                   // The project node has changed.
                   model.fireNodeChanged((ACSElement)event.getSource());
               }
  +            else if(event instanceof RefreshDisplayEvent && model != null) {
  +                _tree.updateUI();
  +            }
               else if(event instanceof NewElementEvent && model != null) {
                   ACSElement element = ((NewElementEvent)event).getNewElement();
                   model.fireNodeAdded(element);
  @@ -145,6 +148,9 @@
                   _selections.setSelectionPath(path);
                   _tree.scrollPathToVisible(path);
               }
  +            else if(event instanceof DeleteElementEvent && model != null) {
  +                _tree.updateUI();
  +            }
               else {
                   ACSProjectElement project = null;
                   if(event instanceof ProjectSelectedEvent) {
  @@ -163,11 +169,31 @@
                       ElementSelectionEvent.createEvent(getContext(), null);
                   }
                   else {
  -                    _tree.setModel(new ElementTreeModel(project));
  -                    _selections = new ElementTreeSelectionModel();
  -                    _selections.addTreeSelectionListener(
  -                        new SelectionForwarder());
  -                    _tree.setSelectionModel(_selections);
  +                    boolean updateModel = false;
  +                    TreeModel testModel = _tree.getModel();
  +                    
  +                    // Set the model if's not an ElementTreeModel
  +                    if (testModel instanceof ElementTreeModel) {
  +                        ElementTreeModel etm = (ElementTreeModel) testModel;
  +                        ACSProjectElement currentProject = 
  +                            (ACSProjectElement) etm.getRoot();
  +                        
  +                        // Set the model if the project is wrong
  +                        if (currentProject != project) {
  +                            updateModel = true;
  +                        }
  +                    } else {
  +                        updateModel = true;
  +                    }
  +
  +                    // Should we update the tree model
  +                    if (updateModel) {
  +                        _tree.setModel(new ElementTreeModel(project));
  +                        _selections = new ElementTreeSelectionModel();
  +                        _selections.addTreeSelectionListener(
  +                            new SelectionForwarder());
  +                        _tree.setSelectionModel(_selections);
  +                    }
                   }
               }
               return true;
  @@ -195,7 +221,9 @@
               return event instanceof ProjectSelectedEvent ||
                   event instanceof ProjectClosedEvent ||
                   event instanceof NewElementEvent ||
  -                event instanceof PropertyChangeEvent;
  +                event instanceof PropertyChangeEvent ||
  +                event instanceof DeleteElementEvent ||
  +                event instanceof RefreshDisplayEvent;
           }
       }
   
  @@ -203,11 +231,42 @@
       private class PopupHandler extends MouseAdapter {
           private void handle(MouseEvent e) {
               if(e.isPopupTrigger()) {
  -                ActionManager mgr = getContext().getActions();
  -                JPopupMenu menu = mgr.createPopup(
  -                    getContext().getResources().getStringArray(
  -                        ElementNavigator.class, "popupActions"));
  -                menu.show((JComponent)e.getSource(), e.getX(), e.getY());
  +                Object source = e.getSource();
  +                String[] menuStr = null;
  +                JTree tree = (JTree) source;
  +                
  +                // Find the selected path.
  +                TreePath selPath = tree.getPathForLocation(
  +                    e.getX(), e.getY());
  +                if (selPath == null) {
  +                    return;
  +                }
  +
  +                // Update the selection. 
  +                tree.setSelectionPath(selPath);
  +
  +                // Find the selected object.
  +                Object selObj = selPath.getLastPathComponent();
  +
  +                String defaultID = null;
  +                
  +                // Does the item provide its own menu?
  +                if (selObj instanceof ACSInfoProvider) {
  +                    ACSInfoProvider ip = (ACSInfoProvider) selObj;
  +                    menuStr = ip.getMenuString();
  +                    defaultID = ip.getDefaultActionID();
  +                } else {
  +                    // Get the menu from the prop file.
  +                    menuStr = getContext().getResources().getStringArray(
  +                        ElementNavigator.class, defaultID);
  +                }
  +
  +                // Should we create a menu?
  +                if (menuStr != null && menuStr.length != 0) {
  +                    ActionManager mgr = getContext().getActions();
  +                    JPopupMenu menu = mgr.createPopup(menuStr, defaultID);
  +                    menu.show((JComponent)e.getSource(), e.getX(), e.getY());
  +                }
               }
           }
   
  
  
  
  1.17      +185 -166  jakarta-ant/src/antidote/org/apache/tools/ant/gui/resources/action.properties
  
  Index: action.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/resources/action.properties,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- action.properties	2001/03/12 19:51:42	1.16
  +++ action.properties	2001/03/28 12:26:06	1.17
  @@ -1,166 +1,185 @@
  -# Define the primary menubar items.
  -menus=File, View, Build, Projects, Help
  -
  -# Declare the list of known actions.
  -actions=\
  -    new, open, save, saveas, close, exit, about, \
  -    newTarget, newTask, newProperty \
  -    startBuild, stopBuild, viewConsole
  -
  -# Configure the decalred actions.
  -new.name=New Project...
  -new.shortDescription=Create a new project
  -new.parentMenuName=File
  -new.icon=new-project.gif
  -new.accelerator=control N
  -new.enabled=true
  -new.command=org.apache.tools.ant.gui.command.NewProjectCmd
  -
  -open.name=Open...
  -open.shortDescription=Open an existing project
  -open.parentMenuName=File
  -open.icon=open.gif
  -open.accelerator=control O
  -open.enabled=true
  -open.command=org.apache.tools.ant.gui.command.OpenCmd
  -
  -save.name=Save
  -save.shortDescription=Save the current project
  -save.parentMenuName=File
  -save.icon=save.gif
  -save.accelerator=control S
  -save.command=org.apache.tools.ant.gui.command.SaveCmd
  -save.enabled=false
  -save.disableOn= \
  -    org.apache.tools.ant.gui.event.ProjectClosedEvent, \
  -    org.apache.tools.ant.gui.event.BuildStartedEvent
  -save.enableOn= \
  -    org.apache.tools.ant.gui.event.ProjectSelectedEvent, \
  -    org.apache.tools.ant.gui.event.NewProjectEvent, \
  -    org.apache.tools.ant.gui.event.BuildFinishedEvent
  -
  -saveas.name=Save As...
  -saveas.shortDescription=Save to a specific file
  -saveas.parentMenuName=File
  -saveas.command=org.apache.tools.ant.gui.command.SaveAsCmd
  -saveas.enabled=false
  -saveas.disableOn= \
  -    org.apache.tools.ant.gui.event.ProjectClosedEvent, \
  -    org.apache.tools.ant.gui.event.BuildStartedEvent
  -saveas.enableOn= \
  -    org.apache.tools.ant.gui.event.ProjectSelectedEvent, \
  -    org.apache.tools.ant.gui.event.NewProjectEvent, \
  -    org.apache.tools.ant.gui.event.BuildFinishedEvent
  -
  -close.name=Close
  -close.shortDescription=Close the current project
  -close.parentMenuName=File
  -close.command=org.apache.tools.ant.gui.command.CloseCmd
  -close.enabled=false
  -close.disableOn= \
  -    org.apache.tools.ant.gui.event.ProjectClosedEvent, \
  -    org.apache.tools.ant.gui.event.BuildStartedEvent
  -close.enableOn= \
  -    org.apache.tools.ant.gui.event.ProjectSelectedEvent, \
  -    org.apache.tools.ant.gui.event.NewProjectEvent, \
  -    org.apache.tools.ant.gui.event.BuildFinishedEvent
  -
  -exit.name=Exit
  -exit.shortDescription=Quit the application
  -exit.parentMenuName=File
  -exit.separator=true
  -exit.command=org.apache.tools.ant.gui.command.ExitCmd
  -exit.enabled=true
  -
  -about.name=About...
  -about.shortDescription=About this application
  -about.parentMenuName=Help
  -about.separator=true;
  -about.enabled=true
  -about.command=org.apache.tools.ant.gui.command.AboutCmd
  -
  -startBuild.name=Start Build
  -startBuild.shortDescription=Start build of selected target
  -startBuild.parentMenuName=Build
  -startBuild.icon=start.gif
  -startBuild.separator=true
  -startBuild.accelerator=control B
  -startBuild.command=org.apache.tools.ant.gui.command.BuildCmd
  -startBuild.enabled=false
  -startBuild.enableOn=\
  -    org.apache.tools.ant.gui.event.ProjectSelectedEvent, \
  -    org.apache.tools.ant.gui.event.NewProjectEvent, \
  -    org.apache.tools.ant.gui.event.BuildFinishedEvent
  -startBuild.disableOn=\
  -    org.apache.tools.ant.gui.event.BuildStartedEvent, \
  -    org.apache.tools.ant.gui.event.ProjectClosedEvent
  -
  -stopBuild.name=Stop Build
  -stopBuild.shortDescription=Stop the current build
  -stopBuild.parentMenuName=Build
  -stopBuild.icon=stop.gif
  -stopBuild.accelerator=control K
  -stopBuild.enabled=false
  -stopBuild.enableOn=\
  -    org.apache.tools.ant.gui.event.BuildStartedEvent
  -stopBuild.disableOn=\
  -    org.apache.tools.ant.gui.event.BuildFinishedEvent
  -
  -newTarget.name=New Target
  -newTarget.shortDescription=Create a new target
  -newTarget.icon=new-target.gif
  -newTarget.enabled=false
  -newTarget.separator=true
  -newTarget.command=org.apache.tools.ant.gui.command.NewTargetCmd
  -newTarget.enableOn=\
  -    org.apache.tools.ant.gui.event.ProjectSelectedEvent, \
  -    org.apache.tools.ant.gui.event.NewProjectEvent
  -newTarget.disableOn=\
  -    org.apache.tools.ant.gui.event.TargetSelectionEvent, \
  -    org.apache.tools.ant.gui.event.TaskSelectionEvent, \
  -    org.apache.tools.ant.gui.event.PropertySelectionEvent, \
  -    org.apache.tools.ant.gui.event.ProjectClosedEvent, \
  -    org.apache.tools.ant.gui.event.NullSelectionEvent
  -
  -newTask.name=New Task
  -newTask.shortDescription=Create a new task under the selected target
  -newTask.icon=new-task.gif
  -newTask.enabled=false
  -newTask.command=org.apache.tools.ant.gui.command.NewTaskCmd
  -newTask.enableOn=\
  -    org.apache.tools.ant.gui.event.TargetSelectionEvent
  -newTask.disableOn=\
  -    org.apache.tools.ant.gui.event.ProjectClosedEvent, \
  -    org.apache.tools.ant.gui.event.TaskSelectionEvent, \
  -    org.apache.tools.ant.gui.event.PropertySelectionEvent, \
  -    org.apache.tools.ant.gui.event.NullSelectionEvent
  -
  -newProperty.name=New Property
  -newProperty.shortDescription=Create a new property under the selected element
  -newProperty.icon=new-property.gif
  -newProperty.command=org.apache.tools.ant.gui.command.NewPropertyCmd
  -newProperty.enabled=false
  -newProperty.enableOn=\
  -    org.apache.tools.ant.gui.event.ProjectSelectedEvent, \
  -    org.apache.tools.ant.gui.event.NewProjectEvent, \
  -    org.apache.tools.ant.gui.event.TargetSelectionEvent, \
  -    org.apache.tools.ant.gui.event.TaskSelectionEvent
  -newProperty.disableOn=\
  -    org.apache.tools.ant.gui.event.PropertySelectionEvent, \
  -    org.apache.tools.ant.gui.event.ProjectClosedEvent, \
  -    org.apache.tools.ant.gui.event.NullSelectionEvent
  -
  -viewConsole.name=console
  -viewConsole.shortDescription=Displays or hides the console pane
  -viewConsole.parentMenuName=View
  -viewConsole.icon=console.gif
  -viewConsole.separator=true
  -viewConsole.accelerator=control C
  -viewConsole.enabled=true
  -viewConsole.toggle=true
  -viewConsole.initalToggleValue=true
  -viewConsole.command=org.apache.tools.ant.gui.command.ShowOrHideConsoleCmd
  -viewConsole.checkedTrueOn=\
  -    org.apache.tools.ant.gui.event.ConsoleVisibleEvent
  -viewConsole.checkedFalseOn=\
  -    org.apache.tools.ant.gui.event.ConsoleNotVisibleEvent
  +# Define the primary menubar items.
  +menus=File, View, Build, Projects, Help
  +
  +# Declare the list of known actions.
  +actions=\
  +    new, open, save, saveas, close, exit, about, \
  +    newTarget, newElement, newProperty, deleteElement, \
  +    startBuild, stopBuild, viewConsole
  +
  +# Configure the decalred actions.
  +new.name=New Project...
  +new.shortDescription=Create a new project
  +new.parentMenuName=File
  +new.icon=new-project.gif
  +new.accelerator=control N
  +new.enabled=true
  +new.command=org.apache.tools.ant.gui.command.NewProjectCmd
  +
  +open.name=Open...
  +open.shortDescription=Open an existing project
  +open.parentMenuName=File
  +open.icon=open.gif
  +open.accelerator=control O
  +open.enabled=true
  +open.command=org.apache.tools.ant.gui.command.OpenCmd
  +
  +save.name=Save
  +save.shortDescription=Save the current project
  +save.parentMenuName=File
  +save.icon=save.gif
  +save.accelerator=control S
  +save.command=org.apache.tools.ant.gui.command.SaveCmd
  +save.enabled=false
  +save.disableOn= \
  +    org.apache.tools.ant.gui.event.ProjectClosedEvent, \
  +    org.apache.tools.ant.gui.event.BuildStartedEvent
  +save.enableOn= \
  +    org.apache.tools.ant.gui.event.ProjectSelectedEvent, \
  +    org.apache.tools.ant.gui.event.NewProjectEvent, \
  +    org.apache.tools.ant.gui.event.BuildFinishedEvent
  +
  +saveas.name=Save As...
  +saveas.shortDescription=Save to a specific file
  +saveas.parentMenuName=File
  +saveas.command=org.apache.tools.ant.gui.command.SaveAsCmd
  +saveas.enabled=false
  +saveas.disableOn= \
  +    org.apache.tools.ant.gui.event.ProjectClosedEvent, \
  +    org.apache.tools.ant.gui.event.BuildStartedEvent
  +saveas.enableOn= \
  +    org.apache.tools.ant.gui.event.ProjectSelectedEvent, \
  +    org.apache.tools.ant.gui.event.NewProjectEvent, \
  +    org.apache.tools.ant.gui.event.BuildFinishedEvent
  +
  +close.name=Close
  +close.shortDescription=Close the current project
  +close.parentMenuName=File
  +close.command=org.apache.tools.ant.gui.command.CloseCmd
  +close.enabled=false
  +close.disableOn= \
  +    org.apache.tools.ant.gui.event.ProjectClosedEvent, \
  +    org.apache.tools.ant.gui.event.BuildStartedEvent
  +close.enableOn= \
  +    org.apache.tools.ant.gui.event.ProjectSelectedEvent, \
  +    org.apache.tools.ant.gui.event.NewProjectEvent, \
  +    org.apache.tools.ant.gui.event.BuildFinishedEvent
  +
  +exit.name=Exit
  +exit.shortDescription=Quit the application
  +exit.parentMenuName=File
  +exit.separator=true
  +exit.command=org.apache.tools.ant.gui.command.ExitCmd
  +exit.enabled=true
  +
  +about.name=About...
  +about.shortDescription=About this application
  +about.parentMenuName=Help
  +about.separator=true;
  +about.enabled=true
  +about.command=org.apache.tools.ant.gui.command.AboutCmd
  +
  +startBuild.name=Start Build
  +startBuild.shortDescription=Start build of selected target
  +startBuild.parentMenuName=Build
  +startBuild.icon=start.gif
  +startBuild.separator=true
  +startBuild.accelerator=control B
  +startBuild.command=org.apache.tools.ant.gui.command.BuildCmd
  +startBuild.enabled=false
  +startBuild.enableOn=\
  +    org.apache.tools.ant.gui.event.ProjectSelectedEvent, \
  +    org.apache.tools.ant.gui.event.NewProjectEvent, \
  +    org.apache.tools.ant.gui.event.BuildFinishedEvent
  +startBuild.disableOn=\
  +    org.apache.tools.ant.gui.event.BuildStartedEvent, \
  +    org.apache.tools.ant.gui.event.ProjectClosedEvent
  +
  +stopBuild.name=Stop Build
  +stopBuild.shortDescription=Stop the current build
  +stopBuild.parentMenuName=Build
  +stopBuild.icon=stop.gif
  +stopBuild.accelerator=control K
  +stopBuild.enabled=false
  +stopBuild.enableOn=\
  +    org.apache.tools.ant.gui.event.BuildStartedEvent
  +stopBuild.disableOn=\
  +    org.apache.tools.ant.gui.event.BuildFinishedEvent
  +
  +newTarget.name=New Target
  +newTarget.shortDescription=Create a new target
  +newTarget.icon=new-target.gif
  +newTarget.enabled=false
  +newTarget.separator=true
  +newTarget.command=org.apache.tools.ant.gui.command.NewTargetCmd
  +newTarget.enableOn=\
  +    org.apache.tools.ant.gui.event.ProjectSelectedEvent, \
  +    org.apache.tools.ant.gui.event.NewProjectEvent
  +newTarget.disableOn=\
  +    org.apache.tools.ant.gui.event.TargetSelectionEvent, \
  +    org.apache.tools.ant.gui.event.TaskSelectionEvent, \
  +    org.apache.tools.ant.gui.event.PropertySelectionEvent, \
  +    org.apache.tools.ant.gui.event.ProjectClosedEvent, \
  +    org.apache.tools.ant.gui.event.NullSelectionEvent, \
  +    org.apache.tools.ant.gui.event.DtdDefinedElementSelectionEvent
  +
  +newTask.name=New Task
  +newTask.shortDescription=Create a new task under the selected target
  +newTask.icon=new-task.gif
  +newTask.enabled=false
  +newTask.command=org.apache.tools.ant.gui.command.NewTaskCmd
  +newTask.enableOn=\
  +    org.apache.tools.ant.gui.event.TargetSelectionEvent
  +newTask.disableOn=\
  +    org.apache.tools.ant.gui.event.ProjectClosedEvent, \
  +    org.apache.tools.ant.gui.event.TaskSelectionEvent, \
  +    org.apache.tools.ant.gui.event.PropertySelectionEvent, \
  +    org.apache.tools.ant.gui.event.NullSelectionEvent, \
  +    org.apache.tools.ant.gui.event.DtdDefinedElementSelectionEvent
  +
  +newProperty.name=New Property
  +newProperty.shortDescription=Create a new property under the selected element
  +newProperty.icon=new-property.gif
  +newProperty.command=org.apache.tools.ant.gui.command.NewPropertyCmd
  +newProperty.enabled=false
  +newProperty.enableOn=\
  +    org.apache.tools.ant.gui.event.ProjectSelectedEvent, \
  +    org.apache.tools.ant.gui.event.NewProjectEvent, \
  +    org.apache.tools.ant.gui.event.TargetSelectionEvent, \
  +    org.apache.tools.ant.gui.event.TaskSelectionEvent
  +newProperty.disableOn=\
  +    org.apache.tools.ant.gui.event.PropertySelectionEvent, \
  +    org.apache.tools.ant.gui.event.ProjectClosedEvent, \
  +    org.apache.tools.ant.gui.event.NullSelectionEvent, \
  +    org.apache.tools.ant.gui.event.DtdDefinedElementSelectionEvent
  +
  +newElement.name=New Element
  +newElement.shortDescription=Create a new element under the selected element
  +newElement.icon=default.gif
  +newElement.command=org.apache.tools.ant.gui.command.NewElementCmd
  +newElement.enabled=true
  +newElement.hidden=true
  +newElement.popupSeparator=true
  +
  +deleteElement.name=Delete Element
  +deleteElement.shortDescription=Delete the selected element
  +deleteElement.icon=default.gif
  +deleteElement.command=org.apache.tools.ant.gui.command.DeleteElementCmd
  +deleteElement.enabled=true
  +deleteElement.hidden=true
  +deleteElement.popupSeparator=true
  +
  +viewConsole.name=console
  +viewConsole.shortDescription=Displays or hides the console pane
  +viewConsole.parentMenuName=View
  +viewConsole.icon=console.gif
  +viewConsole.separator=true
  +viewConsole.accelerator=control C
  +viewConsole.enabled=true
  +viewConsole.toggle=true
  +viewConsole.initalToggleValue=true
  +viewConsole.command=org.apache.tools.ant.gui.command.ShowOrHideConsoleCmd
  +viewConsole.checkedTrueOn=\
  +    org.apache.tools.ant.gui.event.ConsoleVisibleEvent
  +viewConsole.checkedFalseOn=\
  +    org.apache.tools.ant.gui.event.ConsoleNotVisibleEvent
  
  
  
  1.24      +141 -133  jakarta-ant/src/antidote/org/apache/tools/ant/gui/resources/antidote.properties
  
  Index: antidote.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/resources/antidote.properties,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- antidote.properties	2001/03/08 15:37:50	1.23
  +++ antidote.properties	2001/03/28 12:26:06	1.24
  @@ -1,133 +1,141 @@
  -# This is the general properties file for the Antidote application.
  -
  -#debug=true
  -
  -# The following four module properties configure those properties that
  -# should be initialized and displayed by default by the GUI. If more
  -# than one module is configured for a property (as indicated providing
  -# class names as a comma delimited list), then each module will appear
  -# in its own tab in a JTabbedPane.
  -
  -# Configure the modules that appear on the right of the UI.
  -org.apache.tools.ant.gui.Antidote.right.modules=\
  -	org.apache.tools.ant.gui.modules.edit.PropertyEditor
  -
  -# Configure the modules that appear on the left of the UI.
  -org.apache.tools.ant.gui.Antidote.left.modules=\
  -	org.apache.tools.ant.gui.modules.edit.ElementNavigator
  -
  -# Configure the modules that appear on the bottom of the UI.
  -org.apache.tools.ant.gui.Antidote.bottom.modules=\
  -	org.apache.tools.ant.gui.modules.console.BuildConsole
  -
  -# Configure the modules that appear on the top of the UI.
  -org.apache.tools.ant.gui.Antidote.top.modules=\
  -	org.apache.tools.ant.gui.modules.TargetMonitor
  -
  -org.apache.tools.ant.gui.modules.edit.PropertyEditor.name=Properties
  -
  -# DependentTargetChooser part of the DependentTargetPropertyEditor
  -org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.ok=OK
  -org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.cancel=Cancel
  -org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.target=Target
  -org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.description=Description
  -org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.upIcon=up.gif
  -org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.downIcon=down.gif
  -org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.addIcon=enter.gif
  -org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.removeIcon=exit.gif
  -org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.up=Move dependent target up
  -org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.down=Move dependent target down
  -org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.add=Add target to dependent list
  -org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.remove=Remove target from dependent list
  -org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.selection=Selection
  -
  -org.apache.tools.ant.gui.modules.edit.ElementNavigator.name=Project
  -org.apache.tools.ant.gui.modules.edit.ElementNavigator.popupActions=\
  -    newTarget, newTask, newProperty
  -
  -org.apache.tools.ant.gui.modules.TargetMonitor.name=Selected Target(s)
  -org.apache.tools.ant.gui.modules.TargetMonitor.defText=[none]
  -
  -org.apache.tools.ant.gui.modules.console.BuildConsole.name=Console
  -org.apache.tools.ant.gui.modules.console.BuildConsole.clearLog=\
  -    Clear Log
  -org.apache.tools.ant.gui.modules.console.BuildConsole.logLevel=\
  -    Log message level:
  -
  -org.apache.tools.ant.gui.core.XMLFileFilter.description=XML Files
  -
  -org.apache.tools.ant.gui.core.ProjectSelectionMenu.name=Projects
  -
  -org.apache.tools.ant.gui.command.LoadFileCmd.noFile=\
  -    The file "{0}" was not found.
  -org.apache.tools.ant.gui.command.LoadFileCmd.loadError=\
  -    The file "{0}" could not be loaded.
  -org.apache.tools.ant.gui.command.DisplayErrorCmd.title=Antidote Error...
  -org.apache.tools.ant.gui.command.DisplayErrorCmd.expand=Details >>
  -
  -org.apache.tools.ant.gui.command.SaveCmd.saveError=Could not save to "{0}".
  -org.apache.tools.ant.gui.command.SaveCmd.noProject=No project to save.
  -org.apache.tools.ant.gui.command.SaveCmd.title=Overwrite?
  -org.apache.tools.ant.gui.command.SaveCmd.overwrite=Overwrite file "{0}"?
  -
  -# Properties file for BeanInfo strings
  -
  -org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.beanName=Target
  -org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.beanDescription=\
  -    An executable target in the build.
  -org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.name=Name
  -org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.description=Description
  -org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.depends=Dependencies
  -org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.if=if Clause
  -org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.unless=unless Clause
  -org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.xmlString=XML Code
  -org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.icon=target.gif
  -
  -org.apache.tools.ant.gui.acs.ACSProjectElementBeanInfo.beanName=Project
  -org.apache.tools.ant.gui.acs.ACSProjectElementBeanInfo.beanDescription=\
  -    The top level project in the build definition.
  -org.apache.tools.ant.gui.acs.ACSProjectElementBeanInfo.name=Name
  -org.apache.tools.ant.gui.acs.ACSProjectElementBeanInfo.description=Description
  -org.apache.tools.ant.gui.acs.ACSProjectElementBeanInfo.basedir=Base Directory
  -org.apache.tools.ant.gui.acs.ACSProjectElementBeanInfo.default=Default Target
  -org.apache.tools.ant.gui.acs.ACSProjectElementBeanInfo.icon=project.gif
  -
  -org.apache.tools.ant.gui.acs.ACSPropertyElementBeanInfo.beanName=Property
  -org.apache.tools.ant.gui.acs.ACSPropertyElementBeanInfo.beanDescription=\
  -    A scoped property
  -org.apache.tools.ant.gui.acs.ACSPropertyElementBeanInfo.name=Name
  -org.apache.tools.ant.gui.acs.ACSPropertyElementBeanInfo.value=Value
  -org.apache.tools.ant.gui.acs.ACSPropertyElementBeanInfo.file=File
  -org.apache.tools.ant.gui.acs.ACSPropertyElementBeanInfo.icon=property.gif
  -
  -org.apache.tools.ant.gui.acs.ACSTaskElementBeanInfo.beanName=Task
  -org.apache.tools.ant.gui.acs.ACSTaskElementBeanInfo.beanDescription=\
  -    A scoped property
  -org.apache.tools.ant.gui.acs.ACSTaskElementBeanInfo.taskType=Type
  -org.apache.tools.ant.gui.acs.ACSTaskElementBeanInfo.namedValues=Attributes
  -org.apache.tools.ant.gui.acs.ACSTaskElementBeanInfo.xmlString=XML Code
  -org.apache.tools.ant.gui.acs.ACSTaskElementBeanInfo.icon=task.gif
  -
  -
  -org.apache.tools.ant.gui.command.NewProjectCmd.defName=New Project
  -org.apache.tools.ant.gui.command.NewTargetCmd.defName=New Target
  -
  -#----------------------------------------------------------------------------
  -# About Description (NB: this is only a temporary approach).
  -#----------------------------------------------------------------------------
  -
  -org.apache.tools.ant.gui.About.title=About
  -org.apache.tools.ant.gui.About.ok=OK
  -org.apache.tools.ant.gui.About.message=\
  -	<html><h1>Antidote</h1> \
  -	<p>Copyright &copy; 2000 The Apache Software Foundation. <br>\
  -    All rights reserved.</p><br> \
  -    <p>Visit http://jakarta.apache.org/ant for more information.</p><br> \
  -    <table> \
  -	<tr><td align="right"><b>Version</b>:</td><td>{0}</td></tr> \
  -	<tr><td align="right"><b>Date</b>:</td><td>{1}</td></tr> \
  -    </table> \
  -	<hr> \
  -    <p>Icons Copyright &copy; 1998 Dean S. Jones (deansjones@hotmail.com)<br> \
  -    http://jfa.javalobby.org/projects/icons</p> \
  -	</html>
  +# This is the general properties file for the Antidote application.
  +
  +#debug=true
  +
  +# The following four module properties configure those properties that
  +# should be initialized and displayed by default by the GUI. If more
  +# than one module is configured for a property (as indicated providing
  +# class names as a comma delimited list), then each module will appear
  +# in its own tab in a JTabbedPane.
  +
  +# Configure the modules that appear on the right of the UI.
  +org.apache.tools.ant.gui.Antidote.right.modules=\
  +	org.apache.tools.ant.gui.modules.edit.PropertyEditor
  +
  +# Configure the modules that appear on the left of the UI.
  +org.apache.tools.ant.gui.Antidote.left.modules=\
  +	org.apache.tools.ant.gui.modules.edit.ElementNavigator
  +
  +# Configure the modules that appear on the bottom of the UI.
  +org.apache.tools.ant.gui.Antidote.bottom.modules=\
  +	org.apache.tools.ant.gui.modules.console.BuildConsole
  +
  +# Configure the modules that appear on the top of the UI.
  +org.apache.tools.ant.gui.Antidote.top.modules=\
  +	org.apache.tools.ant.gui.modules.TargetMonitor
  +
  +org.apache.tools.ant.gui.modules.edit.PropertyEditor.name=Properties
  +
  +# DependentTargetChooser part of the DependentTargetPropertyEditor
  +org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.ok=OK
  +org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.cancel=Cancel
  +org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.target=Target
  +org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.description=Description
  +org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.upIcon=up.gif
  +org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.downIcon=down.gif
  +org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.addIcon=enter.gif
  +org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.removeIcon=exit.gif
  +org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.up=Move dependent target up
  +org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.down=Move dependent target down
  +org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.add=Add target to dependent list
  +org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.remove=Remove target from dependent list
  +org.apache.tools.ant.gui.modules.edit.DependentTargetChooser.selection=Selection
  +
  +org.apache.tools.ant.gui.modules.edit.ElementNavigator.name=Project
  +org.apache.tools.ant.gui.modules.edit.ElementNavigator.popupActions=\
  +    newTarget, newTask, newProperty
  +
  +org.apache.tools.ant.gui.modules.TargetMonitor.name=Selected Target(s)
  +org.apache.tools.ant.gui.modules.TargetMonitor.defText=[none]
  +
  +org.apache.tools.ant.gui.modules.console.BuildConsole.name=Console
  +org.apache.tools.ant.gui.modules.console.BuildConsole.clearLog=\
  +    Clear Log
  +org.apache.tools.ant.gui.modules.console.BuildConsole.logLevel=\
  +    Log message level:
  +
  +org.apache.tools.ant.gui.core.XMLFileFilter.description=XML Files
  +
  +org.apache.tools.ant.gui.core.ProjectSelectionMenu.name=Projects
  +
  +org.apache.tools.ant.gui.command.LoadFileCmd.noFile=\
  +    The file "{0}" was not found.
  +org.apache.tools.ant.gui.command.LoadFileCmd.loadError=\
  +    The file "{0}" could not be loaded.
  +org.apache.tools.ant.gui.command.DisplayErrorCmd.title=Antidote Error...
  +org.apache.tools.ant.gui.command.DisplayErrorCmd.expand=Details >>
  +
  +org.apache.tools.ant.gui.command.SaveCmd.saveError=Could not save to "{0}".
  +org.apache.tools.ant.gui.command.SaveCmd.noProject=No project to save.
  +org.apache.tools.ant.gui.command.SaveCmd.title=Overwrite?
  +org.apache.tools.ant.gui.command.SaveCmd.overwrite=Overwrite file "{0}"?
  +
  +# Properties file for BeanInfo strings
  +
  +org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.beanName=Target
  +org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.beanDescription=\
  +    An executable target in the build.
  +org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.name=Name
  +org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.description=Description
  +org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.depends=Dependencies
  +org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.if=if Clause
  +org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.unless=unless Clause
  +org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.xmlString=XML Code
  +org.apache.tools.ant.gui.acs.ACSTargetElementBeanInfo.icon=target.gif
  +
  +org.apache.tools.ant.gui.acs.ACSProjectElementBeanInfo.beanName=Project
  +org.apache.tools.ant.gui.acs.ACSProjectElementBeanInfo.beanDescription=\
  +    The top level project in the build definition.
  +org.apache.tools.ant.gui.acs.ACSProjectElementBeanInfo.name=Name
  +org.apache.tools.ant.gui.acs.ACSProjectElementBeanInfo.description=Description
  +org.apache.tools.ant.gui.acs.ACSProjectElementBeanInfo.basedir=Base Directory
  +org.apache.tools.ant.gui.acs.ACSProjectElementBeanInfo.default=Default Target
  +org.apache.tools.ant.gui.acs.ACSProjectElementBeanInfo.icon=project.gif
  +
  +org.apache.tools.ant.gui.acs.ACSPropertyElementBeanInfo.beanName=Property
  +org.apache.tools.ant.gui.acs.ACSPropertyElementBeanInfo.beanDescription=\
  +    A scoped property
  +org.apache.tools.ant.gui.acs.ACSPropertyElementBeanInfo.name=Name
  +org.apache.tools.ant.gui.acs.ACSPropertyElementBeanInfo.value=Value
  +org.apache.tools.ant.gui.acs.ACSPropertyElementBeanInfo.file=File
  +org.apache.tools.ant.gui.acs.ACSPropertyElementBeanInfo.icon=property.gif
  +
  +org.apache.tools.ant.gui.acs.ACSTaskElementBeanInfo.beanName=Task
  +org.apache.tools.ant.gui.acs.ACSTaskElementBeanInfo.beanDescription=\
  +    A scoped property
  +org.apache.tools.ant.gui.acs.ACSTaskElementBeanInfo.taskType=Type
  +org.apache.tools.ant.gui.acs.ACSTaskElementBeanInfo.namedValues=Attributes
  +org.apache.tools.ant.gui.acs.ACSTaskElementBeanInfo.xmlString=XML Code
  +org.apache.tools.ant.gui.acs.ACSTaskElementBeanInfo.icon=task.gif
  +
  +org.apache.tools.ant.gui.acs.ACSDtdDefinedElementBeanInfo.beanName=
  +org.apache.tools.ant.gui.acs.ACSDtdDefinedElementBeanInfo.beanDescription=\
  +    A scoped property
  +org.apache.tools.ant.gui.acs.ACSDtdDefinedElementBeanInfo.taskType=Type
  +org.apache.tools.ant.gui.acs.ACSDtdDefinedElementBeanInfo.namedValues=\
  +    Attributes
  +org.apache.tools.ant.gui.acs.ACSDtdDefinedElementBeanInfo.xmlString=XML Code
  +org.apache.tools.ant.gui.acs.ACSDtdDefinedElementBeanInfo.icon=default.gif
  +
  +org.apache.tools.ant.gui.command.NewProjectCmd.defName=New Project
  +org.apache.tools.ant.gui.command.NewTargetCmd.defName=New Target
  +
  +#----------------------------------------------------------------------------
  +# About Description (NB: this is only a temporary approach).
  +#----------------------------------------------------------------------------
  +
  +org.apache.tools.ant.gui.About.title=About
  +org.apache.tools.ant.gui.About.ok=OK
  +org.apache.tools.ant.gui.About.message=\
  +	<html><h1>Antidote</h1> \
  +	<p>Copyright &copy; 2000 The Apache Software Foundation. <br>\
  +    All rights reserved.</p><br> \
  +    <p>Visit http://jakarta.apache.org/ant for more information.</p><br> \
  +    <table> \
  +	<tr><td align="right"><b>Version</b>:</td><td>{0}</td></tr> \
  +	<tr><td align="right"><b>Date</b>:</td><td>{1}</td></tr> \
  +    </table> \
  +	<hr> \
  +    <p>Icons Copyright &copy; 1998 Dean S. Jones (deansjones@hotmail.com)<br> \
  +    http://jfa.javalobby.org/projects/icons</p> \
  +	</html>
  
  
  

Mime
View raw message