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 ActionManager.java Console.java EventResponder.java ProjectNavigator.java PropertyEditor.java SourceEditor.java TargetMonitor.java
Date Wed, 15 Nov 2000 21:25:36 GMT
metasim     00/11/15 13:25:36

  Modified:    src/antidote/org/apache/tools/ant/gui ActionManager.java
                        Console.java EventResponder.java
                        ProjectNavigator.java PropertyEditor.java
                        SourceEditor.java TargetMonitor.java
  Log:
  Changed mechanism by which BusMembers cancel event propogation so that any type
  of event can be cancelled.
  
  Revision  Changes    Path
  1.4       +5 -2      jakarta-ant/src/antidote/org/apache/tools/ant/gui/ActionManager.java
  
  Index: ActionManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/ActionManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ActionManager.java	2000/11/14 21:47:51	1.3
  +++ ActionManager.java	2000/11/15 21:25:33	1.4
  @@ -61,7 +61,7 @@
    * Manager of antidote actions. Receives its configuration from the action
    * ResourceBundle.
    * 
  - * @version $Revision: 1.3 $ 
  + * @version $Revision: 1.4 $ 
    * @author Simeon Fitch 
    */
   public class ActionManager {
  @@ -236,9 +236,12 @@
            * Receives all events.
            * 
            * @param event Event to post.
  +         * @return true if event should be propogated, false if
  +         * it should be cancelled.
            */
  -        public void eventPosted(EventObject event) {
  +        public boolean eventPosted(EventObject event) {
               _mapper.applyEvent(event);
  +            return true;
           }
       }
   
  
  
  
  1.7       +7 -3      jakarta-ant/src/antidote/org/apache/tools/ant/gui/Console.java
  
  Index: Console.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/Console.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Console.java	2000/11/14 21:47:51	1.6
  +++ Console.java	2000/11/15 21:25:33	1.7
  @@ -64,7 +64,7 @@
   /**
    * Logging console display.
    * 
  - * @version $Revision: 1.6 $ 
  + * @version $Revision: 1.7 $ 
    * @author Simeon Fitch 
    */
   public class Console extends AntEditor {
  @@ -135,11 +135,13 @@
            * Called when an event is to be posed to the member.
            * 
            * @param event Event to post.
  +         * @return true if event should be propogated, false if
  +         * it should be cancelled.
            */
  -        public void eventPosted(EventObject event) {
  +        public boolean eventPosted(EventObject event) {
               if(event instanceof NewProjectEvent) {
                   clearDisplay();
  -                return;
  +                return true;
               }
   
               AntBuildEvent buildEvent = (AntBuildEvent) event;
  @@ -181,6 +183,8 @@
                       ex.printStackTrace();
                   }
               }
  +
  +            return true;
           }
       }
       /** Class providing filtering for project events. */
  
  
  
  1.4       +9 -3      jakarta-ant/src/antidote/org/apache/tools/ant/gui/EventResponder.java
  
  Index: EventResponder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/EventResponder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EventResponder.java	2000/11/11 14:58:54	1.3
  +++ EventResponder.java	2000/11/15 21:25:33	1.4
  @@ -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.3 $ 
  + * @version $Revision: 1.4 $ 
    * @author Simeon Fitch 
    */
   class EventResponder {
  @@ -108,8 +108,10 @@
            * Called when an event is to be posed to the member.
            * 
            * @param event Event to post.
  +         * @return true if event should be propogated, false if
  +         * it should be cancelled.
            */
  -        public void eventPosted(EventObject event) {
  +        public boolean eventPosted(EventObject event) {
               String command = ((ActionEvent)event).getActionCommand();
   
               // XXX turn this switch structure into a command
  @@ -136,6 +138,7 @@
   				// XXX log me.
                   System.err.println("Unhandled action: " + command);
               }
  +            return true;
           }
       }
   
  @@ -164,11 +167,14 @@
            * Called when an event is to be posed to the member.
            * 
            * @param event Event to post.
  +         * @return true if event should be propogated, false if
  +         * it should be cancelled.
            */
  -        public void eventPosted(EventObject event) {
  +        public boolean eventPosted(EventObject event) {
               AntEvent e = (AntEvent) event;
               Command cmd = e.createDefaultCmd();
               cmd.execute();
  +            return true;
           }
       }
   
  
  
  
  1.6       +5 -2      jakarta-ant/src/antidote/org/apache/tools/ant/gui/ProjectNavigator.java
  
  Index: ProjectNavigator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/ProjectNavigator.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ProjectNavigator.java	2000/11/14 19:48:02	1.5
  +++ ProjectNavigator.java	2000/11/15 21:25:33	1.6
  @@ -61,7 +61,7 @@
   /**
    * AntEditor for displaying the project target in a 
    * 
  - * @version $Revision: 1.5 $ 
  + * @version $Revision: 1.6 $ 
    * @author Simeon Fitch 
    */
   class ProjectNavigator extends AntEditor {
  @@ -108,8 +108,10 @@
            * Called when an event is to be posed to the member.
            * 
            * @param event Event to post.
  +         * @return true if event should be propogated, false if
  +         * it should be cancelled.
            */
  -        public void eventPosted(EventObject event) {
  +        public boolean eventPosted(EventObject event) {
               ProjectProxy project = getAppContext().getProject();
   
               if(project == null) {
  @@ -123,6 +125,7 @@
                   _tree.setModel(project.getTreeModel());
                   _tree.setSelectionModel(project.getTreeSelectionModel());
               }
  +            return true;
           }
       }
   
  
  
  
  1.7       +5 -2      jakarta-ant/src/antidote/org/apache/tools/ant/gui/PropertyEditor.java
  
  Index: PropertyEditor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/PropertyEditor.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PropertyEditor.java	2000/11/14 19:48:02	1.6
  +++ PropertyEditor.java	2000/11/15 21:25:33	1.7
  @@ -65,7 +65,7 @@
   /**
    * Stub for a property editor.
    *
  - * @version $Revision: 1.6 $ 
  + * @version $Revision: 1.7 $ 
    * @author Simeon H.K. Fitch 
    */
   class PropertyEditor extends AntEditor {
  @@ -127,11 +127,14 @@
            * Called when an event is to be posted to the member.
            * 
            * @param event Event to post.
  +         * @return true if event should be propogated, false if
  +         * it should be cancelled.
            */
  -        public void eventPosted(EventObject event) {
  +        public boolean  eventPosted(EventObject event) {
               ElementSelectionEvent e = (ElementSelectionEvent) event;
               ACSElement[] elements = e.getSelectedElements();
               updateDisplay(elements);
  +            return true;
           }
   
       }
  
  
  
  1.2       +5 -2      jakarta-ant/src/antidote/org/apache/tools/ant/gui/SourceEditor.java
  
  Index: SourceEditor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/SourceEditor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SourceEditor.java	2000/11/03 12:04:24	1.1
  +++ SourceEditor.java	2000/11/15 21:25:33	1.2
  @@ -64,7 +64,7 @@
   /*
    * AntEditor for the XML source. XXX Stubbed version.
    *
  - * @version $Revision: 1.1 $ 
  + * @version $Revision: 1.2 $ 
    * @author Simeon Fitch 
    */
   class SourceEditor extends AntEditor {
  @@ -102,12 +102,15 @@
            * Called when an event is to be posed to the member.
            * 
            * @param event Event to post.
  +         * @return true if event should be propogated, false if
  +         * it should be cancelled.
            */
  -        public void eventPosted(EventObject event) {
  +        public boolean eventPosted(EventObject event) {
               ProjectProxy project = getAppContext().getProject();
   
               _text.setDocument(project == null ? new PlainDocument() :
                                 project.getDocument());
  +            return true;
           }
       }
   
  
  
  
  1.2       +6 -2      jakarta-ant/src/antidote/org/apache/tools/ant/gui/TargetMonitor.java
  
  Index: TargetMonitor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/antidote/org/apache/tools/ant/gui/TargetMonitor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TargetMonitor.java	2000/11/14 19:48:02	1.1
  +++ TargetMonitor.java	2000/11/15 21:25:33	1.2
  @@ -65,7 +65,7 @@
   /**
    * A widget for displaying the currently selected targets.
    * 
  - * @version $Revision: 1.1 $ 
  + * @version $Revision: 1.2 $ 
    * @author Simeon Fitch 
    */
   public class TargetMonitor extends AntEditor {
  @@ -124,8 +124,10 @@
            * Called when an event is to be posed to the member.
            * 
            * @param event Event to post.
  +         * @return true if event should be propogated, false if
  +         * it should be cancelled.
            */
  -        public void eventPosted(EventObject event) {
  +        public boolean eventPosted(EventObject event) {
               ElementSelectionEvent e = (ElementSelectionEvent) event;
               String text = _defText;
   
  @@ -146,6 +148,8 @@
               }
   
               setText(text);
  +
  +            return true;
           }
       }
   
  
  
  

Mime
View raw message