Clover coverage report - Ant Coverage
Coverage timestamp: Tue Apr 8 2003 20:43:55 EST
file stats: LOC: 1,398   Methods: 73
NCLOC: 972   Classes: 3
 
 Source file Conditionals Statements Methods TOTAL
VAJAntToolGUI.java 0% 0% 0% 0%
 1   
 /*
 2   
  * The Apache Software License, Version 1.1
 3   
  *
 4   
  * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
 5   
  * reserved.
 6   
  *
 7   
  * Redistribution and use in source and binary forms, with or without
 8   
  * modification, are permitted provided that the following conditions
 9   
  * are met:
 10   
  *
 11   
  * 1. Redistributions of source code must retain the above copyright
 12   
  *    notice, this list of conditions and the following disclaimer.
 13   
  *
 14   
  * 2. Redistributions in binary form must reproduce the above copyright
 15   
  *    notice, this list of conditions and the following disclaimer in
 16   
  *    the documentation and/or other materials provided with the
 17   
  *    distribution.
 18   
  *
 19   
  * 3. The end-user documentation included with the redistribution, if
 20   
  *    any, must include the following acknowlegement:
 21   
  *       "This product includes software developed by the
 22   
  *        Apache Software Foundation (http://www.apache.org/)."
 23   
  *    Alternately, this acknowlegement may appear in the software itself,
 24   
  *    if and wherever such third-party acknowlegements normally appear.
 25   
  *
 26   
  * 4. The names "Ant" and "Apache Software
 27   
  *    Foundation" must not be used to endorse or promote products derived
 28   
  *    from this software without prior written permission. For written
 29   
  *    permission, please contact apache@apache.org.
 30   
  *
 31   
  * 5. Products derived from this software may not be called "Apache"
 32   
  *    nor may "Apache" appear in their names without prior written
 33   
  *    permission of the Apache Group.
 34   
  *
 35   
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 36   
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 37   
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 38   
  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 39   
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 40   
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 41   
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 42   
  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 43   
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 44   
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 45   
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 46   
  * SUCH DAMAGE.
 47   
  * ====================================================================
 48   
  *
 49   
  * This software consists of voluntary contributions made by many
 50   
  * individuals on behalf of the Apache Software Foundation.  For more
 51   
  * information on the Apache Software Foundation, please see
 52   
  * <http://www.apache.org/>.
 53   
  */
 54   
 
 55   
 package org.apache.tools.ant.taskdefs.optional.ide;
 56   
 
 57   
 
 58   
 import java.awt.BorderLayout;
 59   
 import java.awt.Button;
 60   
 import java.awt.Choice;
 61   
 import java.awt.Dialog;
 62   
 import java.awt.FileDialog;
 63   
 import java.awt.FlowLayout;
 64   
 import java.awt.Font;
 65   
 import java.awt.Frame;
 66   
 import java.awt.GridBagConstraints;
 67   
 import java.awt.GridBagLayout;
 68   
 import java.awt.Insets;
 69   
 import java.awt.Label;
 70   
 import java.awt.List;
 71   
 import java.awt.Menu;
 72   
 import java.awt.MenuBar;
 73   
 import java.awt.MenuItem;
 74   
 import java.awt.Panel;
 75   
 import java.awt.SystemColor;
 76   
 import java.awt.TextArea;
 77   
 import java.awt.TextField;
 78   
 import java.awt.Toolkit;
 79   
 import java.awt.event.ActionEvent;
 80   
 import java.awt.event.ActionListener;
 81   
 import java.awt.event.ItemEvent;
 82   
 import java.awt.event.ItemListener;
 83   
 import java.awt.event.TextEvent;
 84   
 import java.awt.event.TextListener;
 85   
 import java.awt.event.WindowEvent;
 86   
 import java.awt.event.WindowListener;
 87   
 import java.beans.PropertyChangeListener;
 88   
 import java.util.Vector;
 89   
 import org.apache.tools.ant.BuildEvent;
 90   
 import org.apache.tools.ant.BuildException;
 91   
 import org.apache.tools.ant.BuildListener;
 92   
 import org.apache.tools.ant.Project;
 93   
 import org.apache.tools.ant.util.DateUtils;
 94   
 import org.apache.tools.ant.util.StringUtils;
 95   
 
 96   
 /**
 97   
  * This is a simple grafical user interface to provide the information needed
 98   
  * by ANT and to start the build-process within IBM VisualAge for Java.
 99   
  * <p>
 100   
  * I was using AWT to make it independent from the JDK-version. Please don't
 101   
  * ask me for a Swing-version:I am very familiar with Swing and I really think
 102   
  * that it's not necessary for such a simple gui!
 103   
  * <p>
 104   
  * It is completely developed in VAJ using the visual composition editor.
 105   
  * About 90% of the code is generated by VAJ,
 106   
  * but in fact I did a lot of <i>code-beautification</i> ;-).
 107   
  * <p>
 108   
  * @version 1.0 h
 109   
  * @author Christoph Wilhelms, TUI Infotec GmbH
 110   
  */
 111   
 public class VAJAntToolGUI extends Frame {
 112   
     /**
 113   
      * Members
 114   
      */
 115   
     private VAJBuildLogger logger = new VAJBuildLogger();
 116   
     private static final String lineSeparator = "\r\n";
 117   
     private PrivateEventHandler iEventHandler = new PrivateEventHandler();
 118   
 
 119   
     /**
 120   
      * Members of the main-window
 121   
      */
 122   
     // main model
 123   
     private VAJBuildInfo iBuildInfo = null;
 124   
     // Menue
 125   
     private MenuBar iAntMakeMenuBar = null;
 126   
     private Menu iFileMenu = null;
 127   
     private MenuItem iSaveMenuItem = null;
 128   
     private MenuItem iMenuSeparator = null;
 129   
     private MenuItem iShowLogMenuItem = null;
 130   
     private Menu iHelpMenu = null;
 131   
     private MenuItem iAboutMenuItem = null;
 132   
     // Container
 133   
     private Panel iContentsPane = null;
 134   
     private Panel iOptionenPanel = null;
 135   
     private Panel iCommandButtonPanel = null;
 136   
     // Project name
 137   
     private Label iProjectLabel = null;
 138   
     private Label iProjectText = null;
 139   
     // XML-file
 140   
     private Label iBuildFileLabel = null;
 141   
     private TextField iBuildFileTextField = null;
 142   
     private boolean iConnPtoP2Aligning = false;
 143   
     private Button iBrowseButton = null;
 144   
     private FileDialog iFileDialog = null;
 145   
     // Options
 146   
     private Choice iMessageOutputLevelChoice = null;
 147   
     private Label iMessageOutputLevelLabel = null;
 148   
     private Label iTargetLabel = null;
 149   
     private List iTargetList = null;
 150   
     // Command-buttons
 151   
     private Button iBuildButton = null;
 152   
     private Button iReloadButton = null;
 153   
     private Button iCloseButton = null;
 154   
     /**
 155   
      * log-Window
 156   
      */
 157   
     // Container
 158   
     private Frame iMessageFrame = null;
 159   
     private Panel iMessageCommandPanel = null;
 160   
     private Panel iMessageContentPanel = null;
 161   
     // Components
 162   
     private TextArea iMessageTextArea = null;
 163   
     private Button iMessageOkButton = null;
 164   
     private Button iMessageClearLogButton = null;
 165   
     /**
 166   
      * About-dialog
 167   
      */
 168   
     // Container
 169   
     private Dialog iAboutDialog = null;
 170   
     private Panel iAboutDialogContentPanel = null;
 171   
     private Panel iAboutInfoPanel = null;
 172   
     private Panel iAboutCommandPanel = null;
 173   
     // Labels
 174   
     private Label iAboutTitleLabel = null;
 175   
     private Label iAboutDevLabel = null;
 176   
     private Label iAboutContactLabel = null;
 177   
     // Buttons
 178   
     private Button iAboutOkButton = null;
 179   
 
 180   
     /**
 181   
      * This internal BuildLogger, to be honest, is just a BuildListener.
 182   
      * It does nearly the same as the DefaultLogger, but uses the Loggin-Window for output.
 183   
      */
 184   
     private class VAJBuildLogger implements BuildListener {
 185   
         private long startTime = System.currentTimeMillis();
 186   
 
 187   
         /**
 188   
          * VAJBuildLogger constructor comment.
 189   
          */
 190  0
         public VAJBuildLogger() {
 191  0
             super();
 192   
         }
 193   
 
 194   
         /**
 195   
          *  Fired after the last target has finished. This event
 196   
          *  will still be thrown if an error occured during the build.
 197   
          *
 198   
          *  @see BuildEvent#getException()
 199   
          */
 200  0
         public void buildFinished(BuildEvent event) {
 201  0
             getStopButton().setEnabled(false);
 202  0
             getBuildButton().setEnabled(true);
 203  0
             getBuildButton().requestFocus();
 204   
 
 205  0
             Throwable error = event.getException();
 206   
 
 207  0
             if (error == null) {
 208  0
                 getMessageTextArea().append(lineSeparator + "BUILD SUCCESSFUL");
 209   
             } else {
 210  0
                 logException(error);
 211   
             }
 212   
 
 213  0
             getMessageTextArea().append(lineSeparator + "Total time: "
 214   
                 + DateUtils.formatElapsedTime(System.currentTimeMillis() - startTime));
 215   
         }
 216   
 
 217   
 
 218   
         /**
 219   
          *  Outputs an exception.
 220   
          */
 221  0
         public void logException(Throwable error) {
 222  0
             getMessageTextArea().append(lineSeparator + "BUILD FAILED" + lineSeparator);
 223   
 
 224  0
             if (error instanceof BuildException) {
 225  0
                 getMessageTextArea().append(error.toString());
 226   
 
 227  0
                 Throwable nested = ((BuildException) error).getException();
 228  0
                 if (nested != null) {
 229  0
                     nested.printStackTrace(System.err);
 230   
                 }
 231   
             } else {
 232  0
                 error.printStackTrace(System.err);
 233   
             }
 234   
         }
 235   
 
 236   
         /**
 237   
          *  Fired before any targets are started.
 238   
          */
 239  0
         public void buildStarted(BuildEvent event) {
 240  0
             getStopButton().setEnabled(true);
 241  0
             getBuildButton().setEnabled(false);
 242  0
             getStopButton().requestFocus();
 243   
 
 244  0
             startTime = System.currentTimeMillis();
 245  0
             getMessageTextArea().append(lineSeparator);
 246   
         }
 247   
 
 248   
         /**
 249   
          *  Fired whenever a message is logged.
 250   
          *
 251   
          *  @see BuildEvent#getMessage()
 252   
          *  @see BuildEvent#getPriority()
 253   
          */
 254  0
         public void messageLogged(BuildEvent event) {
 255  0
             if (event.getPriority() <= getBuildInfo().getOutputMessageLevel()) {
 256  0
                 String msg = "";
 257  0
                 if (event.getTask() != null) {
 258  0
                     msg = "[" + event.getTask().getTaskName() + "] ";
 259   
                 }
 260  0
                 getMessageTextArea().append(lineSeparator + msg + event.getMessage());
 261   
             }
 262   
         }
 263   
 
 264   
         /**
 265   
          *  Fired when a target has finished. This event will
 266   
          *  still be thrown if an error occured during the build.
 267   
          *
 268   
          *  @see BuildEvent#getException()
 269   
          */
 270  0
         public void targetFinished(BuildEvent event) {
 271   
         }
 272   
 
 273   
         /**
 274   
          *  Fired when a target is started.
 275   
          *
 276   
          *  @see BuildEvent#getTarget()
 277   
          */
 278  0
         public void targetStarted(BuildEvent event) {
 279  0
             if (getBuildInfo().getOutputMessageLevel() <= Project.MSG_INFO) {
 280  0
                 getMessageTextArea().append(lineSeparator + event.getTarget().getName() + ":");
 281   
             }
 282   
         }
 283   
 
 284   
         /**
 285   
          *  Fired when a task has finished. This event will still
 286   
          *  be throw if an error occured during the build.
 287   
          *
 288   
          *  @see BuildEvent#getException()
 289   
          */
 290  0
         public void taskFinished(BuildEvent event) {
 291   
         }
 292   
 
 293   
         /**
 294   
          *  Fired when a task is started.
 295   
          *
 296   
          *  @see BuildEvent#getTask()
 297   
          */
 298  0
         public void taskStarted(BuildEvent event) {
 299   
         }
 300   
     }
 301   
 
 302   
     /**
 303   
      * Eventhandler to handle all AWT-events
 304   
      */
 305   
     private class PrivateEventHandler implements ActionListener, ItemListener, TextListener, WindowListener, PropertyChangeListener {
 306   
         /**
 307   
          * ActionListener method
 308   
          */
 309  0
         public void actionPerformed(ActionEvent e) {
 310  0
             try {
 311   
                 /* #### Main App-Frame #### */
 312   
                 // browse XML-File with filechooser
 313  0
                 if (e.getSource() == VAJAntToolGUI.this.getBrowseButton()) {
 314  0
                     getFileDialog().setDirectory(getBuildFileTextField().getText().substring(0, getBuildFileTextField().getText().lastIndexOf('\\') + 1));
 315  0
                     getFileDialog().setFile("*.xml");
 316  0
                     getFileDialog().show();
 317  0
                     if (!getFileDialog().getFile().equals("")) {
 318  0
                         getBuildFileTextField().setText(getFileDialog().getDirectory() + getFileDialog().getFile());
 319   
                     }
 320   
                 }
 321   
                 // dispose and exit application
 322  0
                 if (e.getSource() == VAJAntToolGUI.this.getCloseButton()) {
 323  0
                     dispose();
 324  0
                     System.exit(0);
 325   
                 }
 326   
                 // start build-process
 327  0
                 if (e.getSource() == VAJAntToolGUI.this.getBuildButton()) {
 328  0
                     executeTarget();
 329   
                 }
 330  0
                 if (e.getSource() == VAJAntToolGUI.this.getStopButton()) {
 331  0
                     getBuildInfo().cancelBuild();
 332   
                 }
 333  0
                 if (e.getSource() == VAJAntToolGUI.this.getReloadButton()) {
 334  0
                     try {
 335  0
                         getBuildInfo().updateTargetList();
 336  0
                         fillList();
 337   
                     } catch (Throwable fileNotFound) {
 338  0
                         handleException(fileNotFound);
 339  0
                         getTargetList().removeAll();
 340  0
                         getBuildButton().setEnabled(false);
 341   
                     }
 342   
                 }
 343   
                 // MenuItems
 344  0
                 if (e.getSource() == VAJAntToolGUI.this.getSaveMenuItem()) {
 345  0
                     saveBuildInfo();
 346   
                 }
 347  0
                 if (e.getSource() == VAJAntToolGUI.this.getAboutMenuItem()) {
 348  0
                     getAboutDialog().show();
 349   
                 }
 350  0
                 if (e.getSource() == VAJAntToolGUI.this.getShowLogMenuItem()) {
 351  0
                     getMessageFrame().show();
 352   
                 }
 353   
                 /* #### About dialog #### */
 354  0
                 if (e.getSource() == VAJAntToolGUI.this.getAboutOkButton()) {
 355  0
                     getAboutDialog().dispose();
 356   
                 }
 357   
                 /* #### Log frame #### */
 358  0
                 if (e.getSource() == VAJAntToolGUI.this.getMessageOkButton()) {
 359  0
                     getMessageFrame().dispose();
 360   
                 }
 361  0
                 if (e.getSource() == VAJAntToolGUI.this.getMessageClearLogButton()) {
 362  0
                     getMessageTextArea().setText("");
 363   
                 }
 364  0
                 if (e.getSource() == VAJAntToolGUI.this.getMessageOkButton()) {
 365  0
                     getMessageFrame().dispose();
 366   
                 }
 367   
             } catch (Throwable exc) {
 368  0
                 handleException(exc);
 369   
             }
 370   
         }
 371   
 
 372   
         /**
 373   
          * ItemListener method
 374   
          */
 375  0
         public void itemStateChanged(ItemEvent e) {
 376  0
             try {
 377  0
                 if (e.getSource() == VAJAntToolGUI.this.getTargetList()) {
 378  0
                     getBuildButton().setEnabled(true);
 379   
                 }
 380  0
                 if (e.getSource() == VAJAntToolGUI.this.getMessageOutputLevelChoice()) {
 381  0
                     getBuildInfo().setOutputMessageLevel(getMessageOutputLevelChoice().getSelectedIndex());
 382   
                 }
 383  0
                 if (e.getSource() == VAJAntToolGUI.this.getTargetList()) {
 384  0
                     getBuildInfo().setTarget(getTargetList().getSelectedItem());
 385   
                 }
 386   
             } catch (Throwable exc) {
 387  0
                 handleException(exc);
 388   
             }
 389   
         }
 390   
 
 391   
         /**
 392   
          * PropertyChangeListener method
 393   
          */
 394  0
         public void propertyChange(java.beans.PropertyChangeEvent evt) {
 395  0
             if (evt.getSource() == VAJAntToolGUI.this.getBuildInfo() && (evt.getPropertyName().equals("projectName"))) {
 396  0
                 connectProjectNameToLabel();
 397   
             }
 398  0
             if (evt.getSource() == VAJAntToolGUI.this.getBuildInfo() && (evt.getPropertyName().equals("buildFileName"))) {
 399  0
                 connectBuildFileNameToTextField();
 400   
             }
 401   
         }
 402   
 
 403   
         /**
 404   
          * TextListener method
 405   
          */
 406  0
         public void textValueChanged(TextEvent e) {
 407  0
             if (e.getSource() == VAJAntToolGUI.this.getBuildFileTextField()) {
 408  0
                 connectTextFieldToBuildFileName();
 409   
             }
 410   
         }
 411   
 
 412   
         /**
 413   
          * WindowListener methods
 414   
          */
 415  0
         public void windowClosing(WindowEvent e) {
 416  0
             try {
 417  0
                 if (e.getSource() == VAJAntToolGUI.this) {
 418  0
                     dispose();
 419  0
                     System.exit(0);
 420   
                 }
 421  0
                 if (e.getSource() == VAJAntToolGUI.this.getAboutDialog()) {
 422  0
                     getAboutDialog().dispose();
 423   
                 }
 424  0
                 if (e.getSource() == VAJAntToolGUI.this.getMessageFrame()) {
 425  0
                     getMessageFrame().dispose();
 426   
                 }
 427   
             } catch (Throwable exc) {
 428  0
                 handleException(exc);
 429   
             }
 430   
         }
 431  0
         public void windowActivated(WindowEvent e) {}
 432  0
         public void windowClosed(WindowEvent e) {}
 433  0
         public void windowDeactivated(WindowEvent e) {}
 434  0
         public void windowDeiconified(WindowEvent e) {}
 435  0
         public void windowIconified(WindowEvent e) {}
 436  0
         public void windowOpened(WindowEvent e) {}
 437   
     }
 438   
 
 439   
     /**
 440   
      * AntMake default-constructor.
 441   
      */
 442  0
     private VAJAntToolGUI() {
 443  0
         super();
 444  0
         initialize();
 445   
     }
 446   
     /**
 447   
      * AntMake constructor called by VAJAntTool integration.
 448   
      * @param buildInfo VAJBuildInfo
 449   
      */
 450   
 
 451  0
     public VAJAntToolGUI(VAJBuildInfo newBuildInfo) {
 452  0
         super();
 453  0
         setBuildInfo(newBuildInfo);
 454  0
         initialize();
 455   
     }
 456   
     /**
 457   
      * This method is used to center dialogs.
 458   
      */
 459  0
     public static void centerDialog(Dialog dialog) {
 460  0
         dialog.setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (dialog.getSize().width / 2), (java.awt.Toolkit.getDefaultToolkit().getScreenSize().height / 2) - (dialog.getSize().height / 2));
 461   
     }
 462   
     /**
 463   
      * connectBuildFileNameToTextField:  (BuildInfo.buildFileName <--> BuildFileTextField.text)
 464   
      */
 465  0
     private void connectBuildFileNameToTextField() {
 466   
         /* Set the target from the source */
 467  0
         try {
 468  0
             if (iConnPtoP2Aligning == false) {
 469  0
                 iConnPtoP2Aligning = true;
 470  0
                 if ((getBuildInfo() != null)) {
 471  0
                     getBuildFileTextField().setText(getBuildInfo().getBuildFileName());
 472   
                 }
 473  0
                 iConnPtoP2Aligning = false;
 474   
             }
 475   
         } catch (Throwable iExc) {
 476  0
             iConnPtoP2Aligning = false;
 477  0
             handleException(iExc);
 478   
         }
 479   
     }
 480   
     /**
 481   
      * connectProjectNameToLabel:  (BuildInfo.vajProjectName <--> ProjectText.text)
 482   
      */
 483  0
     private void connectProjectNameToLabel() {
 484   
         /* Set the target from the source */
 485  0
         try {
 486  0
             if ((getBuildInfo() != null)) {
 487  0
                 getProjectText().setText(getBuildInfo().getVAJProjectName());
 488   
             }
 489   
         } catch (Throwable iExc) {
 490  0
             handleException(iExc);
 491   
         }
 492   
     }
 493   
     /**
 494   
      * connectTextFieldToBuildFileName:  (BuildInfo.buildFileName <--> BuildFileTextField.text)
 495   
      */
 496  0
     private void connectTextFieldToBuildFileName() {
 497   
         /* Set the source from the target */
 498  0
         try {
 499  0
             if (iConnPtoP2Aligning == false) {
 500  0
                 iConnPtoP2Aligning = true;
 501  0
                 if ((getBuildInfo() != null)) {
 502  0
                     getBuildInfo().setBuildFileName(getBuildFileTextField().getText());
 503   
                 }
 504  0
                 iConnPtoP2Aligning = false;
 505   
             }
 506   
         } catch (Throwable iExc) {
 507  0
             iConnPtoP2Aligning = false;
 508  0
             handleException(iExc);
 509   
         }
 510   
     }
 511   
     /**
 512   
      * external build of a .jar-file
 513   
      */
 514  0
     private void executeTarget() {
 515  0
         try {
 516  0
             getMessageFrame().show();
 517  0
             getBuildInfo().executeProject(logger);
 518   
         } catch (Throwable exc) {
 519  0
             logger.logException(exc);
 520   
         }
 521  0
         return;
 522   
     }
 523   
     /**
 524   
      * Fills the taget-list with project-targets
 525   
      */
 526  0
     private void fillList() {
 527  0
         getTargetList().removeAll();
 528  0
         Vector targets = getBuildInfo().getProjectTargets();
 529  0
         for (int i = 0; i < targets.size(); i++) {
 530  0
             getTargetList().add(targets.elementAt(i).toString());
 531   
         }
 532  0
         getTargetList().select(iBuildInfo.getProjectTargets().indexOf(iBuildInfo.getTarget()));
 533  0
         if (getTargetList().getSelectedIndex() >= 0) {
 534  0
             getBuildButton().setEnabled(true);
 535   
         }
 536   
     }
 537   
 
 538   
     /**
 539   
      * Return the AboutCommandPanel property value.
 540   
      * @return java.awt.Panel
 541   
      */
 542  0
     private Panel getAboutCommandPanel() {
 543  0
         if (iAboutCommandPanel == null) {
 544  0
             try {
 545  0
                 iAboutCommandPanel = new Panel();
 546  0
                 iAboutCommandPanel.setName("AboutCommandPanel");
 547  0
                 iAboutCommandPanel.setLayout(new java.awt.FlowLayout());
 548  0
                 getAboutCommandPanel().add(getAboutOkButton(), getAboutOkButton().getName());
 549   
             } catch (Throwable iExc) {
 550  0
                 handleException(iExc);
 551   
             }
 552   
         }
 553  0
         return iAboutCommandPanel;
 554   
     }
 555   
     /**
 556   
      * Return the AboutContactLabel property value.
 557   
      * @return java.awt.Label
 558   
      */
 559  0
     private Label getAboutContactLabel() {
 560  0
         if (iAboutContactLabel == null) {
 561  0
             try {
 562  0
                 iAboutContactLabel = new Label();
 563  0
                 iAboutContactLabel.setName("AboutContactLabel");
 564  0
                 iAboutContactLabel.setAlignment(java.awt.Label.CENTER);
 565  0
                 iAboutContactLabel.setText("contact: wolf.siberski@tui.de or christoph.wilhelms@tui.de");
 566   
             } catch (Throwable iExc) {
 567  0
                 handleException(iExc);
 568   
             }
 569   
         }
 570  0
         return iAboutContactLabel;
 571   
     }
 572   
     /**
 573   
      * Return the AboutDevLabel property value.
 574   
      * @return java.awt.Label
 575   
      */
 576  0
     private Label getAboutDevLabel() {
 577  0
         if (iAboutDevLabel == null) {
 578  0
             try {
 579  0
                 iAboutDevLabel = new Label();
 580  0
                 iAboutDevLabel.setName("AboutDevLabel");
 581  0
                 iAboutDevLabel.setAlignment(java.awt.Label.CENTER);
 582  0
                 iAboutDevLabel.setText("developed by Wolf Siberski & Christoph Wilhelms");
 583   
             } catch (Throwable iExc) {
 584  0
                 handleException(iExc);
 585   
             }
 586   
         }
 587  0
         return iAboutDevLabel;
 588   
     }
 589   
     /**
 590   
      * Return the AboutDialog property value.
 591   
      * @return java.awt.Dialog
 592   
      */
 593  0
     private Dialog getAboutDialog() {
 594  0
         if (iAboutDialog == null) {
 595  0
             try {
 596  0
                 iAboutDialog = new Dialog(this);
 597  0
                 iAboutDialog.setName("AboutDialog");
 598  0
                 iAboutDialog.setResizable(false);
 599  0
                 iAboutDialog.setLayout(new java.awt.BorderLayout());
 600  0
                 iAboutDialog.setBounds(550, 14, 383, 142);
 601  0
                 iAboutDialog.setModal(true);
 602  0
                 iAboutDialog.setTitle("About...");
 603  0
                 getAboutDialog().add(getAboutDialogContentPanel(), "Center");
 604  0
                 iAboutDialog.pack();
 605  0
                 centerDialog(iAboutDialog);
 606   
             } catch (Throwable iExc) {
 607  0
                 handleException(iExc);
 608   
             }
 609   
         }
 610  0
         return iAboutDialog;
 611   
     }
 612   
     /**
 613   
      * Return the AboutDialogContentPanel property value.
 614   
      * @return java.awt.Panel
 615   
      */
 616  0
     private Panel getAboutDialogContentPanel() {
 617  0
         if (iAboutDialogContentPanel == null) {
 618  0
             try {
 619  0
                 iAboutDialogContentPanel = new Panel();
 620  0
                 iAboutDialogContentPanel.setName("AboutDialogContentPanel");
 621  0
                 iAboutDialogContentPanel.setLayout(new java.awt.BorderLayout());
 622  0
                 getAboutDialogContentPanel().add(getAboutCommandPanel(), "South");
 623  0
                 getAboutDialogContentPanel().add(getAboutInfoPanel(), "Center");
 624   
             } catch (Throwable iExc) {
 625  0
                 handleException(iExc);
 626   
             }
 627   
         }
 628  0
         return iAboutDialogContentPanel;
 629   
     }
 630   
     /**
 631   
      * Return the AboutInfoPanel property value.
 632   
      * @return java.awt.Panel
 633   
      */
 634  0
     private Panel getAboutInfoPanel() {
 635  0
         if (iAboutInfoPanel == null) {
 636  0
             try {
 637  0
                 iAboutInfoPanel = new Panel();
 638  0
                 iAboutInfoPanel.setName("AboutInfoPanel");
 639  0
                 iAboutInfoPanel.setLayout(new GridBagLayout());
 640   
 
 641  0
                 GridBagConstraints constraintsAboutTitleLabel = new GridBagConstraints();
 642  0
                 constraintsAboutTitleLabel.gridx = 0; constraintsAboutTitleLabel.gridy = 0;
 643  0
                 constraintsAboutTitleLabel.fill = GridBagConstraints.HORIZONTAL;
 644  0
                 constraintsAboutTitleLabel.weightx = 1.0;
 645  0
                 constraintsAboutTitleLabel.weighty = 1.0;
 646  0
                 constraintsAboutTitleLabel.insets = new Insets(4, 0, 4, 0);
 647  0
                 getAboutInfoPanel().add(getAboutTitleLabel(), constraintsAboutTitleLabel);
 648   
 
 649  0
                 GridBagConstraints constraintsAboutDevLabel = new GridBagConstraints();
 650  0
                 constraintsAboutDevLabel.gridx = 0; constraintsAboutDevLabel.gridy = 1;
 651  0
                 constraintsAboutDevLabel.fill = GridBagConstraints.HORIZONTAL;
 652  0
                 constraintsAboutDevLabel.weightx = 1.0;
 653  0
                 constraintsAboutDevLabel.insets = new Insets(4, 0, 0, 0);
 654  0
                 getAboutInfoPanel().add(getAboutDevLabel(), constraintsAboutDevLabel);
 655   
 
 656  0
                 GridBagConstraints constraintsAboutContactLabel = new GridBagConstraints();
 657  0
                 constraintsAboutContactLabel.gridx = 0; constraintsAboutContactLabel.gridy = 2;
 658  0
                 constraintsAboutContactLabel.fill = GridBagConstraints.HORIZONTAL;
 659  0
                 constraintsAboutContactLabel.weightx = 1.0;
 660  0
                 constraintsAboutContactLabel.insets = new Insets(2, 0, 4, 0);
 661  0
                 getAboutInfoPanel().add(getAboutContactLabel(), constraintsAboutContactLabel);
 662   
             } catch (Throwable iExc) {
 663  0
                 handleException(iExc);
 664   
             }
 665   
         }
 666  0
         return iAboutInfoPanel;
 667   
     }
 668   
     /**
 669   
      * Return the AboutMenuItem property value.
 670   
      * @return java.awt.MenuItem
 671   
      */
 672  0
     private MenuItem getAboutMenuItem() {
 673  0
         if (iAboutMenuItem == null) {
 674  0
             try {
 675  0
                 iAboutMenuItem = new MenuItem();
 676  0
                 iAboutMenuItem.setLabel("About...");
 677   
             } catch (Throwable iExc) {
 678  0
                 handleException(iExc);
 679   
             }
 680   
         }
 681  0
         return iAboutMenuItem;
 682   
     }
 683   
     /**
 684   
      * Return the AboutOkButton property value.
 685   
      * @return java.awt.Button
 686   
      */
 687  0
     private Button getAboutOkButton() {
 688  0
         if (iAboutOkButton == null) {
 689  0
             try {
 690  0
                 iAboutOkButton = new Button();
 691  0
                 iAboutOkButton.setName("AboutOkButton");
 692  0
                 iAboutOkButton.setLabel("OK");
 693   
             } catch (Throwable iExc) {
 694  0
                 handleException(iExc);
 695   
             }
 696   
         }
 697  0
         return iAboutOkButton;
 698   
     }
 699   
     /**
 700   
      * Return the AboutTitleLabel property value.
 701   
      * @return java.awt.Label
 702   
      */
 703  0
     private Label getAboutTitleLabel() {
 704  0
         if (iAboutTitleLabel == null) {
 705  0
             try {
 706  0
                 iAboutTitleLabel = new Label();
 707  0
                 iAboutTitleLabel.setName("AboutTitleLabel");
 708  0
                 iAboutTitleLabel.setFont(new Font("Arial", 1, 12));
 709  0
                 iAboutTitleLabel.setAlignment(Label.CENTER);
 710  0
                 iAboutTitleLabel.setText("Ant VisualAge for Java Tool-Integration");
 711   
             } catch (Throwable iExc) {
 712  0
                 handleException(iExc);
 713   
             }
 714   
         }
 715  0
         return iAboutTitleLabel;
 716   
     }
 717   
     /**
 718   
      * Return the AntMakeMenuBar property value.
 719   
      * @return java.awt.MenuBar
 720   
      */
 721  0
     private MenuBar getAntMakeMenuBar() {
 722  0
         if (iAntMakeMenuBar == null) {
 723  0
             try {
 724  0
                 iAntMakeMenuBar = new MenuBar();
 725  0
                 iAntMakeMenuBar.add(getFileMenu());
 726  0
                 iAntMakeMenuBar.add(getHelpMenu());
 727   
             } catch (Throwable iExc) {
 728  0
                 handleException(iExc);
 729   
             }
 730   
         }
 731  0
         return iAntMakeMenuBar;
 732   
     }
 733   
     /**
 734   
      * Return the BrowseButton property value.
 735   
      * @return Button
 736   
      */
 737  0
     private Button getBrowseButton() {
 738  0
         if (iBrowseButton == null) {
 739  0
             try {
 740  0
                 iBrowseButton = new Button();
 741  0
                 iBrowseButton.setName("BrowseButton");
 742  0
                 iBrowseButton.setLabel("...");
 743   
             } catch (Throwable iExc) {
 744  0
                 handleException(iExc);
 745   
             }
 746   
         }
 747  0
         return iBrowseButton;
 748   
     }
 749   
     /**
 750   
      * Return the BuildButton property value.
 751   
      * @return java.awt.Button
 752   
      */
 753  0
     private Button getBuildButton() {
 754  0
         if (iBuildButton == null) {
 755  0
             try {
 756  0
                 iBuildButton = new Button();
 757  0
                 iBuildButton.setName("BuildButton");
 758  0
                 iBuildButton.setLabel("Execute");
 759   
             } catch (Throwable iExc) {
 760  0
                 handleException(iExc);
 761   
             }
 762   
         }
 763  0
         return iBuildButton;
 764   
     }
 765   
     /**
 766   
      * Return the BuildFileLabel property value.
 767   
      * @return java.awt.Label
 768   
      */
 769  0
     private Label getBuildFileLabel() {
 770  0
         if (iBuildFileLabel == null) {
 771  0
             try {
 772  0
                 iBuildFileLabel = new Label();
 773  0
                 iBuildFileLabel.setName("BuildFileLabel");
 774  0
                 iBuildFileLabel.setText("Ant-Buildfile:");
 775   
             } catch (Throwable iExc) {
 776  0
                 handleException(iExc);
 777   
             }
 778   
         }
 779  0
         return iBuildFileLabel;
 780   
     }
 781   
     /**
 782   
      * Return the BuildFileTextField property value.
 783   
      * @return java.awt.TextField
 784   
      */
 785  0
     private TextField getBuildFileTextField() {
 786  0
         if (iBuildFileTextField == null) {
 787  0
             try {
 788  0
                 iBuildFileTextField = new TextField();
 789  0
                 iBuildFileTextField.setName("BuildFileTextField");
 790  0
                 iBuildFileTextField.setBackground(SystemColor.textHighlightText);
 791   
             } catch (Throwable iExc) {
 792  0
                 handleException(iExc);
 793   
             }
 794   
         }
 795  0
         return iBuildFileTextField;
 796   
     }
 797   
     /**
 798   
      * Return the BuildInfo property value.
 799   
      * @return org.apache.tools.ant.taskdefs.optional.ide.VAJBuildInfo
 800   
      */
 801  0
     private VAJBuildInfo getBuildInfo() {
 802  0
         return iBuildInfo;
 803   
     }
 804   
     /**
 805   
      * Return the CloseButton property value.
 806   
      * @return java.awt.Button
 807   
      */
 808  0
     private Button getCloseButton() {
 809  0
         if (iCloseButton == null) {
 810  0
             try {
 811  0
                 iCloseButton = new Button();
 812  0
                 iCloseButton.setName("CloseButton");
 813  0
                 iCloseButton.setLabel("Close");
 814   
             } catch (Throwable iExc) {
 815  0
                 handleException(iExc);
 816   
             }
 817   
         }
 818  0
         return iCloseButton;
 819   
     }
 820   
     /**
 821   
      * Return the CommandButtonPanel property value.
 822   
      * @return java.awt.Panel
 823   
      */
 824  0
     private Panel getCommandButtonPanel() {
 825  0
         if (iCommandButtonPanel == null) {
 826  0
             try {
 827  0
                 iCommandButtonPanel = new Panel();
 828  0
                 iCommandButtonPanel.setName("CommandButtonPanel");
 829  0
                 iCommandButtonPanel.setLayout(getCommandButtonPanelFlowLayout());
 830  0
                 iCommandButtonPanel.setBackground(SystemColor.control);
 831  0
                 iCommandButtonPanel.add(getReloadButton());
 832  0
                 iCommandButtonPanel.add(getBuildButton());
 833  0
                 iCommandButtonPanel.add(getStopButton());
 834  0
                 iCommandButtonPanel.add(getCloseButton());
 835   
             } catch (Throwable iExc) {
 836  0
                 handleException(iExc);
 837   
             }
 838   
         }
 839  0
         return iCommandButtonPanel;
 840   
     }
 841   
     /**
 842   
      * Return the CommandButtonPanelFlowLayout property value.
 843   
      * @return java.awt.FlowLayout
 844   
      */
 845  0
     private FlowLayout getCommandButtonPanelFlowLayout() {
 846  0
         FlowLayout iCommandButtonPanelFlowLayout = null;
 847  0
         try {
 848   
             /* Create part */
 849  0
             iCommandButtonPanelFlowLayout = new FlowLayout();
 850  0
             iCommandButtonPanelFlowLayout.setAlignment(FlowLayout.RIGHT);
 851   
         } catch (Throwable iExc) {
 852  0
             handleException(iExc);
 853   
         };
 854  0
         return iCommandButtonPanelFlowLayout;
 855   
     }
 856   
     /**
 857   
      * Return the ContentsPane property value.
 858   
      * @return java.awt.Panel
 859   
      */
 860  0
     private Panel getContentsPane() {
 861  0
         if (iContentsPane == null) {
 862  0
             try {
 863  0
                 iContentsPane = new Panel();
 864  0
                 iContentsPane.setName("ContentsPane");
 865  0
                 iContentsPane.setLayout(new BorderLayout());
 866  0
                 getContentsPane().add(getCommandButtonPanel(), "South");
 867  0
                 getContentsPane().add(getOptionenPanel(), "Center");
 868   
             } catch (Throwable iExc) {
 869  0
                 handleException(iExc);
 870   
             }
 871   
         }
 872  0
         return iContentsPane;
 873   
     }
 874   
     /**
 875   
      * Return the FileDialog property value.
 876   
      * @return java.awt.FileDialog
 877   
      */
 878  0
     private FileDialog getFileDialog() {
 879  0
         if (iFileDialog == null) {
 880  0
             try {
 881  0
                 iFileDialog = new FileDialog(this);
 882  0
                 iFileDialog.setName("FileDialog");
 883  0
                 iFileDialog.setLayout(null);
 884  0
                 centerDialog(iFileDialog);
 885   
             } catch (Throwable iExc) {
 886  0
                 handleException(iExc);
 887   
             }
 888   
         }
 889  0
         return iFileDialog;
 890   
     }
 891   
     /**
 892   
      * Return the FileMenu property value.
 893   
      * @return java.awt.Menu
 894   
      */
 895  0
     private Menu getFileMenu() {
 896  0
         if (iFileMenu == null) {
 897  0
             try {
 898  0
                 iFileMenu = new Menu();
 899  0
                 iFileMenu.setLabel("File");
 900  0
                 iFileMenu.add(getSaveMenuItem());
 901  0
                 iFileMenu.add(getMenuSeparator());
 902  0
                 iFileMenu.add(getShowLogMenuItem());
 903   
             } catch (Throwable iExc) {
 904  0
                 handleException(iExc);
 905   
             }
 906   
         }
 907  0
         return iFileMenu;
 908   
     }
 909   
     /**
 910   
      * Return the HelpMenu property value.
 911   
      * @return java.awt.Menu
 912   
      */
 913  0
     private Menu getHelpMenu() {
 914  0
         if (iHelpMenu == null) {
 915  0
             try {
 916  0
                 iHelpMenu = new Menu();
 917  0
                 iHelpMenu.setLabel("Help");
 918  0
                 iHelpMenu.add(getAboutMenuItem());
 919   
             } catch (Throwable iExc) {
 920  0
                 handleException(iExc);
 921   
             }
 922   
         }
 923  0
         return iHelpMenu;
 924   
     }
 925   
     /**
 926   
      * Return the MenuSeparator1 property value.
 927   
      * @return java.awt.MenuItem
 928   
      */
 929  0
     private MenuItem getMenuSeparator() {
 930  0
         if (iMenuSeparator == null) {
 931  0
             try {
 932  0
                 iMenuSeparator = new MenuItem();
 933  0
                 iMenuSeparator.setLabel("-");
 934   
             } catch (Throwable iExc) {
 935  0
                 handleException(iExc);
 936   
             }
 937   
         }
 938  0
         return iMenuSeparator;
 939   
     }
 940   
     /**
 941   
      * Return the MessageClearLogButton property value.
 942   
      * @return java.awt.Button
 943   
      */
 944  0
     private Button getMessageClearLogButton() {
 945  0
         if (iMessageClearLogButton == null) {
 946  0
             try {
 947  0
                 iMessageClearLogButton = new Button();
 948  0
                 iMessageClearLogButton.setName("MessageClearLogButton");
 949  0
                 iMessageClearLogButton.setLabel("Clear Log");
 950   
             } catch (Throwable iExc) {
 951  0
                 handleException(iExc);
 952   
             }
 953   
         }
 954  0
         return iMessageClearLogButton;
 955   
     }
 956   
     /**
 957   
      * Return the MessageCommandPanel property value.
 958   
      * @return java.awt.Panel
 959   
      */
 960  0
     private Panel getMessageCommandPanel() {
 961  0
         if (iMessageCommandPanel == null) {
 962  0
             try {
 963  0
                 iMessageCommandPanel = new Panel();
 964  0
                 iMessageCommandPanel.setName("MessageCommandPanel");
 965  0
                 iMessageCommandPanel.setLayout(new FlowLayout());
 966  0
                 getMessageCommandPanel().add(getMessageClearLogButton(), getMessageClearLogButton().getName());
 967  0
                 getMessageCommandPanel().add(getMessageOkButton(), getMessageOkButton().getName());
 968   
             } catch (Throwable iExc) {
 969  0
                 handleException(iExc);
 970   
             }
 971   
         }
 972  0
         return iMessageCommandPanel;
 973   
     }
 974   
     /**
 975   
      * Return the MessageContentPanel property value.
 976   
      * @return java.awt.Panel
 977   
      */
 978  0
     private Panel getMessageContentPanel() {
 979  0
         if (iMessageContentPanel == null) {
 980  0
             try {
 981  0
                 iMessageContentPanel = new Panel();
 982  0
                 iMessageContentPanel.setName("MessageContentPanel");
 983  0
                 iMessageContentPanel.setLayout(new BorderLayout());
 984  0
                 iMessageContentPanel.setBackground(SystemColor.control);
 985  0
                 getMessageContentPanel().add(getMessageTextArea(), "Center");
 986  0
                 getMessageContentPanel().add(getMessageCommandPanel(), "South");
 987   
             } catch (Throwable iExc) {
 988  0
                 handleException(iExc);
 989   
             }
 990   
         }
 991  0
         return iMessageContentPanel;
 992   
     }
 993   
     /**
 994   
      * Return the MessageFrame property value.
 995   
      * @return java.awt.Frame
 996   
      */
 997  0
     private Frame getMessageFrame() {
 998  0
         if (iMessageFrame == null) {
 999  0
             try {
 1000  0
                 iMessageFrame = new Frame();
 1001  0
                 iMessageFrame.setName("MessageFrame");
 1002  0
                 iMessageFrame.setLayout(new BorderLayout());
 1003  0
                 iMessageFrame.setBounds(0, 0, 750, 250);
 1004  0
                 iMessageFrame.setTitle("Message Log");
 1005  0
                 iMessageFrame.add(getMessageContentPanel(), "Center");
 1006  0
                 iMessageFrame.setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (iMessageFrame.getSize().width / 2), (java.awt.Toolkit.getDefaultToolkit().getScreenSize().height / 2));
 1007   
             } catch (Throwable iExc) {
 1008  0
                 handleException(iExc);
 1009   
             }
 1010   
         }
 1011  0
         return iMessageFrame;
 1012   
     }
 1013   
     /**
 1014   
      * Return the MessageOkButton property value.
 1015   
      * @return java.awt.Button
 1016   
      */
 1017  0
     private Button getMessageOkButton() {
 1018  0
         if (iMessageOkButton == null) {
 1019  0
             try {
 1020  0
                 iMessageOkButton = new Button();
 1021  0
                 iMessageOkButton.setName("MessageOkButton");
 1022  0
                 iMessageOkButton.setLabel("Close");
 1023   
             } catch (Throwable iExc) {
 1024  0
                 handleException(iExc);
 1025   
             }
 1026   
         }
 1027  0
         return iMessageOkButton;
 1028   
     }
 1029   
     /**
 1030   
      * Return the MessageOutputLevelChoice property value.
 1031   
      * @return java.awt.Choice
 1032   
      */
 1033  0
     private Choice getMessageOutputLevelChoice() {
 1034  0
         if (iMessageOutputLevelChoice == null) {
 1035  0
             try {
 1036  0
                 iMessageOutputLevelChoice = new Choice();
 1037  0
                 iMessageOutputLevelChoice.setName("MessageOutputLevelChoice");
 1038  0
                 iMessageOutputLevelChoice.add("Error");
 1039  0
                 iMessageOutputLevelChoice.add("Warning");
 1040  0
                 iMessageOutputLevelChoice.add("Info");
 1041  0
                 iMessageOutputLevelChoice.add("Verbose");
 1042  0
                 iMessageOutputLevelChoice.add("Debug");
 1043  0
                 iMessageOutputLevelChoice.select(2);
 1044   
             } catch (Throwable iExc) {
 1045  0
                 handleException(iExc);
 1046   
             }
 1047   
         }
 1048  0
         return iMessageOutputLevelChoice;
 1049   
     }
 1050   
     /**
 1051   
      * Return the MessageOutputLevelLabel property value.
 1052   
      * @return java.awt.Label
 1053   
      */
 1054  0
     private Label getMessageOutputLevelLabel() {
 1055  0
         if (iMessageOutputLevelLabel == null) {
 1056  0
             try {
 1057  0
                 iMessageOutputLevelLabel = new Label();
 1058  0
                 iMessageOutputLevelLabel.setName("MessageOutputLevelLabel");
 1059  0
                 iMessageOutputLevelLabel.setText("Message Level:");
 1060   
             } catch (Throwable iExc) {
 1061  0
                 handleException(iExc);
 1062   
             }
 1063   
         }
 1064  0
         return iMessageOutputLevelLabel;
 1065   
     }
 1066   
     /**
 1067   
      * Return the MessageTextArea property value.
 1068   
      * @return java.awt.TextArea
 1069   
      */
 1070  0
     private TextArea getMessageTextArea() {
 1071  0
         if (iMessageTextArea == null) {
 1072  0
             try {
 1073  0
                 iMessageTextArea = new TextArea();
 1074  0
                 iMessageTextArea.setName("MessageTextArea");
 1075  0
                 iMessageTextArea.setFont(new Font("monospaced", 0, 12));
 1076  0
                 iMessageTextArea.setText("");
 1077  0
                 iMessageTextArea.setEditable(false);
 1078  0
                 iMessageTextArea.setEnabled(true);
 1079   
             } catch (Throwable iExc) {
 1080  0
                 handleException(iExc);
 1081   
             }
 1082   
         }
 1083  0
         return iMessageTextArea;
 1084   
     }
 1085   
     /**
 1086   
      * Return the Panel1 property value.
 1087   
      * @return java.awt.Panel
 1088   
      */
 1089  0
     private Panel getOptionenPanel() {
 1090  0
         if (iOptionenPanel == null) {
 1091  0
             try {
 1092  0
                 iOptionenPanel = new Panel();
 1093  0
                 iOptionenPanel.setName("OptionenPanel");
 1094  0
                 iOptionenPanel.setLayout(new GridBagLayout());
 1095  0
                 iOptionenPanel.setBackground(SystemColor.control);
 1096   
 
 1097  0
                 GridBagConstraints constraintsProjectLabel = new GridBagConstraints();
 1098  0
                 constraintsProjectLabel.gridx = 0; constraintsProjectLabel.gridy = 0;
 1099  0
                 constraintsProjectLabel.anchor = GridBagConstraints.WEST;
 1100  0
                 constraintsProjectLabel.insets = new Insets(4, 4, 4, 4);
 1101  0
                 getOptionenPanel().add(getProjectLabel(), constraintsProjectLabel);
 1102   
 
 1103  0
                 GridBagConstraints constraintsBuildFileLabel = new GridBagConstraints();
 1104  0
                 constraintsBuildFileLabel.gridx = 0; constraintsBuildFileLabel.gridy = 1;
 1105  0
                 constraintsBuildFileLabel.anchor = GridBagConstraints.WEST;
 1106  0
                 constraintsBuildFileLabel.insets = new Insets(4, 4, 4, 4);
 1107  0
                 getOptionenPanel().add(getBuildFileLabel(), constraintsBuildFileLabel);
 1108   
 
 1109  0
                 GridBagConstraints constraintsTargetLabel = new GridBagConstraints();
 1110  0
                 constraintsTargetLabel.gridx = 0; constraintsTargetLabel.gridy = 2;
 1111  0
                 constraintsTargetLabel.anchor = GridBagConstraints.NORTHWEST;
 1112  0
                 constraintsTargetLabel.insets = new Insets(4, 4, 4, 4);
 1113  0
                 getOptionenPanel().add(getTargetLabel(), constraintsTargetLabel);
 1114   
 
 1115  0
                 GridBagConstraints constraintsProjectText = new GridBagConstraints();
 1116  0
                 constraintsProjectText.gridx = 1; constraintsProjectText.gridy = 0;
 1117  0
                 constraintsProjectText.gridwidth = 2;
 1118  0
                 constraintsProjectText.fill = GridBagConstraints.HORIZONTAL;
 1119  0
                 constraintsProjectText.anchor = GridBagConstraints.WEST;
 1120  0
                 constraintsProjectText.insets = new Insets(4, 4, 4, 4);
 1121  0
                 getOptionenPanel().add(getProjectText(), constraintsProjectText);
 1122   
 
 1123  0
                 GridBagConstraints constraintsBuildFileTextField = new GridBagConstraints();
 1124  0
                 constraintsBuildFileTextField.gridx = 1; constraintsBuildFileTextField.gridy = 1;
 1125  0
                 constraintsBuildFileTextField.fill = GridBagConstraints.HORIZONTAL;
 1126  0
                 constraintsBuildFileTextField.anchor = GridBagConstraints.WEST;
 1127  0
                 constraintsBuildFileTextField.weightx = 1.0;
 1128  0
                 constraintsBuildFileTextField.insets = new Insets(4, 4, 4, 4);
 1129  0
                 getOptionenPanel().add(getBuildFileTextField(), constraintsBuildFileTextField);
 1130   
 
 1131  0
                 GridBagConstraints constraintsBrowseButton = new GridBagConstraints();
 1132  0
                 constraintsBrowseButton.gridx = 2; constraintsBrowseButton.gridy = 1;
 1133  0
                 constraintsBrowseButton.insets = new Insets(4, 4, 4, 4);
 1134  0
                 getOptionenPanel().add(getBrowseButton(), constraintsBrowseButton);
 1135   
 
 1136  0
                 GridBagConstraints constraintsTargetList = new GridBagConstraints();
 1137  0
                 constraintsTargetList.gridx = 1; constraintsTargetList.gridy = 2;
 1138  0
                 constraintsTargetList.gridheight = 2;
 1139  0
                 constraintsTargetList.fill = GridBagConstraints.BOTH;
 1140  0
                 constraintsTargetList.weightx = 1.0;
 1141  0
                 constraintsTargetList.weighty = 1.0;
 1142  0
                 constraintsTargetList.insets = new Insets(4, 4, 4, 4);
 1143  0
                 getOptionenPanel().add(getTargetList(), constraintsTargetList);
 1144   
 
 1145  0
                 GridBagConstraints constraintsMessageOutputLevelLabel = new GridBagConstraints();
 1146  0
                 constraintsMessageOutputLevelLabel.gridx = 0; constraintsMessageOutputLevelLabel.gridy = 4;
 1147  0
                 constraintsMessageOutputLevelLabel.anchor = GridBagConstraints.WEST;
 1148  0
                 constraintsMessageOutputLevelLabel.insets = new Insets(4, 4, 4, 4);
 1149  0
                 getOptionenPanel().add(getMessageOutputLevelLabel(), constraintsMessageOutputLevelLabel);
 1150   
 
 1151  0
                 GridBagConstraints constraintsMessageOutputLevelChoice = new GridBagConstraints();
 1152  0
                 constraintsMessageOutputLevelChoice.gridx = 1; constraintsMessageOutputLevelChoice.gridy = 4;
 1153  0
                 constraintsMessageOutputLevelChoice.fill = GridBagConstraints.HORIZONTAL;
 1154  0
                 constraintsMessageOutputLevelChoice.anchor = GridBagConstraints.WEST;
 1155  0
                 constraintsMessageOutputLevelChoice.weightx = 1.0;
 1156  0
                 constraintsMessageOutputLevelChoice.insets = new Insets(4, 4, 4, 4);
 1157  0
                 getOptionenPanel().add(getMessageOutputLevelChoice(), constraintsMessageOutputLevelChoice);
 1158   
             } catch (Throwable iExc) {
 1159  0
                 handleException(iExc);
 1160   
             }
 1161   
         }
 1162  0
         return iOptionenPanel;
 1163   
     }
 1164   
     /**
 1165   
      * Return the ProjectLabel property value.
 1166   
      * @return java.awt.Label
 1167   
      */
 1168  0
     private Label getProjectLabel() {
 1169  0
         if (iProjectLabel == null) {
 1170  0
             try {
 1171  0
                 iProjectLabel = new Label();
 1172  0
                 iProjectLabel.setName("ProjectLabel");
 1173  0
                 iProjectLabel.setText("Projectname:");
 1174   
             } catch (Throwable iExc) {
 1175  0
                 handleException(iExc);
 1176   
             }
 1177   
         }
 1178  0
         return iProjectLabel;
 1179   
     }
 1180   
     /**
 1181   
      * Return the ProjectText property value.
 1182   
      * @return java.awt.Label
 1183   
      */
 1184  0
     private Label getProjectText() {
 1185  0
         if (iProjectText == null) {
 1186  0
             try {
 1187  0
                 iProjectText = new Label();
 1188  0
                 iProjectText.setName("ProjectText");
 1189  0
                 iProjectText.setText(" ");
 1190   
             } catch (Throwable iExc) {
 1191  0
                 handleException(iExc);
 1192   
             }
 1193   
         }
 1194  0
         return iProjectText;
 1195   
     }
 1196   
     /**
 1197   
      * Return the ReloadButton property value.
 1198   
      * @return java.awt.Button
 1199   
      */
 1200  0
     private Button getReloadButton() {
 1201  0
         if (iReloadButton == null) {
 1202  0
             try {
 1203  0
                 iReloadButton = new Button();
 1204  0
                 iReloadButton.setName("ReloadButton");
 1205  0
                 iReloadButton.setLabel("(Re)Load");
 1206   
             } catch (Throwable iExc) {
 1207  0
                 handleException(iExc);
 1208   
             }
 1209   
         }
 1210  0
         return iReloadButton;
 1211   
     }
 1212   
     /**
 1213   
      * Return the SaveMenuItem property value.
 1214   
      * @return java.awt.MenuItem
 1215   
      */
 1216  0
     private MenuItem getSaveMenuItem() {
 1217  0
         if (iSaveMenuItem == null) {
 1218  0
             try {
 1219  0
                 iSaveMenuItem = new MenuItem();
 1220  0
                 iSaveMenuItem.setLabel("Save BuildInfo To Repository");
 1221   
             } catch (Throwable iExc) {
 1222  0
                 handleException(iExc);
 1223   
             }
 1224   
         }
 1225  0
         return iSaveMenuItem;
 1226   
     }
 1227   
     /**
 1228   
      * Return the ShowLogMenuItem property value.
 1229   
      * @return java.awt.MenuItem
 1230   
      */
 1231  0
     private MenuItem getShowLogMenuItem() {
 1232  0
         if (iShowLogMenuItem == null) {
 1233  0
             try {
 1234  0
                 iShowLogMenuItem = new MenuItem();
 1235  0
                 iShowLogMenuItem.setLabel("Log");
 1236   
             } catch (Throwable iExc) {
 1237  0
                 handleException(iExc);
 1238   
             }
 1239   
         }
 1240  0
         return iShowLogMenuItem;
 1241   
     }
 1242   
     /**
 1243   
      * Return the TargetLabel property value.
 1244   
      * @return java.awt.Label
 1245   
      */
 1246  0
     private Label getTargetLabel() {
 1247  0
         if (iTargetLabel == null) {
 1248  0
             try {
 1249  0
                 iTargetLabel = new Label();
 1250  0
                 iTargetLabel.setName("TargetLabel");
 1251  0
                 iTargetLabel.setText("Target:");
 1252  0
                 iTargetLabel.setEnabled(true);
 1253   
             } catch (Throwable iExc) {
 1254  0
                 handleException(iExc);
 1255   
             }
 1256   
         }
 1257  0
         return iTargetLabel;
 1258   
     }
 1259   
     /**
 1260   
      * Return the TargetList property value.
 1261   
      * @return java.awt.List
 1262   
      */
 1263  0
     private List getTargetList() {
 1264  0
         if (iTargetList == null) {
 1265  0
             try {
 1266  0
                 iTargetList = new List();
 1267  0
                 iTargetList.setName("TargetList");
 1268  0
                 iTargetList.setEnabled(true);
 1269   
             } catch (Throwable iExc) {
 1270  0
                 handleException(iExc);
 1271   
             }
 1272   
         }
 1273  0
         return iTargetList;
 1274   
     }
 1275   
     /**
 1276   
      * Called whenever the part throws an exception.
 1277   
      * @param exception Throwable
 1278   
      */
 1279  0
     private void handleException(Throwable exception) {
 1280   
         // Write exceptions to the log-window
 1281  0
         String trace = StringUtils.getStackTrace(exception);
 1282   
 
 1283  0
         getMessageTextArea().append(lineSeparator + lineSeparator + trace);
 1284  0
         getMessageFrame().show();
 1285   
 
 1286   
     }
 1287   
     /**
 1288   
      * Initializes connections
 1289   
      * @exception Exception The exception description.
 1290   
      */
 1291  0
     private void initConnections() throws Exception {
 1292  0
         this.addWindowListener(iEventHandler);
 1293  0
         getBrowseButton().addActionListener(iEventHandler);
 1294  0
         getCloseButton().addActionListener(iEventHandler);
 1295  0
         getBuildButton().addActionListener(iEventHandler);
 1296  0
         getStopButton().addActionListener(iEventHandler);
 1297  0
         getSaveMenuItem().addActionListener(iEventHandler);
 1298  0
         getAboutOkButton().addActionListener(iEventHandler);
 1299  0
         getAboutMenuItem().addActionListener(iEventHandler);
 1300  0
         getMessageOkButton().addActionListener(iEventHandler);
 1301  0
         getMessageClearLogButton().addActionListener(iEventHandler);
 1302  0
         getMessageOkButton().addActionListener(iEventHandler);
 1303  0
         getShowLogMenuItem().addActionListener(iEventHandler);
 1304  0
         getAboutDialog().addWindowListener(iEventHandler);
 1305  0
         getMessageFrame().addWindowListener(iEventHandler);
 1306  0
         getReloadButton().addActionListener(iEventHandler);
 1307  0
         getTargetList().addItemListener(iEventHandler);
 1308  0
         getMessageOutputLevelChoice().addItemListener(iEventHandler);
 1309  0
         getBuildFileTextField().addTextListener(iEventHandler);
 1310  0
         connectProjectNameToLabel();
 1311  0
         connectBuildFileNameToTextField();
 1312   
     }
 1313   
     /**
 1314   
      * Initialize the class.
 1315   
      */
 1316  0
     private void initialize() {
 1317  0
         try {
 1318  0
             setName("AntMake");
 1319  0
             setMenuBar(getAntMakeMenuBar());
 1320  0
             setLayout(new java.awt.BorderLayout());
 1321  0
             setSize(389, 222);
 1322  0
             setTitle("Ant VisualAge for Java Tool-Integration");
 1323  0
             add(getContentsPane(), "Center");
 1324  0
             initConnections();
 1325   
         } catch (Throwable iExc) {
 1326  0
             handleException(iExc);
 1327   
         }
 1328  0
         setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (getSize().width / 2), (java.awt.Toolkit.getDefaultToolkit().getScreenSize().height / 2) - (getSize().height));
 1329  0
         if ((getTargetList().getItemCount() == 0) || (getTargetList().getSelectedIndex() < 0)) {
 1330  0
             getBuildButton().setEnabled(false);
 1331   
         }
 1332   
     }
 1333   
     /**
 1334   
      * Saves the build-informations to repository
 1335   
      */
 1336  0
     private void saveBuildInfo() {
 1337  0
         try {
 1338  0
             VAJAntTool.saveBuildData(getBuildInfo());
 1339   
         } catch (Throwable exc) {
 1340   
             // This Exception occurs when you try to write into a versioned project
 1341  0
             handleException(exc);
 1342   
         }
 1343  0
         return;
 1344   
     }
 1345   
     /**
 1346   
      * Set the BuildInfo to a new value.
 1347   
      * @param newValue org.apache.tools.ant.taskdefs.optional.vaj.VAJBuildInfo
 1348   
      */
 1349  0
     private void setBuildInfo(VAJBuildInfo newValue) {
 1350  0
         if (iBuildInfo != newValue) {
 1351  0
             try {
 1352   
                 /* Stop listening for events from the current object */
 1353  0
                 if (iBuildInfo != null) {
 1354  0
                     iBuildInfo.removePropertyChangeListener(iEventHandler);
 1355   
                 }
 1356  0
                 iBuildInfo = newValue;
 1357   
 
 1358   
                 /* Listen for events from the new object */
 1359  0
                 if (iBuildInfo != null) {
 1360  0
                     iBuildInfo.addPropertyChangeListener(iEventHandler);
 1361   
                 }
 1362  0
                 connectProjectNameToLabel();
 1363  0
                 connectBuildFileNameToTextField();
 1364   
 
 1365   
                 // Select the log-level given by BuildInfo
 1366  0
                 getMessageOutputLevelChoice().select(iBuildInfo.getOutputMessageLevel());
 1367  0
                 fillList();
 1368   
                 // BuildInfo can conly be saved to a VAJ project if tool API is called via the projects context-menu
 1369  0
                 if ((iBuildInfo.getVAJProjectName() == null) || (iBuildInfo.getVAJProjectName().equals(""))) {
 1370  0
                     getSaveMenuItem().setEnabled(false);
 1371   
                 }
 1372   
             } catch (Throwable iExc) {
 1373  0
                 handleException(iExc);
 1374   
             }
 1375   
         }
 1376   
     }
 1377   
 
 1378   
     private Button iStopButton = null;
 1379   
 
 1380   
     /**
 1381   
      * Return the StopButton property value.
 1382   
      * @return java.awt.Button
 1383   
      */
 1384  0
     private Button getStopButton() {
 1385  0
         if (iStopButton == null) {
 1386  0
             try {
 1387  0
                 iStopButton = new Button();
 1388  0
                 iStopButton.setName("StopButton");
 1389  0
                 iStopButton.setLabel("Stop");
 1390  0
                 iStopButton.setEnabled(false);
 1391   
             } catch (Throwable iExc) {
 1392  0
                 handleException(iExc);
 1393   
             }
 1394   
         }
 1395  0
         return iStopButton;
 1396   
     }
 1397   
 }
 1398