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-antidote/src/java/org/apache/tools/ant/gui MainFrame.java
Date Thu, 21 Jun 2001 16:18:21 GMT
nickdavis    01/06/21 09:18:21

  Modified:    src/java/org/apache/tools/ant/gui MainFrame.java
  Log:
  send a ProjectClosedEvent for any open projects at shutdown
  
  Revision  Changes    Path
  1.2       +12 -0     jakarta-ant-antidote/src/java/org/apache/tools/ant/gui/MainFrame.java
  
  Index: MainFrame.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-antidote/src/java/org/apache/tools/ant/gui/MainFrame.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MainFrame.java	2001/06/04 19:01:18	1.1
  +++ MainFrame.java	2001/06/21 16:18:18	1.2
  @@ -57,6 +57,9 @@
   import org.apache.tools.ant.gui.core.AppContext;
   import org.apache.tools.ant.gui.core.ProjectManager;
   
  +import org.apache.tools.ant.gui.event.ProjectClosedEvent;
  +import org.apache.tools.ant.gui.event.ProjectSelectedEvent;
  +
   import org.apache.tools.ant.gui.acs.ACSProjectElement;
   
   import java.io.IOException;
  @@ -64,7 +67,7 @@
   /**
    * The main frame for the application
    * 
  - * @version $Revision: 1.1 $ 
  + * @version $Revision: 1.2 $ 
    * @author Nick Davis
    */
   public class MainFrame extends javax.swing.JFrame {
  @@ -103,6 +106,15 @@
                   if ( _context.getProjectManager().close(projects[0]) == false) {
                       okToClose = false;
                       break;
  +                }
  +                _context.getEventBus().postEvent(
  +                    new ProjectClosedEvent(_context));
  +
  +                ACSProjectElement[] open = 
  +                    _context.getProjectManager().getOpen();
  +                if(open != null && open.length > 0) {
  +                    _context.getEventBus().postEvent(
  +                        new ProjectSelectedEvent(_context, open[0]));
                   }
               } catch (IOException e) {
                   e.printStackTrace();
  
  
  

Mime
View raw message