You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by ni...@apache.org on 2001/06/21 18:29:59 UTC

cvs commit: jakarta-ant-antidote/src/java/org/apache/tools/ant/gui Main.java

nickdavis    01/06/21 09:29:59

  Modified:    src/java/org/apache/tools/ant/gui Main.java
  Log:
  fire the startup and shutdown events
  
  Revision  Changes    Path
  1.3       +11 -1     jakarta-ant-antidote/src/java/org/apache/tools/ant/gui/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-antidote/src/java/org/apache/tools/ant/gui/Main.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Main.java	2001/06/04 19:01:18	1.2
  +++ Main.java	2001/06/21 16:29:55	1.3
  @@ -59,6 +59,8 @@
   import org.apache.tools.ant.gui.wizard.WizardListener;
   import org.apache.tools.ant.gui.command.LoadFileCmd;
   import org.apache.tools.ant.gui.event.EventBus;
  +import org.apache.tools.ant.gui.event.AppStartupEvent;
  +import org.apache.tools.ant.gui.event.AppShutdownEvent;
   import org.apache.tools.ant.gui.acs.ACSFactory;
   import javax.swing.*;
   import java.awt.BorderLayout;
  @@ -67,7 +69,7 @@
   /**
    * Launch point for the Antidote GUI. Configurs it as an application.
    * 
  - * @version $Revision: 1.2 $ 
  + * @version $Revision: 1.3 $ 
    * @author Simeon Fitch 
    */
   public class Main {
  @@ -94,6 +96,7 @@
   
                   JMenuBar menu = context.getActions().createMenuBar();
                   f.setJMenuBar(menu);
  +                gui.setJMenuBar(menu);
                   f.getContentPane().add(BorderLayout.CENTER, gui);
                   f.getContentPane().add(BorderLayout.NORTH, 
                                          context.getActions().createToolBar());
  @@ -145,9 +148,16 @@
                   System.out.println("Application icon not found.");
               }
   
  +            // Send notice we are starting up
  +            context.getEventBus().postEvent(
  +                new AppStartupEvent(context));
  +
               f.pack();
               f.setVisible(true);
   
  +            // Send notice we are shutting down
  +            context.getEventBus().postEvent(
  +                new AppShutdownEvent(context));
           }
           catch(Exception ex) {
               ex.printStackTrace();