From fcd6548344aa3f590435beff55530cfdb6983588 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Thu, 25 Oct 2001 12:37:31 +0000 Subject: [PATCH] "Finally I managed to finish a new version of the VAJ tasks. The most important new feature is the ability to execute VAJ tasks from the command line by exploiting the Remote Tool Access feature of VAJ." Submitted by: wolf.siberski@tui.de Some patches look a lot larger as I had to remove stray CRs, I also killed TABs wherever I stumbled over them. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269819 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 22 +- build.xml | 6 + docs/manual/Integration/VAJAntTool.html | 967 +++---- docs/manual/Integration/anttool1.gif | Bin 7313 -> 4211 bytes docs/manual/Integration/remacc.gif | Bin 0 -> 10931 bytes .../ant/taskdefs/optional/ide/VAJAntTool.java | 142 +- .../taskdefs/optional/ide/VAJAntToolGUI.java | 2522 +++++++++-------- .../taskdefs/optional/ide/VAJBuildInfo.java | 703 +++-- .../ant/taskdefs/optional/ide/VAJExport.java | 275 +- .../optional/ide/VAJExportServlet.java | 172 ++ .../ant/taskdefs/optional/ide/VAJImport.java | 341 +-- .../optional/ide/VAJImportServlet.java | 102 + .../ant/taskdefs/optional/ide/VAJLoad.java | 92 + .../optional/ide/VAJLoadProjects.java | 200 +- .../taskdefs/optional/ide/VAJLoadServlet.java | 106 + .../taskdefs/optional/ide/VAJLocalUtil.java | 465 +++ .../optional/ide/VAJProjectDescription.java | 105 + .../taskdefs/optional/ide/VAJRemoteUtil.java | 250 ++ .../ant/taskdefs/optional/ide/VAJTask.java | 103 + .../optional/ide/VAJToolsServlet.java | 226 ++ .../ant/taskdefs/optional/ide/VAJUtil.java | 86 +- .../optional/ide/VAJWorkspaceScanner.java | 33 +- 22 files changed, 4196 insertions(+), 2722 deletions(-) create mode 100644 docs/manual/Integration/remacc.gif create mode 100644 src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJExportServlet.java create mode 100644 src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJImportServlet.java create mode 100644 src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoad.java create mode 100644 src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadServlet.java create mode 100644 src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLocalUtil.java create mode 100644 src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJProjectDescription.java create mode 100644 src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJRemoteUtil.java create mode 100644 src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJTask.java create mode 100644 src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJToolsServlet.java diff --git a/WHATSNEW b/WHATSNEW index fa613464a..17a9215c1 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -4,6 +4,16 @@ Changes from Ant 1.4.1 to current CVS version Changes that could break older environments: -------------------------------------------- +Fixed bugs: +----------- + +* Fixed bug where ant would not copy system properties into new Project + in ant/antcall tasks when inheritall="false" is set. + +* would not close the original property file. + +* will no longer override a subbuilds basedir with inheritall="true". + Other changes: -------------- @@ -23,15 +33,9 @@ Other changes: * and will now emit a warning if a task/type of the given name already exists. -Fixed bugs: ------------ - -* Fixed bug where ant would not copy system properties into new Project - in ant/antcall tasks when inheritall="false" is set. - -* would not close the original property file. - -* will no longer override a subbuilds basedir with inheritall="true". +* A new revision of VAJ tasks: The most important new feature + is the ability to execute VAJ tasks from the command line by + exploiting the Remote Tool Access feature of VAJ. Changes from Ant 1.4 to Ant 1.4.1 =========================================== diff --git a/build.xml b/build.xml index a5a575ee5..92a6e484f 100644 --- a/build.xml +++ b/build.xml @@ -161,6 +161,10 @@ + + @@ -238,6 +242,8 @@ + -

Visual Age for Java Tasks and Plugin User Manual

- by -Version 1.1 - 2001/02/14
+

Visual Age for Java Tasks and Plugin User Manual

+ by +Version 1.2 - 2001/06/14

-

Table of Contents

+

Table of Contents

+
  • Introduction +
  • The Tasks + +
  • A sample build file
    +
  • The Plugin + +
  • Frequently Asked Questions> +
  • Visual Age Versions> +
  • History

  • -

    Introduction

    -Visual Age for Java is a great Java IDE, but it lacks decent -build support; for creating deliveries. On the other hand, -Ant supports the build process very good, but is -(at least at the moment) command line based. So we decided -to write some tasks to access the VAJ repository and -a small visual Ant frontend to make running Ant from VAJ possible. -We use the Tool API to integrate Ant in VisualAge for Java. -In combination with the VAJ tasks (vajload, vajexport, vajimport) -you can load defined defined versions of projects into your workspace, -export the source code, compile it with an external compiler -and build a jar without leaving the IDE. Of course compile -messages are viewed in a logging window. Concluding: This -tool provides decent deployment support VAJ has not (out of the box).
    - -

    The Tasks

    +

    Introduction

    +

    Visual Age for Java is a great Java IDE, but it lacks +decent build support; for creating deliveries. On the other hand, Ant supports +the build process very good, but is (at least at the moment) command line based. +So we decided to write some tasks to access the VAJ repository and a small +visual Ant frontend to make running Ant from VAJ possible. We use the Tool API +to integrate Ant in VisualAge for Java. In combination with the VAJ tasks +(vajload, vajexport, vajimport) you can load defined versions of projects +into your workspace, export the source code, compile it with an external +compiler and build a jar without leaving the IDE. Of course compile messages are +viewed in a logging window. Concluding: This tool provides decent deployment +support VAJ has not (out of the box).

    +

    What's new

    + + + +
    2001/06/14 +
      +
    • Now all tasks can access VAJ via 'Remote Access + To Tool API'. Therefore builds containing VAJ tasks can also be executed + from the command line (Kudos to Glenn McAllister for describing the + concept and providing source code at + + http://www7.software.ibm.com/vad.nsf/Data/Document4366.  + +
    • It is possible to cancel a running build + executed from the plugin +
    • Improved error handling in the plugin. Now all + errors should show up either in the log window or in the + console.
    + +

    The Tasks

    At the moment there are three tasks which help integrating the VAJ repository contents into an external build process: - - - - - - - - - - - - - - -
    VAJLoad
    -
    loads specified versions into the workspace
    -
    VAJExport
    -
    exports specified packages into the file system
    -
    VAJImport
    -
    imports specified files into the workspace
    -
    -These tasks are described in detail below. + + + VAJLoad
    + loads specified versions into the workspace
    + + VAJExport
    + exports specified packages into the file system
    + + VAJImport
    + imports specified files into the workspace
    +

    These tasks are described in detail below.

    +
    -

    VAJLoad

    -

    Description:

    -

    Loads a specified VAJ project version into the workspace.

    -

    Parameters

    -

    none

    +

    +

    VAJLoad

    +

    Description:

    +

    Loads a specified VAJ project version into the +workspace.

    + +

    Parameters

    -

    Parameters specified as nested elements

    -

    vajproject

    - - - - - + + + + + + +
    AttributeDescriptionRequired
    AttributeDescriptionRequired
    remote +

    name and port of a remote tool server. (format: + <servername>:<port no>).
    If this + attribute is set, the tasks will be executed on the specified tool + server. 

    no
    + +

    Parameters specified as nested elements

    +

    vajproject

    + + - - - - + + + - - - - - - -
    namename of the VAJ project to load into the workspaceyes
    AttributeDescriptionRequired
    versionname of the requested versionyes
    - -

    Example

    -
    -<vajload>
    -    <vajproject name="My Testcases" version="1.7beta" />
    -    <vajproject name="JUnit" version="3.2" />
    +       name
    +       name of the VAJ project to load into 
    +      the workspace
    +       yes
    +     
    +       version
    +       name of the requested version
    +       yes
    +     
    +       remote
    +       
    +      

    name and port of a remote tool server. (format: + <servername>:<port no>).
    If this + attribute is set, the tasks will be executed on the specified tool + server. 

    + no + +

    Example

    +
    <vajload remote="localhost:32767">
    +    <vajproject name="My Testcases" version="1.7beta"/>
    +    <vajproject name="JUnit" version="3.2" />
     </vajload>
    -
    +

    -

    VAJExport

    +

    VAJExport

    -

    Description:

    +

    Description:

    Exports Java source files, class files and/or resources from the workspace to the file system. Exports can be specified by giving the VAJ project -name and package name(s). This works very similar to -FileSets.

    +name and package name(s). This works very similar to +FileSets.

    -

    Parameters

    +

    Parameters

    - + - - - - + + + - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttributeDescriptionRequired
    AttributeDescriptionRequired
    destdirlocation to store the exported filesyes
    destdirlocation to store the exported +filesyes
    exportSourcesexport source files (default: "yes")no
    exportResourcesexport resource files (default: "yes")no
    exportClassesexport class files (default: "no")no
    exportDebugInfoinclude debug info in exported - class files (default: "no")no
    defaultexcludes use default excludes when exporting (default: "yes")no
    - -

    Parameters specified as nested elements

    - -

    include

    + exportSources + export source files (default: +"yes") + no + + exportResources + export resource files (default: + "yes") + no + + exportClasses + export class files (default: "no") + no + + exportDebugInfo + include debug info in exported class + files (default: "no") + no + + defaultexcludes + +

    use default excludes when exporting (default: "yes").
    Default excludes are: IBM*/**, Java + class libraries/**, Sun class libraries*/**, JSP Page Compile Generated + Code/**, VisualAge*/** 

    + no + + overwrite + overwrite existing files (default: + "yes") + no + + remote + +

    name and port of a remote tool server. (format: + <servername>:<port no>).
    If this + attribute is set, the tasks will be executed on the specified tool + server. 

    + no + +

    Parameters specified as nested elements

    + +

    include

    specifies the packages to include into the export - + - - - - + + + - - + - - - -
    AttributeDescriptionRequired
    AttributeDescriptionRequired
    namename of the VAJ project and package to export.
    +
    namename of the VAJ project and package to export.
    The first element of the name must be the project name,
    - then the package name elements separated by '/'.
    yes
    + then the package name elements + separated by '/'. + yes -

    exclude

    +

    exclude

    specifies the packages to exclude from the export
    - + - - - - + + + - - - - - -
    AttributeDescriptionRequired
    AttributeDescriptionRequired
    namename of the VAJ project/package not to exportyes
    - -

    Example

    -
    -<vajexport destdir="${src.dir}" exportResources="no">
    -    <include name="MyProject/**"/>
    -    <exclude name="MyProject/test/**"/>
    +       name
    +       name of the VAJ project/package not to 
    +      export
    +       yes
    +
    +

    Example

    +
    <vajexport destdir="${src.dir}" exportResources="no">
    +    <include name="MyProject/**"/>
    +    <exclude name="MyProject/test/**"/>
     </vajexport>
    -
    +
    This example exports all packages in the VAJ project 'MyProject', except packages starting with 'test'. -

    Default Excludes

    +

    Default Excludes

    The default excludes are:
    -
    -	IBM*/**
    +
    	IBM*/**
     	Java class libraries/**
     	Sun class libraries*/**
     	JSP Page Compile Generated Code/**
    -	VisualAge*/** 
    -
    + VisualAge*/** +

    -

    VAJImport

    +

    VAJImport

    -

    Description:

    -

    Imports Java source files, class files and/or resources from the file -system into VAJ. These imports can be specified with a fileset.

    -

    Parameters

    +

    Description:

    +

    Imports Java source files, class files and/or resources +from the file system into VAJ. These imports can be specified with a fileset. +

    +

    Parameters

    - + + + + + - - - - + + + - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - -
    AttributeDescriptionRequired
    AttributeDescriptionRequired
    vajProjectimported files are added to this VAJ + projectyes
    vajProjectimported files are added to this VAJ projectyes
    importSourcesexport source files (default: +"yes")no
    importResourcesexport resource files (default: + "yes")no
    importClassesexport class files (default: "no")no
    importSourcesexport source files (default: "yes")no
    importResourcesexport resource files (default: "yes")no
    importClassesexport class files (default: "no")no
    - -

    Parameters specified as nested elements

    - -

    fileset

    -A FileSet specifies the files to import. - -

    Example

    -
    -<vajimport project="Test" importClasses="true">
    +       remote
    +       
    +      

    name and port of a remote tool server. (format: + <servername>:<port no>).
    If this + attribute is set, the tasks will be executed on the specified tool + server. 

    + no + +

    Parameters specified as nested elements

    + +

    fileset

    +A FileSet specifies the files to import. + +

    Example

    +
    <vajimport project="Test" importClasses="true">
         <fileset dir="${import.dir}">
             <include name="com/sample/**/*.class"/>
    -        <exclude name="com/sample/test/**"/>
    +        <exclude name="com/sample/test/**"/>
         </fileset>
     </vajimport>
    -
    +
    This example imports all class files in the directory ${import.dir}/com/sample excluding those in the subdirectory test

    -

    A sample build file

    -This is a sample build file which builds a zip file useful for distribution -of the VAJ plugin. The build file exports a specific version of Ant, compiles -it, extracts necessary helper classes and zips everything together. This -is useful as complete example as well as to deploy Ant in a team where all -developers use VAJ. The resulting zip file must be unzipped in -<VAJInstallDir>\ide\tools\org-apache-tools-ant. -For more information see the installation section.
    -
    -
    -<?xml version="1.0"?>
    -<!-- ======================================================================= -->
    -<!-- Builds a binary distribution of the VAJ Ant Plugin                      -->
    -<!-- ======================================================================= -->
    -<project name="anttool" default="buildall" basedir="c:\temp\anttool">
    -
    -  <property name="src.dir" value="${basedir}/src"/>
    -  <property name="zip.dir" value="${basedir}/dist"/>
    -  <property name="build.classes" value="${basedir}/classes"/>
    -
    -  <!-- location of the unzipped Ant source distribution  -->
    -  <property name="antdistribution.dir" value="u:\ant-1.3beta1"/>
    -
    -  <!-- VAJ install dir -->
    -  <property name="vaj.dir" value="C:\IBMVJava2"/>
    -
    -  <path id="classpath">
    -      <pathelement location="${src.dir}"/>
    -      <pathelement location="${vaj.dir}\IDE\project_resources\IBM IDE Utility class libraries" />
    -      <pathelement location="${build.classes}"/>
    -  </path>
    -
    -
    -  <!-- =================================================================== -->
    -  <!-- Load Projects into Workspace                                        -->
    -  <!-- =================================================================== -->
    -  <target name="load" description="load projects">
    -    <vajload>
    -      <project name="Ant" version="1.3"/>
    -      <project name="Apache Oro RegExp" version="2.0.1"/>
    -    </vajload>
    -  </target>
    -
    -
    -  <!-- =================================================================== -->
    -  <!-- Creates the build dirs                                              -->
    -  <!-- =================================================================== -->
    -  <target name="preparedirs">
    -    <mkdir dir="${basedir}"/>
    -    <mkdir dir="${src.dir}"/>
    -    <mkdir dir="${zip.dir}"/>
    -    <mkdir dir="${build.classes}"/>
    -  </target>
    -
    -
    -  <!-- =================================================================== -->
    -  <!-- Export from VA                                                      -->
    -  <!-- =================================================================== -->
    -  <target name="export" depends="preparedirs" description="export projects">
    -    <mkdir dir="${src.dir}"/>
    -    <!-- Export all Ant sources except optional tasks and the Oro sources -->
    -    <vajexport destdir="${src.dir}">
    -      <include name="Ant/**"/>
    -      <exclude name="Ant/**/optional/**"/>
    -      <exclude name="Ant/org/apache/tools/ant/gui/**"/>
    -      <include name="Apache Oro*/**"/>
    -    </vajexport>
    -    <!-- Export selected optional tasks -->
    -    <vajexport destdir="${src.dir}">
    -      <include name="Ant/org/apache/tools/ant/taskdefs/optional/ide/**"/>
    -    </vajexport>
    -  </target>
    -
    -  <!-- =================================================================== -->
    -  <!-- Unzip necessary libraries                                           -->
    -  <!-- =================================================================== -->
    -  <target name="expand">
    -    <mkdir dir="${build.classes}"/>
    -    <unzip src="${antdistribution.dir}\lib\crimson.jar"
    -           dest="${build.classes}"
    -    />
    -    <unzip src="${antdistribution.dir}\lib\jaxp.jar"
    -           dest="${build.classes}"
    -    />
    -    <delete dir="${build.classes}\META-INF" />
    -  </target>
    -
    -  <!-- =================================================================== -->
    -  <!-- Compile the source code                                            -->
    -  <!-- =================================================================== -->
    -  <target name="compile" depends="expand" description="compile java sources">
    -    <mkdir dir="${build.classes}"/>
    -    <javac srcdir="${src.dir}"
    -           destdir="${build.classes}"
    -           debug="on"
    -           deprecation="off"
    -           optimize="on" >
    -      <classpath refid="classpath" />
    -      <include name="org/apache/**"/>
    -      <exclude name="**/JakartaRegexpMatcher.java"/>
    -    </javac>
    -  </target>
    -
    -  <!-- =================================================================== -->
    -  <!-- Copy resources and zip everything together                           -->
    -  <!-- =================================================================== -->
    -  <target name="zip" depends="compile" description="creates zip distribution">
    -    <copy todir="${build.classes}">
    -      <fileset dir="${src.dir}">
    -          <include name="org/apache/**"/>
    -          <exclude name="**/*.java"/>
    -      </fileset>
    -    </copy>
    -    <mkdir dir="${build.classes}/doc"/>
    -    <copy todir="${build.classes}/doc" overwrite="yes">
    -      <fileset dir="${antdistribution.dir}/docs">
    -          <include name="VAJAnttool.html, toolmenu.gif, anttool1.gif"/>
    -      </fileset>
    -    </copy>
    -    <copy file="${antdistribution.dir}/src/main/org/apache/tools/ant/taskdefs/optional/ide/default.ini" todir="${build.classes}" overwrite="yes"/>
    -    <mkdir dir="${zip.dir}"/>
    -    <zip basedir="${build.classes}" zipfile="${zip.dir}/anttool.zip" />
    -  </target>
    -
    -  <!-- =================================================================== -->
    -  <!-- Cleans source and class dirs                                        -->
    -  <!-- =================================================================== -->
    -  <target name="clean" depends="preparedirs" description="removes all files from src and build tree">
    -    <delete>
    -      <fileset dir="${src.dir}"/>
    -    </delete>
    -    <delete>
    -      <fileset dir="${build.classes}"/>
    -    </delete>
    -    <delete>
    -      <fileset dir="${zip.dir}"/>
    -    </delete>
    -  </target>
    -
    -  <!-- =================================================================== -->
    -  <!-- Cleans the build dir, loads required project versions, exports,     -->
    -  <!-- compiles and zips the Plugin                                        -->
    -  <!-- =================================================================== -->
    -  <target name="buildall" depends="clean, load, export, zip" description="build all">
    -  </target>
    -</project>
    -
    - -
    -

    The Plugin

    +

    The +Plugin

    The tasks are usable within VAJ by running the org.apache.tools.ant.Main class, but this is quite inconvenient. Therefore a small GUI is provided which allows selecting a build file and executing its targets. This Plugin is accessible -from the VAJ Tools menu (see Usage). +from the VAJ Tools menu (see Usage).
    -

    Installation

    -At the moment the installation has it's rough edges. If something +

    Installation

    +

    At the moment the installation has it's rough edges. If something described below doesn't work for You, it's probably not Your fault but incomplete/wrong instructions. In this case, please contact one -of the authors. -We assume C:\IBMVJava as VAJ install -directory. If You have installed it elsewhere, adapt the pathes below. -Execute following steps to get the PlugIn up and running: +of the authors.

    +

    We assume C:\IBMVJava as VAJ +install directory. If You have installed it elsewhere, adapt the pathes below. +

    Plugin

      -
    • install the Visual Age IDE Tools (via File->Quick Start-> - Add feature->'IBM IDE Utility class libraries' -
    • -
    • import an appropriate XML parser to VAJ (we use Xerces 1.2.0 and are - happy with it). Unfortunately the XML parser delivered with VAJ (in - the project 'IBM XML Parser for Java') doesn't work with Ant. You have to - remove that project (temporarily) from the workspace before importing another - XML implementation. -
    • - -
    • import the Ant sources into VAJ.
    • -
    • Create the directory - C:\IBMVJava\ide\tools\org-apache-tools-ant. -
    • -
    • export the Ant and XML parser class files into this directory. Be sure - to select class files and resources. Sources don't have to be exported. - Some optional tasks have errors and can't be exported when You - don't have the necessary packages in Your workspace (e.g. junit - task, ejbc task). If You need this tasks either import these packages - into VAJ, too, or copy the .class files directly from the binary - distribution. -
    • -
    • copy default.ini (in - jakarta-ant\src\...\taskdefs\optional\ide) to - C:\IBMVJava\ide\tools\org-apache-tools-ant\default.ini. -
    • +
    • install the Visual Age IDE Tools (via File->Quick + Start-> Add feature->'IBM IDE Utility class libraries' +
    • import an appropriate XML parser to VAJ (we use Xerces + 1.2.0 and are happy with it). Unfortunately the XML parser delivered with VAJ + (in the project 'IBM XML Parser for Java') doesn't work with Ant. You have to + remove that project (temporarily) from the workspace before importing another + XML implementation. + +
    • import the Ant sources and resources into VAJ. +
    • Create the directory + C:\IBMVJava\ide\tools\org-apache-tools-ant. +
    • export the Ant and XML parser class and resource files + into this directory. Be sure to select class files and + resources. Sources don't have to + be exported. Some optional tasks have errors and can't be exported when You + don't have the necessary packages in Your workspace (e.g. junit task, ejbc + task). If You need this tasks either import these packages into VAJ, too, or + copy the .class files directly from the binary distribution. +
    • copy default.ini (in + jakarta-ant\src\...\taskdefs\optional\ide) to + C:\IBMVJava\ide\tools\org-apache-tools-ant\default.ini. +
    • if you want to access this help from the Workbench, create the - directory C:\IBMVJava\ide\tools\org-apache-tools-ant\doc - and copy the files VAJAntTool.html, - toolmenu.gif and - anttool1.gif to it. -
    • -
    • VAJ has to be restarted to recognize the new tool.
    • + directory C:\IBMVJava\ide\tools\org-apache-tools-ant\doc + and copy the files VAJAntTool.html, + toolmenu.gif and + anttool1.gif to it. +
    • VAJ has to be restarted to recognize the new tool.
    • Now if You open the context menu of a project, You should see the entry - 'Ant Build' in the Tools submenu (see Usage). -
    • -
    • Make sure the tool works as expected. Now You can remove Ant and the - imported XML parser from Your workspace (and optionally add the - IBM parser again). -
    • -
    + 'Ant Build' in the Tools submenu (see Usage). +
  • Make sure the tool works as expected. Now You can + remove Ant and the imported XML parser from Your workspace (and optionally add + the IBM parser again).
  • +

    Servlets for Remote Tool Access

    +
      +
    • + For + a good introduction into the VAJ Remote Tool Access see the + great introduction from Glenn McAllister at + + http://www7.software.ibm.com/vad.nsf/Data/Document4366. It + is highly recommended to read this article before doing the installation (to + understand what you do :-) ). +
    • insert the following lines into + C:\IBMVJava\ide\tools\com-ibm-ivj-toolserver\servlets\servlet.properties. + Typically this file is empty. If not, be careful not to delete the other lines. + + +
      +
      servlet.vajload.code=org.apache.tools.ant.taskdefs.optional.ide.VAJLoadServlet
      +servlet.vajexport.code=org.apache.tools.ant.taskdefs.optional.ide.VAJExportServlet
      +servlet.vajimport.code=org.apache.tools.ant.taskdefs.optional.ide.VAJImportServletName
        
      +
    • export the following classes from the package + org.apache.tools.ant + to C:\IBMVJava\ide\tools\com-ibm-ivj-toolserver\servlets\:
      + BuildException
      + DirectoryScanner
      + FileScanner
      + Location
      +
    • export the following classes from the package + org.apache.tools.ant.taksdefs.optional.ide + to C:\IBMVJava\ide\tools\com-ibm-ivj-toolserver\servlets\:
      + VAJUtil
      + VAJExportServlet
      + VAJImportServlet
      + VAJLoadServlet
      + VAJLocalUtil
      + VAJProjectDescription
      + VAJToolsServlet
      + VAJWorkspaceScanner
      +
    • configure the Remote Access (via + Window->Options..., then choose 'Remote Access To Tool API') as shown in + the following picture:
    +

    +

    Now you should be able to execute VAJ Tasks from the +command line.


    -

    Usage

    -Beeing sure the tool is installed correctly and your Ant build +

    Usage

    +

    Plugin

    +

    + When the tool is installed correctly and your Ant build file is configured, it is really easy to use.
    Go to your Workbench, select the project you want to deploy and -open its context menu. In the submenu Tools you should find -the new entry Ant Build. Klick it to start the tool! +open its context menu. In the submenu Tools you should find +the new entry Ant Build. Klick it to start the tool!

    -
    +
    After a short time this frame should pop up: -
    +
    This frame contains the following elements:
      -
    • A menubar with some options described later
    • -
    • The name of your selected VAJ project
    • -
    • An entry field for the Ant XML buildfile with a browse [...] button. - The full qualified filename, including the directory is needed here. -
    • -
    • A list with tasks specified in the buildfile. Until your first save - of the build info (described later), this list will be empty. When - loading a build file by the Reload Project button, this list +
    • A menubar with some options described later +
    • The name of your selected VAJ project +
    • An entry field for the Ant XML buildfile with a browse + [...] button. The full qualified filename, including the directory is needed + here. +
    • A list with tasks specified in the buildfile. Until your first save of + the build info (described later), this list will be empty. When loading + a build file by the ( Re)Load  button, this list is filled with all tasks which have a description attribute. The task you select in this list will be executed when pressing the - Execute Task button. -
    • -
    • A pulldown box for specifying the log level.
    • -
    • Three buttons. Two of them I have already described and the third one - is just the Close button to exit our small tool! -
    • -
    + Execute  button. +
  • A pulldown box for specifying the log level. +
  • Four buttons. Two of them I have already + described. The other are the Stop button to cancel a running build + and the third one is just the Close button to exit our small tool! +
  • Note that the build is canceled on the next console + output after pressing the Stop button, not + directly after pressing it.
  • +

    After you have set up your buildprocess you might find it useful to save the data you've just entered, so we implemented an option to save it to the repository into your selected project. Make sure that you have an open edition of your project before selecting -Save BuildInfo To Repository from the File menu. +Save +BuildInfo To Repository from the File menu. Now your information is saved to this edition of your project and will -be loaded automatically the next time you start Ant Build.
    +be loaded automatically the next time you start Ant Build.
    If you have closed the log window accidentally, it can be reopened -with the Log item in the File menu, and if you want to -know who developed this, just select About in the Help menu. +with the Log item in the File menu, and if you want to +know who developed this, just select About in the Help menu.

    +

    Servlets for Remote Tool Access

    +

    With the servlets installed and the remote access +running you can use Ant from the command line without any restrictions. Just +make sure the remote attribute in your build file is set correctly.


    -

    Frequently Asked Questions

    - -

    Q: I want to load, export and build more then one Visual Age project -to one jar! How to?
    -A: The VA tasks are able to load and export several Projects all -at once. You can choose whatever project you like for storing the tool -information, it doesn't really matter -

    -

    Q: When I load my build file, the list of targets is empty. Why?
    -A: You need to add the optional "description" parameter to the targets You -want to come up in the list. Then reload the build file in the "ant build" -tool. We chose to display only targets with description to allow the build -file developer to distinguish between targets for end users and helper targets. -

    -

    Q: Is there a sample build file available?
    -A: Now You can find an example in this manual -

    - -

    Q: Why does it export my entire workspace when I've already implicitly -selected a project when starting the Tool?
    -A: This selection does not carry into the buildfile you are using. Set the -Project name at the beginning of the "includes" parameter. -

    -

    Q: When I import Ant into my Workspace, I get Problems reported. Can I -ignore them?
    +

    Frequently Asked +Questions

    +

    Q: If I try to load a build +file, I get the error "Can't load default task list". Why?
    +A: Ant not only contains class files, but also resource +files. This messsage appears if the file +
    .../org/apache/tools/ant/taskdefs/defaults.properties is +missing. Make sure that you import/export not only java/class files, but also +all resource files when importing/exporting Ant.

    +

    Q: I want to load, export +and build more then one Visual Age project to one jar! How to?
    +A: The VA tasks are able to load and export several +Projects all at once. You can choose whatever project you like for storing the +tool information, it doesn't really matter

    +

    Q: When I load my build +file, the list of targets is empty. Why?
    +A: You +need to add the optional "description" parameter to the targets you want to come +up in the list. Then reload the build file in the "ant build" tool. We chose to +display only targets with description to allow the build file developer to +distinguish between targets for end users and helper targets.

    +

    Q: Is there a sample build +file available?
    +A: Now you can find an example in this manual

    +

    Q: Why does it export my +entire workspace when I've already implicitly selected a project when starting +the Tool?
    +A: This selection does not carry into +the buildfile you are using. Set the Project name at the beginning of the +"includes" parameter.

    +

    Q: When I import Ant into +my Workspace, I get Problems reported. Can I ignore them?
    A: It depends on the problems reported, and what you want to do with Ant. -Problems you can't ignore:

    +Problems you can't ignore:
    • Classes from javax.xml.parser missing - install a compatible parser - (see installation) -
    • + (see installation)
    • Classes from com.ibm.ivj.util missing - install the Visual Age IDE - Utility feature (see installation). -
    • -
    - -

    Q: Why is the task name vajload when the class is called VAJLoadProjects?
    -A: At the moment this task can load only project versions. This is reflected -by the class name. It may be extended to load package and class versions, -too, and we didn't want to let these extensions affect the build files. Therefore -we chose the more general name vajload as task name. -

    -

    Q: I want to use the same buildfile both within Visual Age and from the -command line using my regular Ant environment. What do I need to be aware -of?
    -A: The three Visual Age Tasks won't work when executing Ant from the command -line. -

    -

    Q: How do I control the import/export of sourcefiles, compiled files and -project resources explicity?
    -A: Via the Boolean values exportClasses (default false) exportSources (default -true) and exportResources (default true). In some situations, Resources are -not exported correctly without this being explicity set. -

    + Utility feature (see installation). +
  • Errors in optional tasks you use within your build + file
  • +
    + +

    Q: I want to use the same +buildfile both within Visual Age and from the command line using my regular Ant +environment. What do I need to be aware of?
    +A: +You have to specifie a remote server via the 'remote' attribute. Otherwise the +three Visual Age tasks won't work when executing Ant from the command line.

    + +

    Q: I can export packages +from project 'ABC', but not from project 'XYZ'! Why?
    +A: Common reasons are:

    +
      +
    • The project is excluded by the default excludes (see + attribute 'defaultexcludes' of VAJExport) +
    • When looking at the project in the workspace, it is + often difficult to distinguish between project name and version name (e.g. as + in 'My GUI Components Java 2 3.5'). Check if you have the right project name + by switching off the version name display temporarilly.
    +

    Q: How do I control the +import/export of sourcefiles, compiled files and project resources +explicity?
    +A: Via the Boolean values +exportClasses (default false) exportSources (default true) and exportResources +(default true). In some situations, Resources are not exported correctly without +this being explicity set. VAJ doesn't export resources correctly if a package +contains only resources (see below).


    -

    Known Problems

    +

    Known +Problems

      -
    • Exporting a package containing just resources doesn't work. This is - a VAJ Tool API bug. Workaround: create a dummy class and set 'exportSources' - to false. -
    • -
    +
  • Exporting a package containing just resources doesn't + work. This is a VAJ Tool API bug. Workaround: create a dummy class and set + 'exportSources' to false.

  • -

    VisualAge for Java Versions

    +

    VisualAge +for Java Versions

    This tool integration has been tested with versions 3.02 and 3.5 of VisualAge for Java. It should run with the 2.x Versions, too, but -we didn't try. The graphical user interface is build with AWT so it is +we didn't try. The graphical user interface is built with AWT so it is JDK independent by now.
    -

    History

    +

    History

    - - - - - - - - - - - - -
    1.02000/09/11Initial Version
    1.12001/02/14Added Task documentation and more FAQs (thanks to - Richard Bourke for the FAQ additions) -
    + + 1.0 + 2000/09/11 + Initial Version + + 1.1 + 2001/02/14 + Added Task documentation and more FAQs + (thanks to Richard Bourke for the FAQ additions) + + 1.2 + 2001/07/02 + +

    Added documentation of new remote feature.
    Minor corrections.


    -
    Copyright © 2001 Apache Software Foundation. All rights Reserved.
    +
    Copyright &#copy 2001 Apache Software +Foundation. All rights Reserved.
    diff --git a/docs/manual/Integration/anttool1.gif b/docs/manual/Integration/anttool1.gif index 6859656b910a84948151272b8ca83be38fc1452d..ad450ba677d94b6bd1943758cd7d1497fc0d8fcc 100644 GIT binary patch literal 4211 zcmV-(5RC6fNk%v~VTA$l05bppEC2ui0EGeZ0D}Mk0Du4h0Du61fB*mhfPesi0Dypi zfPlcj!2bXM0RI60{{R30|Nj900RR90|NjL45Xniay*TU5yZ>M)j$~<`XsWInfIM(4 z&vb3yc&_h!@BhG{a7Zi~kI1C$;Cis0(5Q4uty-^G6Z4hrdcWYXcr4yJ5rnjQ&2GEj z@VIe?0)Kh&%vkn_Os~p)iWMGOE12zQ4eMXB$kz8cc{C$ON-zueYG0Y%qD$YSh+x z+1Y#Cb>4k6ci!Na<-w=M8O0I+?(grL$sEh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$Kv8O_`hFfu4XVOA3 z;m(6!>Vt)>t-L=+$kbF_x4S2ShF>}N;Ro!s_;Ixt(o5oxx^nSy@0ew}#}mp8j=dap zgqXy{nWz7#v|pK)l`W8dsdDGb6hY;984feK;r?IUbQvTk&8Hm++eK)Apv8 z4Q4<%(xyoNrngQ0gKZg57}q|%Q3|-Rd2Y?5W5zZw&6yqYfuXf4n_iF?Z; zQQ%}tVZ+Qvl#FevZE-BGno$H-HXXKrt2@ur^mB7XIoGm=LsPfHCge_c=N*L)bXqnV zTV2|I%qY2b938g0cK!bT-7NgGg~={@J_-7?mk+NmQWx8<=P`7vsm)_VYF62kAb-T~ zSpqwg(45qk|Ks)1z|hZoW|0rEGGUth==W@XMzb5<^M!G&P|V&R-<2RPf5?|8`E$r> z0^K>o81FZ8=w^PhKkRF2_7L=2-CN@9hs>Ejr}=U!&WQbCc{1W)$}qt1w z1@Ns}`p`Whbu<0xgA0jRG3Y{`_C~PzirH8(nUi|hhy-Wp0xK40O|`3py-=l9t4pUx z3A&?t;c6n*m!l!-BBC!Nv~8?8GD+%US>L_KrYx>jK>m`jeHmrCYR%P7`b*kB4oVUR a@r*(=9u&Qd2HSx6mPr~4S)xLK(*FZI&smQE diff --git a/docs/manual/Integration/remacc.gif b/docs/manual/Integration/remacc.gif new file mode 100644 index 0000000000000000000000000000000000000000..e02e0488781c5e57b0e723fdcd73dea928d60809 GIT binary patch literal 10931 zcmV;kDooW!Nk%v~VM_vq0y6*rEC2ui080Xe0)qem0Du4h0Du61fB*mhfPesi0Dypi zfPlcj!2bXM0RI60{{R30|Nj900RR90|NjL45Xniay*TU5yZ>M)j$~<`XsWJk>%MTD z0?1?Ec&_h!@BhG{a7Zi~kI1BQ$!t2G(5Q4utu7C=hiuF3dcWYXcuX#v&me3KL1??* z@VI2330}NyZ5a%i&!E+z~;}~Q}vZTqAC_Q0|7*V1AGVv*Vy7~nunQ%eTOeKZ(!AV{xWg{m7HQmNUq zXw!z8R|x>NdQewA7$70zRaY8!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p*Y|FAcv6SKhqhcpE$7fAqSju80l3XtS zNO{a*NBI~I6t6-kC?bvpptB((KHzZ0;`m}JmU}3lqgW=6sE><PxwEBKPbNcOWxxt-Z(9gtGZ&q#5&n7PT4w^Ec9c> z05ZPPb3e1v;#HU@rW!t04&|TnrrBdY?yIya1}TZ0WKK%sJ3g*0;J)3vxnzE2KMp+H1HOC$ zd}C1=$U=!El%egQs$X#$&4Q3jYf-iKH@c%=Sm9Wvn1&`CRl>jXlv$ZhF*&_ zJ84Qf8#3fV9>(b|v}k$R$g!+LJ5;*=pk_mEZs96)lATuSrDp1;cIu~w>Zq3Lsix{J za5<0jy~$0Y>}>B!mkGFAQbDdzQM9K>lQ@ov=+g&W@`#`>$jG;xRz^#qwBi% zx4Xt`deiH@PPe}H>u&?>z^=BzCTwLh?86Sak5cS`OYFv$wa12RQFFj-qqgpBz;4{+ z;qB(??&gN?R^IS#VwomyZ@O6jML=(eR`2!3I4N_g$_ldg2B&%+=8EQS`Q8QdhGqXl z<|D;#XQpOu;_vbH@0Tkw+-l^5D)4`Lxde~z1^4a-_dnP3kO1;I1CH`qrCA8``D@c;I|2e+>jS7)XB<(ul|hgEPHe`6EZy%gebHV!Rm zUM_#K@dvALApdV6Cq2euu5><)B6C#RdP>NCpo zkdARgA7y2K5x2?NL|HQa5#?IPO%3Fi~gq zQgZcI-=tWVbxNZ3T5qIV$MrbU^. */ + +package org.apache.tools.ant.taskdefs.optional.ide; + + import com.ibm.ivj.util.base.Project; import com.ibm.ivj.util.base.ToolData; import com.ibm.ivj.util.base.IvjException; import org.apache.tools.ant.BuildException; + /** * This class is the equivalent to org.apache.tools.ant.Main for the * VAJ tool environment. It's main is called when the user selects @@ -68,64 +71,81 @@ import org.apache.tools.ant.BuildException; * @author: Wolf Siberski */ public class VAJAntTool { - private static final String TOOL_DATA_KEY = "AntTool"; -/** - * Loads the BuildInfo for the specified VAJ project from the - * tool data for this project. - * If there is no build info stored for that project, a new - * default BuildInfo is returned - * - * @return BuildInfo buildInfo build info for the specified project - * @param projectName String project name - */ -public static VAJBuildInfo loadBuildData(String projectName) { - VAJBuildInfo result = null; - try { - Project project = VAJUtil.getWorkspace().loadedProjectNamed( projectName ); - if ( project.testToolRepositoryData(TOOL_DATA_KEY) ) { - ToolData td = project.getToolRepositoryData(TOOL_DATA_KEY); - String data = (String)td.getData(); - result = VAJBuildInfo.parse( data ); - } else { - result = new VAJBuildInfo(); - } - result.setVAJProjectName( projectName ); - } catch (Throwable t) { - System.out.println("BuildInfo for Project " + projectName + - " could not be loaded" + t); - throw new BuildException(t); - } - return result; -} -/** - * Starts the application. - * @param args an array of command-line arguments - */ -public static void main(java.lang.String[] args) { - VAJBuildInfo info; - if ( args.length >= 2 && args[1] instanceof String ) { - String projectName = (String)args[1]; - info = loadBuildData( projectName ); - } - else { - info = new VAJBuildInfo(); - } + private static final String TOOL_DATA_KEY = "AntTool"; + - VAJAntToolGUI mainFrame = new VAJAntToolGUI( info ); - mainFrame.show(); -} -/** - * Saves the BuildInfo for a project in the VAJ repository. - * @param info BuildInfo build info to save - */ -public static void saveBuildData(VAJBuildInfo info) { - String data = info.asDataString(); - try { - ToolData td = new ToolData( TOOL_DATA_KEY, data ); - VAJUtil.getWorkspace().loadedProjectNamed( info.getVAJProjectName() ).setToolRepositoryData( td ); - } catch (Throwable t) { - throw new BuildException("BuildInfo for Project " + info.getVAJProjectName() + - " could not be saved", t); - } -} + /** + * Loads the BuildInfo for the specified VAJ project from the + * tool data for this project. + * If there is no build info stored for that project, a new + * default BuildInfo is returned + * + * @return BuildInfo buildInfo build info for the specified project + * @param projectName String project name + */ + public static VAJBuildInfo loadBuildData(String projectName) { + VAJBuildInfo result = null; + try { + Project project = + VAJLocalUtil.getWorkspace().loadedProjectNamed( projectName ); + if ( project.testToolRepositoryData(TOOL_DATA_KEY) ) { + ToolData td = project.getToolRepositoryData(TOOL_DATA_KEY); + String data = (String)td.getData(); + result = VAJBuildInfo.parse( data ); + } else { + result = new VAJBuildInfo(); + } + result.setVAJProjectName( projectName ); + } catch (Throwable t) { + throw new BuildException("BuildInfo for Project " + + projectName + " could not be loaded" + t); + } + return result; + } + + + /** + * Starts the application. + * + * @param args an array of command-line arguments. VAJ puts the + * VAJ project name into args[1] when starting the + * tool from the project context menu + */ + public static void main(java.lang.String[] args) { + try { + VAJBuildInfo info; + if ( args.length >= 2 && args[1] instanceof String ) { + String projectName = (String)args[1]; + info = loadBuildData( projectName ); + } + else { + info = new VAJBuildInfo(); + } + + VAJAntToolGUI mainFrame = new VAJAntToolGUI( info ); + mainFrame.show(); + } catch ( Throwable t ) { + // if all error handling fails, output at least + // something on the console + t.printStackTrace(); + } + } + + + /** + * Saves the BuildInfo for a project in the VAJ repository. + * + * @param info BuildInfo build info to save + */ + public static void saveBuildData(VAJBuildInfo info) { + String data = info.asDataString(); + try { + ToolData td = new ToolData( TOOL_DATA_KEY, data ); + VAJLocalUtil.getWorkspace().loadedProjectNamed( + info.getVAJProjectName() ).setToolRepositoryData( td ); + } catch (Throwable t) { + throw new BuildException("BuildInfo for Project " + + info.getVAJProjectName() + " could not be saved", t); + } + } } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntToolGUI.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntToolGUI.java index 77112ca19..3260898a0 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntToolGUI.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntToolGUI.java @@ -1,5 +1,3 @@ -package org.apache.tools.ant.taskdefs.optional.ide; - /* * The Apache Software License, Version 1.1 * @@ -54,6 +52,9 @@ package org.apache.tools.ant.taskdefs.optional.ide; * . */ +package org.apache.tools.ant.taskdefs.optional.ide; + + import java.util.Vector; import java.awt.Frame; import java.awt.Dialog; @@ -84,1308 +85,1325 @@ import java.awt.event.ActionEvent; import java.awt.event.ItemEvent; import java.awt.event.TextEvent; import java.awt.event.WindowEvent; +import java.io.StringWriter; +import java.io.PrintWriter; import java.beans.PropertyChangeListener; -import org.apache.tools.ant.Main; + import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildListener; import org.apache.tools.ant.BuildEvent; import org.apache.tools.ant.Project; /** - * This is a simple grafical user interface to provide the information needed by ANT and - * to start the build-process within IBM VisualAge for Java. + * This is a simple grafical user interface to provide the information needed + * by ANT and to start the build-process within IBM VisualAge for Java. *

    - * I was using AWT to make it independent from the JDK-version. Please don't ask me for a Swing-version: - * I am very familiar with Swing and I really think that it's not necessary for such a simple gui! + * I was using AWT to make it independent from the JDK-version. Please don't + * ask me for a Swing-version:I am very familiar with Swing and I really think + * that it's not necessary for such a simple gui! *

    - * It is completely developed in VAJ using the visual composition editor. About 90% of the code is generated by VAJ, + * It is completely developed in VAJ using the visual composition editor. + * About 90% of the code is generated by VAJ, * but in fact I did a lot of code-beautification ;-). *

    * @version 1.0 h * @author: Christoph Wilhelms, TUI Infotec GmbH */ public class VAJAntToolGUI extends Frame { - /** - * Members - */ - private VAJBuildLogger logger = new VAJBuildLogger(); - private String lineSeparator = "\r\n"; - private PrivateEventHandler iEventHandler = new PrivateEventHandler(); + /** + * Members + */ + private VAJBuildLogger logger = new VAJBuildLogger(); + private String lineSeparator = "\r\n"; + private PrivateEventHandler iEventHandler = new PrivateEventHandler(); - /** - * Members of the main-window - */ - // main model - private VAJBuildInfo iBuildInfo = null; - // Menue - private MenuBar iAntMakeMenuBar = null; - private Menu iFileMenu = null; - private MenuItem iSaveMenuItem = null; - private MenuItem iMenuSeparator = null; - private MenuItem iShowLogMenuItem = null; - private Menu iHelpMenu = null; - private MenuItem iAboutMenuItem = null; - // Container - private Panel iContentsPane = null; - private Panel iOptionenPanel = null; - private Panel iCommandButtonPanel = null; - private FlowLayout iCommandButtonPanelFlowLayout = null; - // Project name - private Label iProjectLabel = null; - private Label iProjectText = null; - // XML-file - private Label iBuildFileLabel = null; - private TextField iBuildFileTextField = null; - private boolean iConnPtoP2Aligning = false; - private Button iBrowseButton = null; - private FileDialog iFileDialog = null; - // Options - private Choice iMessageOutputLevelChoice = null; - private Label iMessageOutputLevelLabel = null; - private Label iTargetLabel = null; - private List iTargetList = null; - // Command-buttons - private Button iBuildButton = null; - private Button iReloadButton = null; - private Button iCloseButton = null; - /** - * log-Window - */ - // Container - private Frame iMessageFrame = null; - private Panel iMessageCommandPanel = null; - private Panel iMessageContentPanel = null; - // Components - private TextArea iMessageTextArea = null; - private Button iMessageOkButton = null; - private Button iMessageClearLogButton = null; - /** - * About-dialog - */ - // Container - private Dialog iAboutDialog = null; - private Panel iAboutDialogContentPanel = null; - private Panel iAboutInfoPanel = null; - private Panel iAboutCommandPanel = null; - // Labels - private Label iAboutTitleLabel = null; - private Label iAboutDevLabel = null; - private Label iAboutContactLabel = null; - // Buttons - private Button iAboutOkButton = null; + /** + * Members of the main-window + */ + // main model + private VAJBuildInfo iBuildInfo = null; + // Menue + private MenuBar iAntMakeMenuBar = null; + private Menu iFileMenu = null; + private MenuItem iSaveMenuItem = null; + private MenuItem iMenuSeparator = null; + private MenuItem iShowLogMenuItem = null; + private Menu iHelpMenu = null; + private MenuItem iAboutMenuItem = null; + // Container + private Panel iContentsPane = null; + private Panel iOptionenPanel = null; + private Panel iCommandButtonPanel = null; + private FlowLayout iCommandButtonPanelFlowLayout = null; + // Project name + private Label iProjectLabel = null; + private Label iProjectText = null; + // XML-file + private Label iBuildFileLabel = null; + private TextField iBuildFileTextField = null; + private boolean iConnPtoP2Aligning = false; + private Button iBrowseButton = null; + private FileDialog iFileDialog = null; + // Options + private Choice iMessageOutputLevelChoice = null; + private Label iMessageOutputLevelLabel = null; + private Label iTargetLabel = null; + private List iTargetList = null; + // Command-buttons + private Button iBuildButton = null; + private Button iReloadButton = null; + private Button iCloseButton = null; + /** + * log-Window + */ + // Container + private Frame iMessageFrame = null; + private Panel iMessageCommandPanel = null; + private Panel iMessageContentPanel = null; + // Components + private TextArea iMessageTextArea = null; + private Button iMessageOkButton = null; + private Button iMessageClearLogButton = null; + /** + * About-dialog + */ + // Container + private Dialog iAboutDialog = null; + private Panel iAboutDialogContentPanel = null; + private Panel iAboutInfoPanel = null; + private Panel iAboutCommandPanel = null; + // Labels + private Label iAboutTitleLabel = null; + private Label iAboutDevLabel = null; + private Label iAboutContactLabel = null; + // Buttons + private Button iAboutOkButton = null; - /** - * This internal BuildLogger, to be honest, is just a BuildListener. - * It does nearly the same as the DefaultLogger, but uses the Loggin-Window for output. - */ - private class VAJBuildLogger implements BuildListener { - private long startTime = System.currentTimeMillis(); + /** + * This internal BuildLogger, to be honest, is just a BuildListener. + * It does nearly the same as the DefaultLogger, but uses the Loggin-Window for output. + */ + private class VAJBuildLogger implements BuildListener { + private long startTime = System.currentTimeMillis(); - /** - * VAJBuildLogger constructor comment. - */ - public VAJBuildLogger() { - super(); - } + /** + * VAJBuildLogger constructor comment. + */ + public VAJBuildLogger() { + super(); + } - /** - * Fired after the last target has finished. This event - * will still be thrown if an error occured during the build. - * - * @see BuildEvent#getException() - */ - public void buildFinished(BuildEvent event) { - Throwable error = event.getException(); + /** + * Fired after the last target has finished. This event + * will still be thrown if an error occured during the build. + * + * @see BuildEvent#getException() + */ + public void buildFinished(BuildEvent event) { + getStopButton().setEnabled(false); + getBuildButton().setEnabled(true); + getBuildButton().requestFocus(); + + Throwable error = event.getException(); - if (error == null) { - getMessageTextArea().append(lineSeparator + "BUILD SUCCESSFUL"); - } - else { - getMessageTextArea().append(lineSeparator + "BUILD FAILED" + lineSeparator); + if (error == null) { + getMessageTextArea().append(lineSeparator + "BUILD SUCCESSFUL"); + } + else { + logException( error ); + } - if (error instanceof BuildException) { - getMessageTextArea().append(error.toString()); + getMessageTextArea().append(lineSeparator + "Total time: " + formatTime(System.currentTimeMillis() - startTime)); + } - Throwable nested = ((BuildException)error).getException(); - if (nested != null) { - nested.printStackTrace(System.err); - } - } - else { - error.printStackTrace(System.err); - } - } - getMessageTextArea().append(lineSeparator + "Total time: " + formatTime(System.currentTimeMillis() - startTime)); - } + /** + * Outputs an exception. + */ + public void logException( Throwable error ) { + getMessageTextArea().append(lineSeparator + "BUILD FAILED" + lineSeparator); - /** - * Fired before any targets are started. - */ - public void buildStarted(BuildEvent event) { - startTime = System.currentTimeMillis(); - getMessageTextArea().append(lineSeparator); - } + if (error instanceof BuildException) { + getMessageTextArea().append(error.toString()); - /** - * Fired whenever a message is logged. - * - * @see BuildEvent#getMessage() - * @see BuildEvent#getPriority() - */ - public void messageLogged(BuildEvent event) { - if (event.getPriority() <= getBuildInfo().getOutputMessageLevel()) { - String msg = ""; - if (event.getTask() != null) - msg = "[" + event.getTask().getTaskName() + "] "; - getMessageTextArea().append(lineSeparator + msg + event.getMessage()); - } - } + Throwable nested = ((BuildException)error).getException(); + if (nested != null) { + nested.printStackTrace(System.err); + } + } + else { + error.printStackTrace(System.err); + } + } + + /** + * Fired before any targets are started. + */ + public void buildStarted(BuildEvent event) { + getStopButton().setEnabled(true); + getBuildButton().setEnabled(false); + getStopButton().requestFocus(); - /** - * Fired when a target has finished. This event will - * still be thrown if an error occured during the build. - * - * @see BuildEvent#getException() - */ - public void targetFinished(BuildEvent event) { - } + startTime = System.currentTimeMillis(); + getMessageTextArea().append(lineSeparator); + } - /** - * Fired when a target is started. - * - * @see BuildEvent#getTarget() - */ - public void targetStarted(BuildEvent event) { - if (getBuildInfo().getOutputMessageLevel() <= Project.MSG_INFO) { - getMessageTextArea().append(lineSeparator + event.getTarget().getName() + ":"); - } - } + /** + * Fired whenever a message is logged. + * + * @see BuildEvent#getMessage() + * @see BuildEvent#getPriority() + */ + public void messageLogged(BuildEvent event) { + if (event.getPriority() <= getBuildInfo().getOutputMessageLevel()) { + String msg = ""; + if (event.getTask() != null) + msg = "[" + event.getTask().getTaskName() + "] "; + getMessageTextArea().append(lineSeparator + msg + event.getMessage()); + } + } - /** - * Fired when a task has finished. This event will still - * be throw if an error occured during the build. - * - * @see BuildEvent#getException() - */ - public void taskFinished(BuildEvent event) { - } + /** + * Fired when a target has finished. This event will + * still be thrown if an error occured during the build. + * + * @see BuildEvent#getException() + */ + public void targetFinished(BuildEvent event) { + } - /** - * Fired when a task is started. - * - * @see BuildEvent#getTask() - */ - public void taskStarted(BuildEvent event) { - } - /** - * Chris: HACK: remove when Ant-Refactoring is finished! - */ - public void buildSuccessful() { - getMessageTextArea().append(lineSeparator + "BUILD SUCCESSFUL"); - getMessageTextArea().append(lineSeparator + "Total time: " + formatTime(System.currentTimeMillis() - startTime)); - } - /** - * Chris: HACK: remove when Ant-Refactoring is finished! - */ - public void buildFailed(Throwable exc) { - getMessageTextArea().append(lineSeparator + "BUILD FAILED" + lineSeparator); + /** + * Fired when a target is started. + * + * @see BuildEvent#getTarget() + */ + public void targetStarted(BuildEvent event) { + if (getBuildInfo().getOutputMessageLevel() <= Project.MSG_INFO) { + getMessageTextArea().append(lineSeparator + event.getTarget().getName() + ":"); + } + } - if (exc instanceof BuildException) { - getMessageTextArea().append(exc.toString()); + /** + * Fired when a task has finished. This event will still + * be throw if an error occured during the build. + * + * @see BuildEvent#getException() + */ + public void taskFinished(BuildEvent event) { + } - Throwable nested = ((BuildException)exc).getException(); - if (nested != null) { - nested.printStackTrace(System.err); - } - } - else { - exc.printStackTrace(System.err); - } - getMessageTextArea().append(lineSeparator + "Total time: " + formatTime(System.currentTimeMillis() - startTime)); - } - } + /** + * Fired when a task is started. + * + * @see BuildEvent#getTask() + */ + public void taskStarted(BuildEvent event) { + } + } - /** - * Eventhandler to handle all AWT-events - */ - private class PrivateEventHandler implements ActionListener, ItemListener, TextListener, WindowListener, PropertyChangeListener { - /** - * ActionListener method - */ - public void actionPerformed(ActionEvent e) { - try { - /* #### Main App-Frame #### */ - // browse XML-File with filechooser - if (e.getSource() == VAJAntToolGUI.this.getBrowseButton()) { - getFileDialog().setDirectory(getBuildFileTextField().getText().substring(0, getBuildFileTextField().getText().lastIndexOf('\\') + 1)); - getFileDialog().setFile("*.xml"); - getFileDialog().show(); - if (!getFileDialog().getFile().equals("") ) { - getBuildFileTextField().setText(getFileDialog().getDirectory() + getFileDialog().getFile()); - } - } - // dispose and exit application - if (e.getSource() == VAJAntToolGUI.this.getCloseButton()) { - dispose(); - System.exit(0); - } - // start build-process - if (e.getSource() == VAJAntToolGUI.this.getBuildButton()) - executeTarget(); - if (e.getSource() == VAJAntToolGUI.this.getReloadButton()) { - try { - getBuildInfo().updateTargetList(); - fillList(); - } - catch (Throwable fileNotFound) { - handleException(fileNotFound); - getTargetList().removeAll(); - getBuildButton().setEnabled(false); - } - } - // MenuItems - if (e.getSource() == VAJAntToolGUI.this.getSaveMenuItem()) - saveBuildInfo(); - if (e.getSource() == VAJAntToolGUI.this.getAboutMenuItem()) - getAboutDialog().show(); - if (e.getSource() == VAJAntToolGUI.this.getShowLogMenuItem()) - getMessageFrame().show(); - /* #### About dialog #### */ - if (e.getSource() == VAJAntToolGUI.this.getAboutOkButton()) - getAboutDialog().dispose(); - /* #### Log frame #### */ - if (e.getSource() == VAJAntToolGUI.this.getMessageOkButton()) - getMessageFrame().dispose(); - if (e.getSource() == VAJAntToolGUI.this.getMessageClearLogButton()) - getMessageTextArea().setText(""); - if (e.getSource() == VAJAntToolGUI.this.getMessageOkButton()) - getMessageFrame().dispose(); - } - catch (Throwable exc) { - handleException(exc); - } - } + /** + * Eventhandler to handle all AWT-events + */ + private class PrivateEventHandler implements ActionListener, ItemListener, TextListener, WindowListener, PropertyChangeListener { + /** + * ActionListener method + */ + public void actionPerformed(ActionEvent e) { + try { + /* #### Main App-Frame #### */ + // browse XML-File with filechooser + if (e.getSource() == VAJAntToolGUI.this.getBrowseButton()) { + getFileDialog().setDirectory(getBuildFileTextField().getText().substring(0, getBuildFileTextField().getText().lastIndexOf('\\') + 1)); + getFileDialog().setFile("*.xml"); + getFileDialog().show(); + if (!getFileDialog().getFile().equals("") ) { + getBuildFileTextField().setText(getFileDialog().getDirectory() + getFileDialog().getFile()); + } + } + // dispose and exit application + if (e.getSource() == VAJAntToolGUI.this.getCloseButton()) { + dispose(); + System.exit(0); + } + // start build-process + if (e.getSource() == VAJAntToolGUI.this.getBuildButton()) { + executeTarget(); + } + if (e.getSource() == VAJAntToolGUI.this.getStopButton()) { + getBuildInfo().cancelBuild(); + } + if (e.getSource() == VAJAntToolGUI.this.getReloadButton()) { + try { + getBuildInfo().updateTargetList(); + fillList(); + } + catch (Throwable fileNotFound) { + handleException(fileNotFound); + getTargetList().removeAll(); + getBuildButton().setEnabled(false); + } + } + // MenuItems + if (e.getSource() == VAJAntToolGUI.this.getSaveMenuItem()) + saveBuildInfo(); + if (e.getSource() == VAJAntToolGUI.this.getAboutMenuItem()) + getAboutDialog().show(); + if (e.getSource() == VAJAntToolGUI.this.getShowLogMenuItem()) + getMessageFrame().show(); + /* #### About dialog #### */ + if (e.getSource() == VAJAntToolGUI.this.getAboutOkButton()) + getAboutDialog().dispose(); + /* #### Log frame #### */ + if (e.getSource() == VAJAntToolGUI.this.getMessageOkButton()) + getMessageFrame().dispose(); + if (e.getSource() == VAJAntToolGUI.this.getMessageClearLogButton()) + getMessageTextArea().setText(""); + if (e.getSource() == VAJAntToolGUI.this.getMessageOkButton()) + getMessageFrame().dispose(); + } + catch (Throwable exc) { + handleException(exc); + } + } - /** - * ItemListener method - */ - public void itemStateChanged(ItemEvent e) { - try { - if (e.getSource() == VAJAntToolGUI.this.getTargetList()) - getBuildButton().setEnabled(true); - if (e.getSource() == VAJAntToolGUI.this.getMessageOutputLevelChoice()) - getBuildInfo().setOutputMessageLevel(getMessageOutputLevelChoice().getSelectedIndex()); - if (e.getSource() == VAJAntToolGUI.this.getTargetList()) - getBuildInfo().setTarget(getTargetList().getSelectedItem()); - } - catch (Throwable exc) { - handleException(exc); - } - } + /** + * ItemListener method + */ + public void itemStateChanged(ItemEvent e) { + try { + if (e.getSource() == VAJAntToolGUI.this.getTargetList()) + getBuildButton().setEnabled(true); + if (e.getSource() == VAJAntToolGUI.this.getMessageOutputLevelChoice()) + getBuildInfo().setOutputMessageLevel(getMessageOutputLevelChoice().getSelectedIndex()); + if (e.getSource() == VAJAntToolGUI.this.getTargetList()) + getBuildInfo().setTarget(getTargetList().getSelectedItem()); + } + catch (Throwable exc) { + handleException(exc); + } + } - /** - * PropertyChangeListener method - */ - public void propertyChange(java.beans.PropertyChangeEvent evt) { - if (evt.getSource() == VAJAntToolGUI.this.getBuildInfo() && (evt.getPropertyName().equals("projectName"))) - connectProjectNameToLabel(); - if (evt.getSource() == VAJAntToolGUI.this.getBuildInfo() && (evt.getPropertyName().equals("buildFileName"))) - connectBuildFileNameToTextField(); - } + /** + * PropertyChangeListener method + */ + public void propertyChange(java.beans.PropertyChangeEvent evt) { + if (evt.getSource() == VAJAntToolGUI.this.getBuildInfo() && (evt.getPropertyName().equals("projectName"))) + connectProjectNameToLabel(); + if (evt.getSource() == VAJAntToolGUI.this.getBuildInfo() && (evt.getPropertyName().equals("buildFileName"))) + connectBuildFileNameToTextField(); + } - /** - * TextListener method - */ - public void textValueChanged(TextEvent e) { - if (e.getSource() == VAJAntToolGUI.this.getBuildFileTextField()) - connectTextFieldToBuildFileName(); - } + /** + * TextListener method + */ + public void textValueChanged(TextEvent e) { + if (e.getSource() == VAJAntToolGUI.this.getBuildFileTextField()) + connectTextFieldToBuildFileName(); + } - /** - * WindowListener methods - */ - public void windowClosing(WindowEvent e) { - try { - if (e.getSource() == VAJAntToolGUI.this) { - dispose(); - System.exit(0); - } - if (e.getSource() == VAJAntToolGUI.this.getAboutDialog()) - getAboutDialog().dispose(); - if (e.getSource() == VAJAntToolGUI.this.getMessageFrame()) - getMessageFrame().dispose(); - } - catch (Throwable exc) { - handleException(exc); - } - } - public void windowActivated(WindowEvent e) {}; - public void windowClosed(WindowEvent e) {}; - public void windowDeactivated(WindowEvent e) {}; - public void windowDeiconified(WindowEvent e) {}; - public void windowIconified(WindowEvent e) {}; - public void windowOpened(WindowEvent e) {}; - } + /** + * WindowListener methods + */ + public void windowClosing(WindowEvent e) { + try { + if (e.getSource() == VAJAntToolGUI.this) { + dispose(); + System.exit(0); + } + if (e.getSource() == VAJAntToolGUI.this.getAboutDialog()) + getAboutDialog().dispose(); + if (e.getSource() == VAJAntToolGUI.this.getMessageFrame()) + getMessageFrame().dispose(); + } + catch (Throwable exc) { + handleException(exc); + } + } + public void windowActivated(WindowEvent e) {}; + public void windowClosed(WindowEvent e) {}; + public void windowDeactivated(WindowEvent e) {}; + public void windowDeiconified(WindowEvent e) {}; + public void windowIconified(WindowEvent e) {}; + public void windowOpened(WindowEvent e) {}; + } - /** - * AntMake default-constructor. - */ - private VAJAntToolGUI() { - super(); - initialize(); - } - /** - * AntMake constructor called by VAJAntTool integration. - * @param buildInfo VAJBuildInfo - */ + /** + * AntMake default-constructor. + */ + private VAJAntToolGUI() { + super(); + initialize(); + } + /** + * AntMake constructor called by VAJAntTool integration. + * @param buildInfo VAJBuildInfo + */ - public VAJAntToolGUI(VAJBuildInfo newBuildInfo) { - super(); - setBuildInfo(newBuildInfo); - initialize(); - } - /** - * This method is used to center dialogs. - */ - public static void centerDialog(Dialog dialog) { - dialog.setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (dialog.getSize().width / 2), (java.awt.Toolkit.getDefaultToolkit().getScreenSize().height / 2) - (dialog.getSize().height / 2)); - } - /** - * connectBuildFileNameToTextField: (BuildInfo.buildFileName <--> BuildFileTextField.text) - */ - private void connectBuildFileNameToTextField() { - /* Set the target from the source */ - try { - if (iConnPtoP2Aligning == false) { - iConnPtoP2Aligning = true; - if ((getBuildInfo() != null)) { - getBuildFileTextField().setText(getBuildInfo().getBuildFileName()); - } - iConnPtoP2Aligning = false; - } - } catch (Throwable iExc) { - iConnPtoP2Aligning = false; - handleException(iExc); - } - } - /** - * connectProjectNameToLabel: (BuildInfo.vajProjectName <--> ProjectText.text) - */ - private void connectProjectNameToLabel() { - /* Set the target from the source */ - try { - if ((getBuildInfo() != null)) { - getProjectText().setText(getBuildInfo().getVAJProjectName()); - } - } catch (Throwable iExc) { - handleException(iExc); - } - } - /** - * connectTextFieldToBuildFileName: (BuildInfo.buildFileName <--> BuildFileTextField.text) - */ - private void connectTextFieldToBuildFileName() { - /* Set the source from the target */ - try { - if (iConnPtoP2Aligning == false) { - iConnPtoP2Aligning = true; - if ((getBuildInfo() != null)) { - getBuildInfo().setBuildFileName(getBuildFileTextField().getText()); - } - iConnPtoP2Aligning = false; - } - } catch (Throwable iExc) { - iConnPtoP2Aligning = false; - handleException(iExc); - } - } - /** - * external build of a .jar-file - */ - private void executeTarget() { - try { - getMessageFrame().show(); - // Chris: HACK: remove when Ant-Refactoring is finished! - logger.buildStarted(null); - getBuildInfo().executeProject(logger); - // Chris: HACK: remove when Ant-Refactoring is finished! - logger.buildSuccessful(); - } - catch (Throwable exc) { - // We aren't interested in exceptions! All necessary information has been written to the logging-window! - // Unfortunately ANT-Refactoring isn't done yet! - // Chris: HACK: remove when Ant-Refactoring is finished! - logger.buildFailed( exc ); - } - return; - } - /** - * Fills the taget-list with project-targets - */ - private void fillList() { - getTargetList().removeAll(); - Vector targets = getBuildInfo().getProjectTargets(); - for (int i = 0;i < targets.size(); i++) { - getTargetList().add(targets.elementAt(i).toString()); - } - getTargetList().select(iBuildInfo.getProjectTargets().indexOf(iBuildInfo.getTarget())); - if (getTargetList().getSelectedIndex() >= 0) { - getBuildButton().setEnabled(true); - } - } - /** - * Copied from DefaultLogger to provide the same time-format. - */ - public static String formatTime(long millis) { - long seconds = millis / 1000; - long minutes = seconds / 60; + public VAJAntToolGUI(VAJBuildInfo newBuildInfo) { + super(); + setBuildInfo(newBuildInfo); + initialize(); + } + /** + * This method is used to center dialogs. + */ + public static void centerDialog(Dialog dialog) { + dialog.setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (dialog.getSize().width / 2), (java.awt.Toolkit.getDefaultToolkit().getScreenSize().height / 2) - (dialog.getSize().height / 2)); + } + /** + * connectBuildFileNameToTextField: (BuildInfo.buildFileName <--> BuildFileTextField.text) + */ + private void connectBuildFileNameToTextField() { + /* Set the target from the source */ + try { + if (iConnPtoP2Aligning == false) { + iConnPtoP2Aligning = true; + if ((getBuildInfo() != null)) { + getBuildFileTextField().setText(getBuildInfo().getBuildFileName()); + } + iConnPtoP2Aligning = false; + } + } catch (Throwable iExc) { + iConnPtoP2Aligning = false; + handleException(iExc); + } + } + /** + * connectProjectNameToLabel: (BuildInfo.vajProjectName <--> ProjectText.text) + */ + private void connectProjectNameToLabel() { + /* Set the target from the source */ + try { + if ((getBuildInfo() != null)) { + getProjectText().setText(getBuildInfo().getVAJProjectName()); + } + } catch (Throwable iExc) { + handleException(iExc); + } + } + /** + * connectTextFieldToBuildFileName: (BuildInfo.buildFileName <--> BuildFileTextField.text) + */ + private void connectTextFieldToBuildFileName() { + /* Set the source from the target */ + try { + if (iConnPtoP2Aligning == false) { + iConnPtoP2Aligning = true; + if ((getBuildInfo() != null)) { + getBuildInfo().setBuildFileName(getBuildFileTextField().getText()); + } + iConnPtoP2Aligning = false; + } + } catch (Throwable iExc) { + iConnPtoP2Aligning = false; + handleException(iExc); + } + } + /** + * external build of a .jar-file + */ + private void executeTarget() { + try { + getMessageFrame().show(); + getBuildInfo().executeProject(logger); + } + catch (Throwable exc) { + logger.logException( exc ); + } + return; + } + /** + * Fills the taget-list with project-targets + */ + private void fillList() { + getTargetList().removeAll(); + Vector targets = getBuildInfo().getProjectTargets(); + for (int i = 0;i < targets.size(); i++) { + getTargetList().add(targets.elementAt(i).toString()); + } + getTargetList().select(iBuildInfo.getProjectTargets().indexOf(iBuildInfo.getTarget())); + if (getTargetList().getSelectedIndex() >= 0) { + getBuildButton().setEnabled(true); + } + } + /** + * Copied from DefaultLogger to provide the same time-format. + */ + public static String formatTime(long millis) { + long seconds = millis / 1000; + long minutes = seconds / 60; + + if (minutes > 0) { + return Long.toString(minutes) + " minute" + + (minutes == 1 ? " " : "s ") + + Long.toString(seconds%60) + " second" + + (seconds%60 == 1 ? "" : "s"); + } + else { + return Long.toString(seconds) + " second" + + (seconds%60 == 1 ? "" : "s"); + } + } + /** + * Return the AboutCommandPanel property value. + * @return java.awt.Panel + */ + private Panel getAboutCommandPanel() { + if (iAboutCommandPanel == null) { + try { + iAboutCommandPanel = new Panel(); + iAboutCommandPanel.setName("AboutCommandPanel"); + iAboutCommandPanel.setLayout(new java.awt.FlowLayout()); + getAboutCommandPanel().add(getAboutOkButton(), getAboutOkButton().getName()); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iAboutCommandPanel; + } + /** + * Return the AboutContactLabel property value. + * @return java.awt.Label + */ + private Label getAboutContactLabel() { + if (iAboutContactLabel == null) { + try { + iAboutContactLabel = new Label(); + iAboutContactLabel.setName("AboutContactLabel"); + iAboutContactLabel.setAlignment(java.awt.Label.CENTER); + iAboutContactLabel.setText("contact: wolf.siberski@tui.de or christoph.wilhelms@tui.de"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iAboutContactLabel; + } + /** + * Return the AboutDevLabel property value. + * @return java.awt.Label + */ + private Label getAboutDevLabel() { + if (iAboutDevLabel == null) { + try { + iAboutDevLabel = new Label(); + iAboutDevLabel.setName("AboutDevLabel"); + iAboutDevLabel.setAlignment(java.awt.Label.CENTER); + iAboutDevLabel.setText("developed by Wolf Siberski & Christoph Wilhelms"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iAboutDevLabel; + } + /** + * Return the AboutDialog property value. + * @return java.awt.Dialog + */ + private Dialog getAboutDialog() { + if (iAboutDialog == null) { + try { + iAboutDialog = new Dialog(this); + iAboutDialog.setName("AboutDialog"); + iAboutDialog.setResizable(false); + iAboutDialog.setLayout(new java.awt.BorderLayout()); + iAboutDialog.setBounds(550, 14, 383, 142); + iAboutDialog.setModal(true); + iAboutDialog.setTitle("About..."); + getAboutDialog().add(getAboutDialogContentPanel(), "Center"); + iAboutDialog.pack(); + centerDialog(iAboutDialog); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iAboutDialog; + } + /** + * Return the AboutDialogContentPanel property value. + * @return java.awt.Panel + */ + private Panel getAboutDialogContentPanel() { + if (iAboutDialogContentPanel == null) { + try { + iAboutDialogContentPanel = new Panel(); + iAboutDialogContentPanel.setName("AboutDialogContentPanel"); + iAboutDialogContentPanel.setLayout(new java.awt.BorderLayout()); + getAboutDialogContentPanel().add(getAboutCommandPanel(), "South"); + getAboutDialogContentPanel().add(getAboutInfoPanel(), "Center"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iAboutDialogContentPanel; + } + /** + * Return the AboutInfoPanel property value. + * @return java.awt.Panel + */ + private Panel getAboutInfoPanel() { + if (iAboutInfoPanel == null) { + try { + iAboutInfoPanel = new Panel(); + iAboutInfoPanel.setName("AboutInfoPanel"); + iAboutInfoPanel.setLayout(new GridBagLayout()); - if (minutes > 0) { - return Long.toString(minutes) + " minute" - + (minutes == 1 ? " " : "s ") - + Long.toString(seconds%60) + " second" - + (seconds%60 == 1 ? "" : "s"); - } - else { - return Long.toString(seconds) + " second" - + (seconds%60 == 1 ? "" : "s"); - } - } - /** - * Return the AboutCommandPanel property value. - * @return java.awt.Panel - */ - private Panel getAboutCommandPanel() { - if (iAboutCommandPanel == null) { - try { - iAboutCommandPanel = new Panel(); - iAboutCommandPanel.setName("AboutCommandPanel"); - iAboutCommandPanel.setLayout(new java.awt.FlowLayout()); - getAboutCommandPanel().add(getAboutOkButton(), getAboutOkButton().getName()); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iAboutCommandPanel; - } - /** - * Return the AboutContactLabel property value. - * @return java.awt.Label - */ - private Label getAboutContactLabel() { - if (iAboutContactLabel == null) { - try { - iAboutContactLabel = new Label(); - iAboutContactLabel.setName("AboutContactLabel"); - iAboutContactLabel.setAlignment(java.awt.Label.CENTER); - iAboutContactLabel.setText("contact: wolf.siberski@tui.de or christoph.wilhelms@tui.de"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iAboutContactLabel; - } - /** - * Return the AboutDevLabel property value. - * @return java.awt.Label - */ - private Label getAboutDevLabel() { - if (iAboutDevLabel == null) { - try { - iAboutDevLabel = new Label(); - iAboutDevLabel.setName("AboutDevLabel"); - iAboutDevLabel.setAlignment(java.awt.Label.CENTER); - iAboutDevLabel.setText("developed by Wolf Siberski & Christoph Wilhelms"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iAboutDevLabel; - } - /** - * Return the AboutDialog property value. - * @return java.awt.Dialog - */ - private Dialog getAboutDialog() { - if (iAboutDialog == null) { - try { - iAboutDialog = new Dialog(this); - iAboutDialog.setName("AboutDialog"); - iAboutDialog.setResizable(false); - iAboutDialog.setLayout(new java.awt.BorderLayout()); - iAboutDialog.setBounds(550, 14, 383, 142); - iAboutDialog.setModal(true); - iAboutDialog.setTitle("About..."); - getAboutDialog().add(getAboutDialogContentPanel(), "Center"); - iAboutDialog.pack(); - centerDialog(iAboutDialog); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iAboutDialog; - } - /** - * Return the AboutDialogContentPanel property value. - * @return java.awt.Panel - */ - private Panel getAboutDialogContentPanel() { - if (iAboutDialogContentPanel == null) { - try { - iAboutDialogContentPanel = new Panel(); - iAboutDialogContentPanel.setName("AboutDialogContentPanel"); - iAboutDialogContentPanel.setLayout(new java.awt.BorderLayout()); - getAboutDialogContentPanel().add(getAboutCommandPanel(), "South"); - getAboutDialogContentPanel().add(getAboutInfoPanel(), "Center"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iAboutDialogContentPanel; - } - /** - * Return the AboutInfoPanel property value. - * @return java.awt.Panel - */ - private Panel getAboutInfoPanel() { - if (iAboutInfoPanel == null) { - try { - iAboutInfoPanel = new Panel(); - iAboutInfoPanel.setName("AboutInfoPanel"); - iAboutInfoPanel.setLayout(new GridBagLayout()); + GridBagConstraints constraintsAboutTitleLabel = new GridBagConstraints(); + constraintsAboutTitleLabel.gridx = 0; constraintsAboutTitleLabel.gridy = 0; + constraintsAboutTitleLabel.fill = GridBagConstraints.HORIZONTAL; + constraintsAboutTitleLabel.weightx = 1.0; + constraintsAboutTitleLabel.weighty = 1.0; + constraintsAboutTitleLabel.insets = new Insets(4, 0, 4, 0); + getAboutInfoPanel().add(getAboutTitleLabel(), constraintsAboutTitleLabel); - GridBagConstraints constraintsAboutTitleLabel = new GridBagConstraints(); - constraintsAboutTitleLabel.gridx = 0; constraintsAboutTitleLabel.gridy = 0; - constraintsAboutTitleLabel.fill = GridBagConstraints.HORIZONTAL; - constraintsAboutTitleLabel.weightx = 1.0; - constraintsAboutTitleLabel.weighty = 1.0; - constraintsAboutTitleLabel.insets = new Insets(4, 0, 4, 0); - getAboutInfoPanel().add(getAboutTitleLabel(), constraintsAboutTitleLabel); + GridBagConstraints constraintsAboutDevLabel = new GridBagConstraints(); + constraintsAboutDevLabel.gridx = 0; constraintsAboutDevLabel.gridy = 1; + constraintsAboutDevLabel.fill = GridBagConstraints.HORIZONTAL; + constraintsAboutDevLabel.weightx = 1.0; + constraintsAboutDevLabel.insets = new Insets(4, 0, 0, 0); + getAboutInfoPanel().add(getAboutDevLabel(), constraintsAboutDevLabel); - GridBagConstraints constraintsAboutDevLabel = new GridBagConstraints(); - constraintsAboutDevLabel.gridx = 0; constraintsAboutDevLabel.gridy = 1; - constraintsAboutDevLabel.fill = GridBagConstraints.HORIZONTAL; - constraintsAboutDevLabel.weightx = 1.0; - constraintsAboutDevLabel.insets = new Insets(4, 0, 0, 0); - getAboutInfoPanel().add(getAboutDevLabel(), constraintsAboutDevLabel); + GridBagConstraints constraintsAboutContactLabel = new GridBagConstraints(); + constraintsAboutContactLabel.gridx = 0; constraintsAboutContactLabel.gridy = 2; + constraintsAboutContactLabel.fill = GridBagConstraints.HORIZONTAL; + constraintsAboutContactLabel.weightx = 1.0; + constraintsAboutContactLabel.insets = new Insets(2, 0, 4, 0); + getAboutInfoPanel().add(getAboutContactLabel(), constraintsAboutContactLabel); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iAboutInfoPanel; + } + /** + * Return the AboutMenuItem property value. + * @return java.awt.MenuItem + */ + private MenuItem getAboutMenuItem() { + if (iAboutMenuItem == null) { + try { + iAboutMenuItem = new MenuItem(); + iAboutMenuItem.setLabel("About..."); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iAboutMenuItem; + } + /** + * Return the AboutOkButton property value. + * @return java.awt.Button + */ + private Button getAboutOkButton() { + if (iAboutOkButton == null) { + try { + iAboutOkButton = new Button(); + iAboutOkButton.setName("AboutOkButton"); + iAboutOkButton.setLabel("OK"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iAboutOkButton; + } + /** + * Return the AboutTitleLabel property value. + * @return java.awt.Label + */ + private Label getAboutTitleLabel() { + if (iAboutTitleLabel == null) { + try { + iAboutTitleLabel = new Label(); + iAboutTitleLabel.setName("AboutTitleLabel"); + iAboutTitleLabel.setFont(new Font("Arial", 1, 12)); + iAboutTitleLabel.setAlignment(Label.CENTER); + iAboutTitleLabel.setText("Ant VisualAge for Java Tool-Integration"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iAboutTitleLabel; + } + /** + * Return the AntMakeMenuBar property value. + * @return java.awt.MenuBar + */ + private MenuBar getAntMakeMenuBar() { + if (iAntMakeMenuBar == null) { + try { + iAntMakeMenuBar = new MenuBar(); + iAntMakeMenuBar.add(getFileMenu()); + iAntMakeMenuBar.add(getHelpMenu()); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iAntMakeMenuBar; + } + /** + * Return the BrowseButton property value. + * @return Button + */ + private Button getBrowseButton() { + if (iBrowseButton == null) { + try { + iBrowseButton = new Button(); + iBrowseButton.setName("BrowseButton"); + iBrowseButton.setLabel("..."); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iBrowseButton; + } + /** + * Return the BuildButton property value. + * @return java.awt.Button + */ + private Button getBuildButton() { + if (iBuildButton == null) { + try { + iBuildButton = new Button(); + iBuildButton.setName("BuildButton"); + iBuildButton.setLabel("Execute"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iBuildButton; + } + /** + * Return the BuildFileLabel property value. + * @return java.awt.Label + */ + private Label getBuildFileLabel() { + if (iBuildFileLabel == null) { + try { + iBuildFileLabel = new Label(); + iBuildFileLabel.setName("BuildFileLabel"); + iBuildFileLabel.setText("Ant-Buildfile:"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iBuildFileLabel; + } + /** + * Return the BuildFileTextField property value. + * @return java.awt.TextField + */ + private TextField getBuildFileTextField() { + if (iBuildFileTextField == null) { + try { + iBuildFileTextField = new TextField(); + iBuildFileTextField.setName("BuildFileTextField"); + iBuildFileTextField.setBackground(SystemColor.textHighlightText); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iBuildFileTextField; + } + /** + * Return the BuildInfo property value. + * @return org.apache.tools.ant.taskdefs.optional.ide.VAJBuildInfo + */ + private VAJBuildInfo getBuildInfo() { + return iBuildInfo; + } + /** + * Return the CloseButton property value. + * @return java.awt.Button + */ + private Button getCloseButton() { + if (iCloseButton == null) { + try { + iCloseButton = new Button(); + iCloseButton.setName("CloseButton"); + iCloseButton.setLabel("Close"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iCloseButton; + } + /** + * Return the CommandButtonPanel property value. + * @return java.awt.Panel + */ + private Panel getCommandButtonPanel() { + if (iCommandButtonPanel == null) { + try { + iCommandButtonPanel = new Panel(); + iCommandButtonPanel.setName("CommandButtonPanel"); + iCommandButtonPanel.setLayout(getCommandButtonPanelFlowLayout()); + iCommandButtonPanel.setBackground(SystemColor.control); + iCommandButtonPanel.add(getReloadButton()); + iCommandButtonPanel.add(getBuildButton()); + iCommandButtonPanel.add(getStopButton()); + iCommandButtonPanel.add(getCloseButton()); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iCommandButtonPanel; + } + /** + * Return the CommandButtonPanelFlowLayout property value. + * @return java.awt.FlowLayout + */ + private FlowLayout getCommandButtonPanelFlowLayout() { + FlowLayout iCommandButtonPanelFlowLayout = null; + try { + /* Create part */ + iCommandButtonPanelFlowLayout = new FlowLayout(); + iCommandButtonPanelFlowLayout.setAlignment(FlowLayout.RIGHT); + } catch (Throwable iExc) { + handleException(iExc); + }; + return iCommandButtonPanelFlowLayout; + } + /** + * Return the ContentsPane property value. + * @return java.awt.Panel + */ + private Panel getContentsPane() { + if (iContentsPane == null) { + try { + iContentsPane = new Panel(); + iContentsPane.setName("ContentsPane"); + iContentsPane.setLayout(new BorderLayout()); + getContentsPane().add(getCommandButtonPanel(), "South"); + getContentsPane().add(getOptionenPanel(), "Center"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iContentsPane; + } + /** + * Return the FileDialog property value. + * @return java.awt.FileDialog + */ + private FileDialog getFileDialog() { + if (iFileDialog == null) { + try { + iFileDialog = new FileDialog(this); + iFileDialog.setName("FileDialog"); + iFileDialog.setLayout(null); + centerDialog(iFileDialog); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iFileDialog; + } + /** + * Return the FileMenu property value. + * @return java.awt.Menu + */ + private Menu getFileMenu() { + if (iFileMenu == null) { + try { + iFileMenu = new Menu(); + iFileMenu.setLabel("File"); + iFileMenu.add(getSaveMenuItem()); + iFileMenu.add(getMenuSeparator()); + iFileMenu.add(getShowLogMenuItem()); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iFileMenu; + } + /** + * Return the HelpMenu property value. + * @return java.awt.Menu + */ + private Menu getHelpMenu() { + if (iHelpMenu == null) { + try { + iHelpMenu = new Menu(); + iHelpMenu.setLabel("Help"); + iHelpMenu.add(getAboutMenuItem()); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iHelpMenu; + } + /** + * Return the MenuSeparator1 property value. + * @return java.awt.MenuItem + */ + private MenuItem getMenuSeparator() { + if (iMenuSeparator == null) { + try { + iMenuSeparator = new MenuItem(); + iMenuSeparator.setLabel("-"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iMenuSeparator; + } + /** + * Return the MessageClearLogButton property value. + * @return java.awt.Button + */ + private Button getMessageClearLogButton() { + if (iMessageClearLogButton == null) { + try { + iMessageClearLogButton = new Button(); + iMessageClearLogButton.setName("MessageClearLogButton"); + iMessageClearLogButton.setLabel("Clear Log"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iMessageClearLogButton; + } + /** + * Return the MessageCommandPanel property value. + * @return java.awt.Panel + */ + private Panel getMessageCommandPanel() { + if (iMessageCommandPanel == null) { + try { + iMessageCommandPanel = new Panel(); + iMessageCommandPanel.setName("MessageCommandPanel"); + iMessageCommandPanel.setLayout(new FlowLayout()); + getMessageCommandPanel().add(getMessageClearLogButton(), getMessageClearLogButton().getName()); + getMessageCommandPanel().add(getMessageOkButton(), getMessageOkButton().getName()); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iMessageCommandPanel; + } + /** + * Return the MessageContentPanel property value. + * @return java.awt.Panel + */ + private Panel getMessageContentPanel() { + if (iMessageContentPanel == null) { + try { + iMessageContentPanel = new Panel(); + iMessageContentPanel.setName("MessageContentPanel"); + iMessageContentPanel.setLayout(new BorderLayout()); + iMessageContentPanel.setBackground(SystemColor.control); + getMessageContentPanel().add(getMessageTextArea(), "Center"); + getMessageContentPanel().add(getMessageCommandPanel(), "South"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iMessageContentPanel; + } + /** + * Return the MessageFrame property value. + * @return java.awt.Frame + */ + private Frame getMessageFrame() { + if (iMessageFrame == null) { + try { + iMessageFrame = new Frame(); + iMessageFrame.setName("MessageFrame"); + iMessageFrame.setLayout(new BorderLayout()); + iMessageFrame.setBounds(0, 0, 750, 250); + iMessageFrame.setTitle("Message Log"); + iMessageFrame.add(getMessageContentPanel(), "Center"); + iMessageFrame.setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (iMessageFrame.getSize().width / 2), (java.awt.Toolkit.getDefaultToolkit().getScreenSize().height / 2)); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iMessageFrame; + } + /** + * Return the MessageOkButton property value. + * @return java.awt.Button + */ + private Button getMessageOkButton() { + if (iMessageOkButton == null) { + try { + iMessageOkButton = new Button(); + iMessageOkButton.setName("MessageOkButton"); + iMessageOkButton.setLabel("Close"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iMessageOkButton; + } + /** + * Return the MessageOutputLevelChoice property value. + * @return java.awt.Choice + */ + private Choice getMessageOutputLevelChoice() { + if (iMessageOutputLevelChoice == null) { + try { + iMessageOutputLevelChoice = new Choice(); + iMessageOutputLevelChoice.setName("MessageOutputLevelChoice"); + iMessageOutputLevelChoice.add("Error"); + iMessageOutputLevelChoice.add("Warning"); + iMessageOutputLevelChoice.add("Info"); + iMessageOutputLevelChoice.add("Verbose"); + iMessageOutputLevelChoice.add("Debug"); + iMessageOutputLevelChoice.select(2); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iMessageOutputLevelChoice; + } + /** + * Return the MessageOutputLevelLabel property value. + * @return java.awt.Label + */ + private Label getMessageOutputLevelLabel() { + if (iMessageOutputLevelLabel == null) { + try { + iMessageOutputLevelLabel = new Label(); + iMessageOutputLevelLabel.setName("MessageOutputLevelLabel"); + iMessageOutputLevelLabel.setText("Message Level:"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iMessageOutputLevelLabel; + } + /** + * Return the MessageTextArea property value. + * @return java.awt.TextArea + */ + private TextArea getMessageTextArea() { + if (iMessageTextArea == null) { + try { + iMessageTextArea = new TextArea(); + iMessageTextArea.setName("MessageTextArea"); + iMessageTextArea.setFont(new Font("monospaced", 0, 12)); + iMessageTextArea.setText(""); + iMessageTextArea.setEditable(false); + iMessageTextArea.setEnabled(true); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iMessageTextArea; + } + /** + * Return the Panel1 property value. + * @return java.awt.Panel + */ + private Panel getOptionenPanel() { + if (iOptionenPanel == null) { + try { + iOptionenPanel = new Panel(); + iOptionenPanel.setName("OptionenPanel"); + iOptionenPanel.setLayout(new GridBagLayout()); + iOptionenPanel.setBackground(SystemColor.control); - GridBagConstraints constraintsAboutContactLabel = new GridBagConstraints(); - constraintsAboutContactLabel.gridx = 0; constraintsAboutContactLabel.gridy = 2; - constraintsAboutContactLabel.fill = GridBagConstraints.HORIZONTAL; - constraintsAboutContactLabel.weightx = 1.0; - constraintsAboutContactLabel.insets = new Insets(2, 0, 4, 0); - getAboutInfoPanel().add(getAboutContactLabel(), constraintsAboutContactLabel); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iAboutInfoPanel; - } - /** - * Return the AboutMenuItem property value. - * @return java.awt.MenuItem - */ - private MenuItem getAboutMenuItem() { - if (iAboutMenuItem == null) { - try { - iAboutMenuItem = new MenuItem(); - iAboutMenuItem.setLabel("About..."); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iAboutMenuItem; - } - /** - * Return the AboutOkButton property value. - * @return java.awt.Button - */ - private Button getAboutOkButton() { - if (iAboutOkButton == null) { - try { - iAboutOkButton = new Button(); - iAboutOkButton.setName("AboutOkButton"); - iAboutOkButton.setLabel("OK"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iAboutOkButton; - } - /** - * Return the AboutTitleLabel property value. - * @return java.awt.Label - */ - private Label getAboutTitleLabel() { - if (iAboutTitleLabel == null) { - try { - iAboutTitleLabel = new Label(); - iAboutTitleLabel.setName("AboutTitleLabel"); - iAboutTitleLabel.setFont(new Font("Arial", 1, 12)); - iAboutTitleLabel.setAlignment(Label.CENTER); - iAboutTitleLabel.setText("Ant VisualAge for Java Tool-Integration"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iAboutTitleLabel; - } - /** - * Return the AntMakeMenuBar property value. - * @return java.awt.MenuBar - */ - private MenuBar getAntMakeMenuBar() { - if (iAntMakeMenuBar == null) { - try { - iAntMakeMenuBar = new MenuBar(); - iAntMakeMenuBar.add(getFileMenu()); - iAntMakeMenuBar.add(getHelpMenu()); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iAntMakeMenuBar; - } - /** - * Return the BrowseButton property value. - * @return Button - */ - private Button getBrowseButton() { - if (iBrowseButton == null) { - try { - iBrowseButton = new Button(); - iBrowseButton.setName("BrowseButton"); - iBrowseButton.setLabel("..."); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iBrowseButton; - } - /** - * Return the BuildButton property value. - * @return java.awt.Button - */ - private Button getBuildButton() { - if (iBuildButton == null) { - try { - iBuildButton = new Button(); - iBuildButton.setName("BuildButton"); - iBuildButton.setLabel("Build"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iBuildButton; - } - /** - * Return the BuildFileLabel property value. - * @return java.awt.Label - */ - private Label getBuildFileLabel() { - if (iBuildFileLabel == null) { - try { - iBuildFileLabel = new Label(); - iBuildFileLabel.setName("BuildFileLabel"); - iBuildFileLabel.setText("Ant-Buildfile:"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iBuildFileLabel; - } - /** - * Return the BuildFileTextField property value. - * @return java.awt.TextField - */ - private TextField getBuildFileTextField() { - if (iBuildFileTextField == null) { - try { - iBuildFileTextField = new TextField(); - iBuildFileTextField.setName("BuildFileTextField"); - iBuildFileTextField.setBackground(SystemColor.textHighlightText); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iBuildFileTextField; - } - /** - * Return the BuildInfo property value. - * @return org.apache.tools.ant.taskdefs.optional.ide.VAJBuildInfo - */ - private VAJBuildInfo getBuildInfo() { - return iBuildInfo; - } - /** - * Return the CloseButton property value. - * @return java.awt.Button - */ - private Button getCloseButton() { - if (iCloseButton == null) { - try { - iCloseButton = new Button(); - iCloseButton.setName("CloseButton"); - iCloseButton.setLabel("Close"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iCloseButton; - } - /** - * Return the CommandButtonPanel property value. - * @return java.awt.Panel - */ - private Panel getCommandButtonPanel() { - if (iCommandButtonPanel == null) { - try { - iCommandButtonPanel = new Panel(); - iCommandButtonPanel.setName("CommandButtonPanel"); - iCommandButtonPanel.setLayout(getCommandButtonPanelFlowLayout()); - iCommandButtonPanel.setBackground(SystemColor.control); - iCommandButtonPanel.add(getReloadButton()); - getCommandButtonPanel().add(getBuildButton(), getBuildButton().getName()); - getCommandButtonPanel().add(getCloseButton(), getCloseButton().getName()); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iCommandButtonPanel; - } - /** - * Return the CommandButtonPanelFlowLayout property value. - * @return java.awt.FlowLayout - */ - private FlowLayout getCommandButtonPanelFlowLayout() { - FlowLayout iCommandButtonPanelFlowLayout = null; - try { - /* Create part */ - iCommandButtonPanelFlowLayout = new FlowLayout(); - iCommandButtonPanelFlowLayout.setAlignment(FlowLayout.RIGHT); - } catch (Throwable iExc) { - handleException(iExc); - }; - return iCommandButtonPanelFlowLayout; - } - /** - * Return the ContentsPane property value. - * @return java.awt.Panel - */ - private Panel getContentsPane() { - if (iContentsPane == null) { - try { - iContentsPane = new Panel(); - iContentsPane.setName("ContentsPane"); - iContentsPane.setLayout(new BorderLayout()); - getContentsPane().add(getCommandButtonPanel(), "South"); - getContentsPane().add(getOptionenPanel(), "Center"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iContentsPane; - } - /** - * Return the FileDialog property value. - * @return java.awt.FileDialog - */ - private FileDialog getFileDialog() { - if (iFileDialog == null) { - try { - iFileDialog = new FileDialog(this); - iFileDialog.setName("FileDialog"); - iFileDialog.setLayout(null); - centerDialog(iFileDialog); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iFileDialog; - } - /** - * Return the FileMenu property value. - * @return java.awt.Menu - */ - private Menu getFileMenu() { - if (iFileMenu == null) { - try { - iFileMenu = new Menu(); - iFileMenu.setLabel("File"); - iFileMenu.add(getSaveMenuItem()); - iFileMenu.add(getMenuSeparator()); - iFileMenu.add(getShowLogMenuItem()); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iFileMenu; - } - /** - * Return the HelpMenu property value. - * @return java.awt.Menu - */ - private Menu getHelpMenu() { - if (iHelpMenu == null) { - try { - iHelpMenu = new Menu(); - iHelpMenu.setLabel("Help"); - iHelpMenu.add(getAboutMenuItem()); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iHelpMenu; - } - /** - * Return the MenuSeparator1 property value. - * @return java.awt.MenuItem - */ - private MenuItem getMenuSeparator() { - if (iMenuSeparator == null) { - try { - iMenuSeparator = new MenuItem(); - iMenuSeparator.setLabel("-"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iMenuSeparator; - } - /** - * Return the MessageClearLogButton property value. - * @return java.awt.Button - */ - private Button getMessageClearLogButton() { - if (iMessageClearLogButton == null) { - try { - iMessageClearLogButton = new Button(); - iMessageClearLogButton.setName("MessageClearLogButton"); - iMessageClearLogButton.setLabel("Clear Log"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iMessageClearLogButton; - } - /** - * Return the MessageCommandPanel property value. - * @return java.awt.Panel - */ - private Panel getMessageCommandPanel() { - if (iMessageCommandPanel == null) { - try { - iMessageCommandPanel = new Panel(); - iMessageCommandPanel.setName("MessageCommandPanel"); - iMessageCommandPanel.setLayout(new FlowLayout()); - getMessageCommandPanel().add(getMessageClearLogButton(), getMessageClearLogButton().getName()); - getMessageCommandPanel().add(getMessageOkButton(), getMessageOkButton().getName()); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iMessageCommandPanel; - } - /** - * Return the MessageContentPanel property value. - * @return java.awt.Panel - */ - private Panel getMessageContentPanel() { - if (iMessageContentPanel == null) { - try { - iMessageContentPanel = new Panel(); - iMessageContentPanel.setName("MessageContentPanel"); - iMessageContentPanel.setLayout(new BorderLayout()); - iMessageContentPanel.setBackground(SystemColor.control); - getMessageContentPanel().add(getMessageTextArea(), "Center"); - getMessageContentPanel().add(getMessageCommandPanel(), "South"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iMessageContentPanel; - } - /** - * Return the MessageFrame property value. - * @return java.awt.Frame - */ - private Frame getMessageFrame() { - if (iMessageFrame == null) { - try { - iMessageFrame = new Frame(); - iMessageFrame.setName("MessageFrame"); - iMessageFrame.setLayout(new BorderLayout()); - iMessageFrame.setBounds(0, 0, 750, 250); - iMessageFrame.setTitle("Message Log"); - iMessageFrame.add(getMessageContentPanel(), "Center"); - iMessageFrame.setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (iMessageFrame.getSize().width / 2), (java.awt.Toolkit.getDefaultToolkit().getScreenSize().height / 2)); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iMessageFrame; - } - /** - * Return the MessageOkButton property value. - * @return java.awt.Button - */ - private Button getMessageOkButton() { - if (iMessageOkButton == null) { - try { - iMessageOkButton = new Button(); - iMessageOkButton.setName("MessageOkButton"); - iMessageOkButton.setLabel("Close"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iMessageOkButton; - } - /** - * Return the MessageOutputLevelChoice property value. - * @return java.awt.Choice - */ - private Choice getMessageOutputLevelChoice() { - if (iMessageOutputLevelChoice == null) { - try { - iMessageOutputLevelChoice = new Choice(); - iMessageOutputLevelChoice.setName("MessageOutputLevelChoice"); - iMessageOutputLevelChoice.add("Error"); - iMessageOutputLevelChoice.add("Warning"); - iMessageOutputLevelChoice.add("Info"); - iMessageOutputLevelChoice.add("Verbose"); - iMessageOutputLevelChoice.add("Debug"); - iMessageOutputLevelChoice.select(2); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iMessageOutputLevelChoice; - } - /** - * Return the MessageOutputLevelLabel property value. - * @return java.awt.Label - */ - private Label getMessageOutputLevelLabel() { - if (iMessageOutputLevelLabel == null) { - try { - iMessageOutputLevelLabel = new Label(); - iMessageOutputLevelLabel.setName("MessageOutputLevelLabel"); - iMessageOutputLevelLabel.setText("Message Level:"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iMessageOutputLevelLabel; - } - /** - * Return the MessageTextArea property value. - * @return java.awt.TextArea - */ - private TextArea getMessageTextArea() { - if (iMessageTextArea == null) { - try { - iMessageTextArea = new TextArea(); - iMessageTextArea.setName("MessageTextArea"); - iMessageTextArea.setFont(new Font("monospaced", 0, 12)); - iMessageTextArea.setText(""); - iMessageTextArea.setEditable(false); - iMessageTextArea.setEnabled(true); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iMessageTextArea; - } - /** - * Return the Panel1 property value. - * @return java.awt.Panel - */ - private Panel getOptionenPanel() { - if (iOptionenPanel == null) { - try { - iOptionenPanel = new Panel(); - iOptionenPanel.setName("OptionenPanel"); - iOptionenPanel.setLayout(new GridBagLayout()); - iOptionenPanel.setBackground(SystemColor.control); + GridBagConstraints constraintsProjectLabel = new GridBagConstraints(); + constraintsProjectLabel.gridx = 0; constraintsProjectLabel.gridy = 0; + constraintsProjectLabel.anchor = GridBagConstraints.WEST; + constraintsProjectLabel.insets = new Insets(4, 4, 4, 4); + getOptionenPanel().add(getProjectLabel(), constraintsProjectLabel); - GridBagConstraints constraintsProjectLabel = new GridBagConstraints(); - constraintsProjectLabel.gridx = 0; constraintsProjectLabel.gridy = 0; - constraintsProjectLabel.anchor = GridBagConstraints.WEST; - constraintsProjectLabel.insets = new Insets(4, 4, 4, 4); - getOptionenPanel().add(getProjectLabel(), constraintsProjectLabel); + GridBagConstraints constraintsBuildFileLabel = new GridBagConstraints(); + constraintsBuildFileLabel.gridx = 0; constraintsBuildFileLabel.gridy = 1; + constraintsBuildFileLabel.anchor = GridBagConstraints.WEST; + constraintsBuildFileLabel.insets = new Insets(4, 4, 4, 4); + getOptionenPanel().add(getBuildFileLabel(), constraintsBuildFileLabel); - GridBagConstraints constraintsBuildFileLabel = new GridBagConstraints(); - constraintsBuildFileLabel.gridx = 0; constraintsBuildFileLabel.gridy = 1; - constraintsBuildFileLabel.anchor = GridBagConstraints.WEST; - constraintsBuildFileLabel.insets = new Insets(4, 4, 4, 4); - getOptionenPanel().add(getBuildFileLabel(), constraintsBuildFileLabel); + GridBagConstraints constraintsTargetLabel = new GridBagConstraints(); + constraintsTargetLabel.gridx = 0; constraintsTargetLabel.gridy = 2; + constraintsTargetLabel.anchor = GridBagConstraints.NORTHWEST; + constraintsTargetLabel.insets = new Insets(4, 4, 4, 4); + getOptionenPanel().add(getTargetLabel(), constraintsTargetLabel); - GridBagConstraints constraintsTargetLabel = new GridBagConstraints(); - constraintsTargetLabel.gridx = 0; constraintsTargetLabel.gridy = 2; - constraintsTargetLabel.anchor = GridBagConstraints.NORTHWEST; - constraintsTargetLabel.insets = new Insets(4, 4, 4, 4); - getOptionenPanel().add(getTargetLabel(), constraintsTargetLabel); + GridBagConstraints constraintsProjectText = new GridBagConstraints(); + constraintsProjectText.gridx = 1; constraintsProjectText.gridy = 0; + constraintsProjectText.gridwidth = 2; + constraintsProjectText.fill = GridBagConstraints.HORIZONTAL; + constraintsProjectText.anchor = GridBagConstraints.WEST; + constraintsProjectText.insets = new Insets(4, 4, 4, 4); + getOptionenPanel().add(getProjectText(), constraintsProjectText); - GridBagConstraints constraintsProjectText = new GridBagConstraints(); - constraintsProjectText.gridx = 1; constraintsProjectText.gridy = 0; - constraintsProjectText.gridwidth = 2; - constraintsProjectText.fill = GridBagConstraints.HORIZONTAL; - constraintsProjectText.anchor = GridBagConstraints.WEST; - constraintsProjectText.insets = new Insets(4, 4, 4, 4); - getOptionenPanel().add(getProjectText(), constraintsProjectText); + GridBagConstraints constraintsBuildFileTextField = new GridBagConstraints(); + constraintsBuildFileTextField.gridx = 1; constraintsBuildFileTextField.gridy = 1; + constraintsBuildFileTextField.fill = GridBagConstraints.HORIZONTAL; + constraintsBuildFileTextField.anchor = GridBagConstraints.WEST; + constraintsBuildFileTextField.weightx = 1.0; + constraintsBuildFileTextField.insets = new Insets(4, 4, 4, 4); + getOptionenPanel().add(getBuildFileTextField(), constraintsBuildFileTextField); - GridBagConstraints constraintsBuildFileTextField = new GridBagConstraints(); - constraintsBuildFileTextField.gridx = 1; constraintsBuildFileTextField.gridy = 1; - constraintsBuildFileTextField.fill = GridBagConstraints.HORIZONTAL; - constraintsBuildFileTextField.anchor = GridBagConstraints.WEST; - constraintsBuildFileTextField.weightx = 1.0; - constraintsBuildFileTextField.insets = new Insets(4, 4, 4, 4); - getOptionenPanel().add(getBuildFileTextField(), constraintsBuildFileTextField); + GridBagConstraints constraintsBrowseButton = new GridBagConstraints(); + constraintsBrowseButton.gridx = 2; constraintsBrowseButton.gridy = 1; + constraintsBrowseButton.insets = new Insets(4, 4, 4, 4); + getOptionenPanel().add(getBrowseButton(), constraintsBrowseButton); - GridBagConstraints constraintsBrowseButton = new GridBagConstraints(); - constraintsBrowseButton.gridx = 2; constraintsBrowseButton.gridy = 1; - constraintsBrowseButton.insets = new Insets(4, 4, 4, 4); - getOptionenPanel().add(getBrowseButton(), constraintsBrowseButton); + GridBagConstraints constraintsTargetList = new GridBagConstraints(); + constraintsTargetList.gridx = 1; constraintsTargetList.gridy = 2; + constraintsTargetList.gridheight = 2; + constraintsTargetList.fill = GridBagConstraints.BOTH; + constraintsTargetList.weightx = 1.0; + constraintsTargetList.weighty = 1.0; + constraintsTargetList.insets = new Insets(4, 4, 4, 4); + getOptionenPanel().add(getTargetList(), constraintsTargetList); - GridBagConstraints constraintsTargetList = new GridBagConstraints(); - constraintsTargetList.gridx = 1; constraintsTargetList.gridy = 2; - constraintsTargetList.gridheight = 2; - constraintsTargetList.fill = GridBagConstraints.BOTH; - constraintsTargetList.weightx = 1.0; - constraintsTargetList.weighty = 1.0; - constraintsTargetList.insets = new Insets(4, 4, 4, 4); - getOptionenPanel().add(getTargetList(), constraintsTargetList); + GridBagConstraints constraintsMessageOutputLevelLabel = new GridBagConstraints(); + constraintsMessageOutputLevelLabel.gridx = 0; constraintsMessageOutputLevelLabel.gridy = 4; + constraintsMessageOutputLevelLabel.anchor = GridBagConstraints.WEST; + constraintsMessageOutputLevelLabel.insets = new Insets(4, 4, 4, 4); + getOptionenPanel().add(getMessageOutputLevelLabel(), constraintsMessageOutputLevelLabel); - GridBagConstraints constraintsMessageOutputLevelLabel = new GridBagConstraints(); - constraintsMessageOutputLevelLabel.gridx = 0; constraintsMessageOutputLevelLabel.gridy = 4; - constraintsMessageOutputLevelLabel.anchor = GridBagConstraints.WEST; - constraintsMessageOutputLevelLabel.insets = new Insets(4, 4, 4, 4); - getOptionenPanel().add(getMessageOutputLevelLabel(), constraintsMessageOutputLevelLabel); + GridBagConstraints constraintsMessageOutputLevelChoice = new GridBagConstraints(); + constraintsMessageOutputLevelChoice.gridx = 1; constraintsMessageOutputLevelChoice.gridy = 4; + constraintsMessageOutputLevelChoice.fill = GridBagConstraints.HORIZONTAL; + constraintsMessageOutputLevelChoice.anchor = GridBagConstraints.WEST; + constraintsMessageOutputLevelChoice.weightx = 1.0; + constraintsMessageOutputLevelChoice.insets = new Insets(4, 4, 4, 4); + getOptionenPanel().add(getMessageOutputLevelChoice(), constraintsMessageOutputLevelChoice); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iOptionenPanel; + } + /** + * Return the ProjectLabel property value. + * @return java.awt.Label + */ + private Label getProjectLabel() { + if (iProjectLabel == null) { + try { + iProjectLabel = new Label(); + iProjectLabel.setName("ProjectLabel"); + iProjectLabel.setText("Projectname:"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iProjectLabel; + } + /** + * Return the ProjectText property value. + * @return java.awt.Label + */ + private Label getProjectText() { + if (iProjectText == null) { + try { + iProjectText = new Label(); + iProjectText.setName("ProjectText"); + iProjectText.setText(" "); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iProjectText; + } + /** + * Return the ReloadButton property value. + * @return java.awt.Button + */ + private Button getReloadButton() { + if (iReloadButton == null) { + try { + iReloadButton = new Button(); + iReloadButton.setName("ReloadButton"); + iReloadButton.setLabel("(Re)Load"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iReloadButton; + } + /** + * Return the SaveMenuItem property value. + * @return java.awt.MenuItem + */ + private MenuItem getSaveMenuItem() { + if (iSaveMenuItem == null) { + try { + iSaveMenuItem = new MenuItem(); + iSaveMenuItem.setLabel("Save BuildInfo To Repository"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iSaveMenuItem; + } + /** + * Return the ShowLogMenuItem property value. + * @return java.awt.MenuItem + */ + private MenuItem getShowLogMenuItem() { + if (iShowLogMenuItem == null) { + try { + iShowLogMenuItem = new MenuItem(); + iShowLogMenuItem.setLabel("Log"); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iShowLogMenuItem; + } + /** + * Return the TargetLabel property value. + * @return java.awt.Label + */ + private Label getTargetLabel() { + if (iTargetLabel == null) { + try { + iTargetLabel = new Label(); + iTargetLabel.setName("TargetLabel"); + iTargetLabel.setText("Target:"); + iTargetLabel.setEnabled(true); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iTargetLabel; + } + /** + * Return the TargetList property value. + * @return java.awt.List + */ + private List getTargetList() { + if (iTargetList == null) { + try { + iTargetList = new List(); + iTargetList.setName("TargetList"); + iTargetList.setEnabled(true); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iTargetList; + } + /** + * Called whenever the part throws an exception. + * @param exception Throwable + */ + private void handleException(Throwable exception) { + // Write exceptions to the log-window + StringWriter sw = new StringWriter(); + exception.printStackTrace(new PrintWriter(sw)); + String trace = new String( sw.getBuffer() ); - GridBagConstraints constraintsMessageOutputLevelChoice = new GridBagConstraints(); - constraintsMessageOutputLevelChoice.gridx = 1; constraintsMessageOutputLevelChoice.gridy = 4; - constraintsMessageOutputLevelChoice.fill = GridBagConstraints.HORIZONTAL; - constraintsMessageOutputLevelChoice.anchor = GridBagConstraints.WEST; - constraintsMessageOutputLevelChoice.weightx = 1.0; - constraintsMessageOutputLevelChoice.insets = new Insets(4, 4, 4, 4); - getOptionenPanel().add(getMessageOutputLevelChoice(), constraintsMessageOutputLevelChoice); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iOptionenPanel; - } - /** - * Return the ProjectLabel property value. - * @return java.awt.Label - */ - private Label getProjectLabel() { - if (iProjectLabel == null) { - try { - iProjectLabel = new Label(); - iProjectLabel.setName("ProjectLabel"); - iProjectLabel.setText("Projectname:"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iProjectLabel; - } - /** - * Return the ProjectText property value. - * @return java.awt.Label - */ - private Label getProjectText() { - if (iProjectText == null) { - try { - iProjectText = new Label(); - iProjectText.setName("ProjectText"); - iProjectText.setText(" "); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iProjectText; - } - /** - * Return the ReloadButton property value. - * @return java.awt.Button - */ - private Button getReloadButton() { - if (iReloadButton == null) { - try { - iReloadButton = new Button(); - iReloadButton.setName("ReloadButton"); - iReloadButton.setLabel("(Re)Load"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iReloadButton; - } - /** - * Return the SaveMenuItem property value. - * @return java.awt.MenuItem - */ - private MenuItem getSaveMenuItem() { - if (iSaveMenuItem == null) { - try { - iSaveMenuItem = new MenuItem(); - iSaveMenuItem.setLabel("Save BuildInfo To Repository"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iSaveMenuItem; - } - /** - * Return the ShowLogMenuItem property value. - * @return java.awt.MenuItem - */ - private MenuItem getShowLogMenuItem() { - if (iShowLogMenuItem == null) { - try { - iShowLogMenuItem = new MenuItem(); - iShowLogMenuItem.setLabel("Log"); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iShowLogMenuItem; - } - /** - * Return the TargetLabel property value. - * @return java.awt.Label - */ - private Label getTargetLabel() { - if (iTargetLabel == null) { - try { - iTargetLabel = new Label(); - iTargetLabel.setName("TargetLabel"); - iTargetLabel.setText("Target:"); - iTargetLabel.setEnabled(true); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iTargetLabel; - } - /** - * Return the TargetList property value. - * @return java.awt.List - */ - private List getTargetList() { - if (iTargetList == null) { - try { - iTargetList = new List(); - iTargetList.setName("TargetList"); - iTargetList.setEnabled(true); - } catch (Throwable iExc) { - handleException(iExc); - } - } - return iTargetList; - } - /** - * Called whenever the part throws an exception. - * @param exception Throwable - */ - private void handleException(Throwable exception) { - // Write exceptions to the log-window - getMessageTextArea().append(lineSeparator + lineSeparator + exception.getMessage()); - getMessageFrame().show(); + getMessageTextArea().append(lineSeparator + lineSeparator + trace); + getMessageFrame().show(); - } - /** - * Initializes connections - * @exception Exception The exception description. - */ - private void initConnections() throws Exception { - this.addWindowListener(iEventHandler); - getBrowseButton().addActionListener(iEventHandler); - getCloseButton().addActionListener(iEventHandler); - getBuildButton().addActionListener(iEventHandler); - getSaveMenuItem().addActionListener(iEventHandler); - getAboutOkButton().addActionListener(iEventHandler); - getAboutMenuItem().addActionListener(iEventHandler); - getMessageOkButton().addActionListener(iEventHandler); - getMessageClearLogButton().addActionListener(iEventHandler); - getMessageOkButton().addActionListener(iEventHandler); - getShowLogMenuItem().addActionListener(iEventHandler); - getAboutDialog().addWindowListener(iEventHandler); - getMessageFrame().addWindowListener(iEventHandler); - getReloadButton().addActionListener(iEventHandler); - getTargetList().addItemListener(iEventHandler); - getMessageOutputLevelChoice().addItemListener(iEventHandler); - getBuildFileTextField().addTextListener(iEventHandler); - connectProjectNameToLabel(); - connectBuildFileNameToTextField(); - } - /** - * Initialize the class. - */ - private void initialize() { - try { - setName("AntMake"); - setMenuBar(getAntMakeMenuBar()); - setLayout(new java.awt.BorderLayout()); - setSize(389, 222); - setTitle("Ant VisualAge for Java Tool-Integration"); - add(getContentsPane(), "Center"); - initConnections(); - } catch (Throwable iExc) { - handleException(iExc); - } - setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (getSize().width / 2), (java.awt.Toolkit.getDefaultToolkit().getScreenSize().height / 2) - (getSize().height)); - if ((getTargetList().getItemCount() == 0) || (getTargetList().getSelectedIndex() < 0)) { - getBuildButton().setEnabled(false); - } - } - /** - * Saves the build-informations to repository - */ - private void saveBuildInfo() { - try { - VAJAntTool.saveBuildData(getBuildInfo()); - } - catch (Throwable exc) { - // This Exception occurs when you try to write into a versioned project - handleException( exc ); - } - return; - } - /** - * Set the BuildInfo to a new value. - * @param newValue org.apache.tools.ant.taskdefs.optional.vaj.VAJBuildInfo - */ - private void setBuildInfo(VAJBuildInfo newValue) { - if (iBuildInfo != newValue) { - try { - /* Stop listening for events from the current object */ - if (iBuildInfo != null) { - iBuildInfo.removePropertyChangeListener(iEventHandler); - } - iBuildInfo = newValue; + } + /** + * Initializes connections + * @exception Exception The exception description. + */ + private void initConnections() throws Exception { + this.addWindowListener(iEventHandler); + getBrowseButton().addActionListener(iEventHandler); + getCloseButton().addActionListener(iEventHandler); + getBuildButton().addActionListener(iEventHandler); + getStopButton().addActionListener(iEventHandler); + getSaveMenuItem().addActionListener(iEventHandler); + getAboutOkButton().addActionListener(iEventHandler); + getAboutMenuItem().addActionListener(iEventHandler); + getMessageOkButton().addActionListener(iEventHandler); + getMessageClearLogButton().addActionListener(iEventHandler); + getMessageOkButton().addActionListener(iEventHandler); + getShowLogMenuItem().addActionListener(iEventHandler); + getAboutDialog().addWindowListener(iEventHandler); + getMessageFrame().addWindowListener(iEventHandler); + getReloadButton().addActionListener(iEventHandler); + getTargetList().addItemListener(iEventHandler); + getMessageOutputLevelChoice().addItemListener(iEventHandler); + getBuildFileTextField().addTextListener(iEventHandler); + connectProjectNameToLabel(); + connectBuildFileNameToTextField(); + } + /** + * Initialize the class. + */ + private void initialize() { + try { + setName("AntMake"); + setMenuBar(getAntMakeMenuBar()); + setLayout(new java.awt.BorderLayout()); + setSize(389, 222); + setTitle("Ant VisualAge for Java Tool-Integration"); + add(getContentsPane(), "Center"); + initConnections(); + } catch (Throwable iExc) { + handleException(iExc); + } + setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (getSize().width / 2), (java.awt.Toolkit.getDefaultToolkit().getScreenSize().height / 2) - (getSize().height)); + if ((getTargetList().getItemCount() == 0) || (getTargetList().getSelectedIndex() < 0)) { + getBuildButton().setEnabled(false); + } + } + /** + * Saves the build-informations to repository + */ + private void saveBuildInfo() { + try { + VAJAntTool.saveBuildData(getBuildInfo()); + } + catch (Throwable exc) { + // This Exception occurs when you try to write into a versioned project + handleException( exc ); + } + return; + } + /** + * Set the BuildInfo to a new value. + * @param newValue org.apache.tools.ant.taskdefs.optional.vaj.VAJBuildInfo + */ + private void setBuildInfo(VAJBuildInfo newValue) { + if (iBuildInfo != newValue) { + try { + /* Stop listening for events from the current object */ + if (iBuildInfo != null) { + iBuildInfo.removePropertyChangeListener(iEventHandler); + } + iBuildInfo = newValue; + + /* Listen for events from the new object */ + if (iBuildInfo != null) { + iBuildInfo.addPropertyChangeListener(iEventHandler); + } + connectProjectNameToLabel(); + connectBuildFileNameToTextField(); + + // Select the log-level given by BuildInfo + getMessageOutputLevelChoice().select(iBuildInfo.getOutputMessageLevel()); + fillList(); + // BuildInfo can conly be saved to a VAJ project if tool API is called via the projects context-menu + if ((iBuildInfo.getVAJProjectName() == null) || (iBuildInfo.getVAJProjectName().equals(""))) { + getSaveMenuItem().setEnabled(false); + } + } catch (Throwable iExc) { + handleException(iExc); + } + } + } - /* Listen for events from the new object */ - if (iBuildInfo != null) { - iBuildInfo.addPropertyChangeListener(iEventHandler); - } - connectProjectNameToLabel(); - connectBuildFileNameToTextField(); + private Button iStopButton = null; - // Select the log-level given by BuildInfo - getMessageOutputLevelChoice().select(iBuildInfo.getOutputMessageLevel()); - fillList(); - // BuildInfo can conly be saved to a VAJ project if tool API is called via the projects context-menu - if ((iBuildInfo.getVAJProjectName() == null) || (iBuildInfo.getVAJProjectName().equals(""))) { - getSaveMenuItem().setEnabled(false); - } - } catch (Throwable iExc) { - handleException(iExc); - } - } - } + /** + * Return the StopButton property value. + * @return java.awt.Button + */ + private Button getStopButton() { + if (iStopButton == null) { + try { + iStopButton = new Button(); + iStopButton.setName("StopButton"); + iStopButton.setLabel("Stop"); + iStopButton.setEnabled(false); + } catch (Throwable iExc) { + handleException(iExc); + } + } + return iStopButton; + } } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJBuildInfo.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJBuildInfo.java index 7bce10860..9cd8bcd3d 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJBuildInfo.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJBuildInfo.java @@ -1,5 +1,3 @@ -package org.apache.tools.ant.taskdefs.optional.ide; - /* * The Apache Software License, Version 1.1 * @@ -53,11 +51,23 @@ package org.apache.tools.ant.taskdefs.optional.ide; * information on the Apache Software Foundation, please see * . */ -import java.util.Hashtable; + +package org.apache.tools.ant.taskdefs.optional.ide; + + import java.util.Vector; import java.util.Enumeration; -import org.apache.tools.ant.*; +import java.util.StringTokenizer; import java.io.File; +import java.beans.PropertyChangeSupport; +import java.beans.PropertyChangeListener; + +import org.apache.tools.ant.Project; +import org.apache.tools.ant.ProjectHelper; +import org.apache.tools.ant.Target; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.BuildListener; +import org.apache.tools.ant.BuildEvent; /** * This class wraps the Ant project information needed to @@ -68,276 +78,443 @@ import java.io.File; * as ToolData in the VA repository) * - wraps Project functions for the GUI (get target list, * execute target) + * - manages a seperate thread for Ant project execution + * this allows interrupting a running build from a GUI * * @author Wolf Siberski, TUI Infotec GmbH */ -public class VAJBuildInfo { - // name of the VA project this BuildInfo belongs to - private String vajProjectName = ""; +class VAJBuildInfo implements Runnable { + /** + * This exception is thrown when a build is interrupted + */ + static public class BuildInterruptedException extends BuildException { + public String toString() { + return "BUILD INTERRUPTED"; + } + } + + /** + * BuildListener which checks for interruption and throws Exception + * if build process is interrupted. This class is a wrapper around + * a 'real' listener. + */ + private class InterruptedChecker implements BuildListener { + // the real listener + BuildListener wrappedListener; + + /** + * Can only be constructed as wrapper around a real listener + * @param listener the real listener + */ + public InterruptedChecker( BuildListener listener) { + super(); + wrappedListener = listener; + } + + /** + * checks if the thread was interrupted. When an + * interrupt occured, throw an Exception to stop + * the execution. + */ + protected void checkInterrupted() { + if ( buildThread.isInterrupted() ) { + throw new BuildInterruptedException(); + } + } + + /** + * Fired after the last target has finished. This event + * will still be thrown if an error occured during the build. + */ + public void buildFinished(BuildEvent event) { + wrappedListener.buildFinished( event ); + checkInterrupted(); + } + + /** + * Fired before any targets are started. + */ + public void buildStarted(BuildEvent event) { + wrappedListener.buildStarted( event ); + checkInterrupted(); + } + + /** + * Fired whenever a message is logged. + */ + public void messageLogged(BuildEvent event) { + wrappedListener.messageLogged( event ); + checkInterrupted(); + } + + /** + * Fired when a target has finished. This event will + * still be thrown if an error occured during the build. + */ + public void targetFinished(BuildEvent event) { + wrappedListener.targetFinished( event ); + checkInterrupted(); + } + + /** + * Fired when a target is started. + */ + public void targetStarted(BuildEvent event) { + wrappedListener.targetStarted( event ); + checkInterrupted(); + } + + /** + * Fired when a task has finished. This event will still + * be throw if an error occured during the build. + */ + public void taskFinished(BuildEvent event) { + wrappedListener.taskFinished( event ); + checkInterrupted(); + } + + /** + * Fired when a task is started. + */ + public void taskStarted(BuildEvent event) { + wrappedListener.taskStarted( event ); + checkInterrupted(); + } + } + - // name of the Ant build file - private String buildFileName = ""; + // name of the VA project this BuildInfo belongs to + private String vajProjectName = ""; + + // name of the Ant build file + private String buildFileName = ""; - // main targets found in the build file - private Vector projectTargets = new Vector(); + // main targets found in the build file + private Vector projectTargets = new Vector(); - // target selected for execution - private java.lang.String target = ""; + // target selected for execution + private java.lang.String target = ""; - // log level - private int outputMessageLevel = Project.MSG_INFO; + // log level + private int outputMessageLevel = Project.MSG_INFO; - // Ant Project created from build file - private transient Project project; + // Ant Project created from build file + private transient Project project; - // is true if Project initialization was successful - private transient boolean projectInitialized = false; + // is true if Project initialization was successful + private transient boolean projectInitialized = false; - // Support for bound properties - protected transient java.beans.PropertyChangeSupport propertyChange; -/** - * The addPropertyChangeListener method was generated to support the propertyChange field. - */ -public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener listener) { - getPropertyChange().addPropertyChangeListener(listener); -} -/** - * Returns the BuildInfo information as String. The BuildInfo can - * be rebuilt from that String by calling parse(). - * @return java.lang.String - */ -public String asDataString() { - String result = getOutputMessageLevel() + "|" + getBuildFileName() + "|" + getTarget(); - for ( Enumeration e = getProjectTargets().elements(); e.hasMoreElements(); ) { - result = result + "|" + e.nextElement(); - } + // Support for bound properties + protected transient PropertyChangeSupport propertyChange; + + // thread for Ant build execution + private Thread buildThread; + + // the listener used to log output. + private BuildListener projectLogger; - return result; -} -/** - * Executes the target set by setTarget(). - * @param listener BuildListener for the output of the build - */ -public void executeProject( BuildListener listener ) { - Throwable error = null; - try { - if (!isProjectInitialized()) { - project = new Project(); - } - project.addBuildListener( listener ); - // Chris: HACK: replace when Ant-Refactoring is finished! -// project.fireBuildStarted(); - if (!isProjectInitialized()) { - initProject(); - } - project.executeTarget(target); - } catch (RuntimeException exc) { - error = exc; - throw exc; - } catch (Error err) { - error = err; - throw err; - } finally { - // Chris: HACK: replace when Ant-Refactoring is finished! -// project.fireBuildFinished(error); - project.removeBuildListener( listener ); - } -} - /** - * Search for the insert position to keep names a sorted list of Strings - * This method has been copied from org.apache.tools.ant.Main - */ - private static int findTargetPosition(Vector names, String name) { - int res = names.size(); - for (int i=0; i. + */ + +package org.apache.tools.ant.taskdefs.optional.ide; + + +import java.io.File; + +/** + * A Remote Access to Tools Servlet to extract package + * sets from the Workbench to the local file system. + * The following table describes the servlet parameters. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    ParameterValuesDescription
    dirAny valid directory name on the server.The directory to export the files to on the machine + * where the servlet is being run. If the directory + * doesn't exist, it will be created.

    + * Relative paths are relative to + * IBMVJava/ide/tools/com-ibm-ivj-toolserver, + * where IBMVJava is the VisualAge for Java installation + * directory.

    includeSee below.The pattern used to indicate which projects and + * packages to export.
    excludeSee belowThe pattern used to indicate which projects and + * packages not to export.
    cls"yes" or "no" (without the quotes)Export class files. Defaults to "no".
    src"yes" or "no" (without the quotes)Export source files. Defaults to "yes".
    res"yes" or "no" (without the quotes)Export resource files associated with the included project(s). + * Defaults to "yes".
    dex"yes" or "no" (without the quotes)Use the default exclusion patterns. Defaults to "yes". + * See below for an explanation of default excludes.
    owr"yes" or "no" (without the quotes)Overwrite any existing files. Defaults to "yes".
    + * + *

    The vajexport servlet uses include and exclude parameters to form + * the criteria for selecting packages to export. The parameter is + * broken up into ProjectName/packageNameSegments, where ProjectName + * is what you expect, and packageNameSegments is a partial (or complete) + * package name, separated by forward slashes, rather than periods. + * Each packageNameSegment can have wildcard characters.

    + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    Wildcard CharactersDescription
    *Match zero or more characters in that segment.
    ?Match one character in that segment.
    **Matches all characters in zero or more segments.
    + * + * @author Wolf Siberski, based on servlets written by Glenn McAllister + */ +public class VAJExportServlet extends VAJToolsServlet { + // constants for servlet param names + public static final String WITH_DEBUG_INFO = "deb"; + public static final String OVERWRITE_PARAM = "owr"; + + /** + * Respond to a request to export packages from the Workbench. + */ + protected void executeRequest() { + getUtil().exportPackages( + new File(getFirstParamValueString(DIR_PARAM)), + getParamValues(INCLUDE_PARAM), + getParamValues(EXCLUDE_PARAM), + getBooleanParam(CLASSES_PARAM, false), + getBooleanParam(WITH_DEBUG_INFO, false), + getBooleanParam(RESOURCES_PARAM, true), + getBooleanParam(SOURCES_PARAM, true), + getBooleanParam(DEFAULT_EXCLUDES_PARAM, true), + getBooleanParam(OVERWRITE_PARAM, true) + ); + } +} diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJImport.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJImport.java index a1f26dabf..5b100f533 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJImport.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJImport.java @@ -53,11 +53,6 @@ */ package org.apache.tools.ant.taskdefs.optional.ide; -import com.ibm.ivj.util.base.ImportCodeSpec; -import com.ibm.ivj.util.base.IvjException; -import com.ibm.ivj.util.base.Project; -import com.ibm.ivj.util.base.ProjectEdition; -import com.ibm.ivj.util.base.Type; import java.io.File; import java.util.Enumeration; import java.util.Vector; @@ -66,6 +61,8 @@ import org.apache.tools.ant.DirectoryScanner; import org.apache.tools.ant.Task; import org.apache.tools.ant.types.FileSet; +import java.lang.reflect.Field; + /** * Import source, class files, and resources to the Visual Age for Java * workspace using FileSets. @@ -95,7 +92,7 @@ import org.apache.tools.ant.types.FileSet; * Required * * - * vajproject + * project * the name of the Project to import to * Yes * @@ -119,221 +116,117 @@ import org.apache.tools.ant.types.FileSet; * * @author: Glenn McAllister, inspired by a similar task written by Peter Kelley */ -public class VAJImport extends Task { - protected Vector filesets = new Vector(); - protected boolean importSources = true; - protected boolean importResources = true; - protected boolean importClasses = false; - protected String importProject = null; - protected Project vajproject = null; - - /** - * The VisualAge for Java Project name to import into. - */ - public void setVajproject(String projectName) { - this.importProject = projectName; - } - - /** - * Adds a set of files (nested fileset attribute). - */ - public void addFileset(FileSet set) { - filesets.addElement(set); - } - - /** - * Import .class files. - */ - public void setImportClasses(boolean importClasses) { - this.importClasses = importClasses; - } - - /** - * Import resource files (anything that doesn't end in - * .class or .java) - */ - public void setImportResources(boolean importResources) { - this.importResources = importResources; - } - - /** - * Import .java files - */ - public void setImportSources(boolean importSources) { - this.importSources = importSources; - } - - /** - * Do the import. - */ - public void execute() throws BuildException { - if (filesets.size() == 0) { - throw new BuildException("At least one fileset is required!"); - } - - if (importProject == null || "".equals(importProject)) { - throw new BuildException("The VisualAge for Java Project name is required!"); - } - - vajproject = getVAJProject(); - if (vajproject == null) { - try { - vajproject = VAJUtil.getWorkspace().createProject(this.importProject, true); - } catch (IvjException e) { - throw VAJUtil.createBuildException( "Error while creating Project " + - importProject + ": ", - e ); - } - } - - for (Enumeration e = filesets.elements(); e.hasMoreElements();) { - importFileset((FileSet) e.nextElement()); - } - } - - /** - * Try to get the project we want from the Workspace. - */ - protected Project getVAJProject() { - Project found = null; - Project[] currentProjects = VAJUtil.getWorkspace().getProjects(); - - for (int i = 0; i < currentProjects.length; i++) { - Project p = currentProjects[i]; - if (p.getName().equals(this.importProject)) { - found = p; - break; - } - } - - return found; - } - - /** - * Import all files from the fileset into the Project in the - * Workspace. - */ - protected void importFileset(FileSet fileset) { - DirectoryScanner ds = fileset.getDirectoryScanner(this.project); - if (ds.getIncludedFiles().length == 0) { - return; - } - - Vector classes = new Vector(); - Vector sources = new Vector(); - Vector resources = new Vector(); - - String[] classesArr = null; - String[] sourcesArr = null; - String[] resourcesArr = null; - - StringBuffer msg = new StringBuffer(); - msg.append("Importing "); - String connector = ""; - - ImportCodeSpec importSpec = new ImportCodeSpec(); - importSpec.setDefaultProject(vajproject); - - scan( - fileset.getDir(this.project), - ds.getIncludedFiles(), - classes, - sources, - resources); - - if (importClasses) { - classesArr = new String[classes.size()]; - classes.copyInto(classesArr); - importSpec.setClassFiles(classesArr); - if (classesArr.length > 0) { - logFiles(classes, "class"); - msg.append( classesArr.length ); - msg.append( " class " ); - msg.append( classesArr.length > 1 ? "files" : "file" ); - connector = ", "; - } - } - - if (importSources) { - sourcesArr = new String[sources.size()]; - sources.copyInto(sourcesArr); - importSpec.setJavaFiles(sourcesArr); - if (sourcesArr.length > 0) { - logFiles(sources, "source"); - msg.append( connector ); - msg.append( sourcesArr.length ); - msg.append( " source " ); - msg.append( sourcesArr.length > 1 ? "files" : "file" ); - connector = ", "; - } - } - - if (importResources) { - String resourcePath = fileset.getDir(this.project).getAbsolutePath(); - resourcesArr = new String[resources.size()]; - resources.copyInto(resourcesArr); - importSpec.setResourcePath(resourcePath); - importSpec.setResourceFiles(resourcesArr); - if (resourcesArr.length > 0) { - logFiles(resources, "resource"); - log( " (relative to resource path '" + resourcePath + "')", - org.apache.tools.ant.Project.MSG_VERBOSE ); - - msg.append( connector ); - msg.append( resourcesArr.length ); - msg.append( " resource " ); - msg.append( resourcesArr.length > 1 ? "files" : "file" ); - } - } - - msg.append( " into the " ); - msg.append( importProject ); - msg.append( " project." ); - - log(msg.toString()); - - try { - Type[] importedTypes = VAJUtil.getWorkspace().importData(importSpec); - if (importedTypes == null) { - throw new BuildException("Unable to import into Workspace!"); - } - } catch (IvjException ivje) { - throw VAJUtil.createBuildException("Error while importing into Workspace: ", ivje); - } - } - - /** - * Sort the files into classes, sources, and resources. - */ - protected void scan( - File dir, - String[] files, - Vector classes, - Vector sources, - Vector resources) { - for (int i = 0; i < files.length; i++) { - String file = (new File(dir, files[i])).getAbsolutePath(); - if (file.endsWith(".java") || file.endsWith(".JAVA")) { - sources.addElement(file); - } else - if (file.endsWith(".class") || file.endsWith(".CLASS")) { - classes.addElement(file); - } else { - // for resources VA expects the path relative to the resource path - resources.addElement(files[i]); - } - } - } - - /** - * Logs a list of file names to the message log - * @param fileNames java.util.Vector file names to be logged - * @param type java.lang.String file type - */ - protected void logFiles(Vector fileNames, String fileType) { - log( fileType + " files found for import:", org.apache.tools.ant.Project.MSG_VERBOSE); - for ( Enumeration e = fileNames.elements(); e.hasMoreElements(); ) { - log( " " + e.nextElement(), org.apache.tools.ant.Project.MSG_VERBOSE ); - } - } -} +public class VAJImport extends VAJTask { + protected Vector filesets = new Vector(); + protected boolean importSources = true; + protected boolean importResources = true; + protected boolean importClasses = false; + protected String importProject = null; + protected boolean useDefaultExcludes = true; + + + /** + * The VisualAge for Java Project name to import into. + */ + public void setProject(String projectName) { + this.importProject = projectName; + } + + /** + * Adds a set of files (nested fileset attribute). + */ + public void addFileset(FileSet set) { + filesets.addElement(set); + } + + /** + * Import .class files. + */ + public void setImportClasses(boolean importClasses) { + this.importClasses = importClasses; + } + + /** + * Import resource files (anything that doesn't end in + * .class or .java) + */ + public void setImportResources(boolean importResources) { + this.importResources = importResources; + } + + /** + * Import .java files + */ + public void setImportSources(boolean importSources) { + this.importSources = importSources; + } + + /** + * Sets whether default exclusions should be used or not. + * + * @param useDefaultExcludes "true"|"on"|"yes" when default exclusions + * should be used, "false"|"off"|"no" when they + * shouldn't be used. + */ + public void setDefaultexcludes(boolean useDefaultExcludes) { + this.useDefaultExcludes = useDefaultExcludes; + } + + /** + * Do the import. + */ + public void execute() throws BuildException { + if (filesets.size() == 0) { + throw new BuildException("At least one fileset is required!"); + } + + if (importProject == null || "".equals(importProject)) { + throw new BuildException("The VisualAge for Java Project name is required!"); + } + + for (Enumeration e = filesets.elements(); e.hasMoreElements();) { + importFileset((FileSet) e.nextElement()); + } + } + + /** + * Import all files from the fileset into the Project in the + * Workspace. + */ + protected void importFileset(FileSet fileset) { + DirectoryScanner ds = fileset.getDirectoryScanner(this.project); + if (ds.getIncludedFiles().length == 0) { + return; + } + + String[] includes = null; + String[] excludes = null; + + // Hack to get includes and excludes. We could also use getIncludedFiles, + // but that would result in very long HTTP-requests. + // Therefore we want to send the patterns only to the remote tool server + // and let him figure out the files. + try { + Class directoryScanner = ds.getClass(); + + Field includesField = directoryScanner.getDeclaredField("includes"); + includesField.setAccessible(true); + includes = (String[]) includesField.get(ds); + + Field excludesField = directoryScanner.getDeclaredField("excludes"); + excludesField.setAccessible(true); + excludes = (String[]) excludesField.get(ds); + } catch (NoSuchFieldException nsfe) { + throw new BuildException( + "DirectoryScanner.includes or .excludes missing" + nsfe.getMessage()); + } catch (IllegalAccessException iae) { + throw new BuildException( + "Access to DirectoryScanner.includes or .excludes not allowed"); + } + + getUtil().importFiles( importProject, ds.getBasedir(), + includes, excludes, + importClasses, importResources, importSources, + useDefaultExcludes); + } +} \ No newline at end of file diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJImportServlet.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJImportServlet.java new file mode 100644 index 000000000..2655ef352 --- /dev/null +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJImportServlet.java @@ -0,0 +1,102 @@ +/* + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2001 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", "Tomcat", 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 + * . + */ + +package org.apache.tools.ant.taskdefs.optional.ide; + +import java.io.File; + + +/** + * A Remote Access to Tools Servlet to import a Project + * from files into the Repository. The following + * table describes the servlet parameters. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    ParameterDescription
    projectThe name of the project where you want the imported + * items to go. + *
    dirThe directory you want to import from.
    + * + * @author Wolf Siberski, based on servlets written by Glenn McAllister + */ +public class VAJImportServlet extends VAJToolsServlet { + /** + * Respond to a request to import files to the Repository + */ + protected void executeRequest() { + getUtil().importFiles( + getFirstParamValueString(PROJECT_NAME_PARAM), + new File(getFirstParamValueString(DIR_PARAM)), + getParamValues(INCLUDE_PARAM), + getParamValues(EXCLUDE_PARAM), + getBooleanParam(CLASSES_PARAM, false), + getBooleanParam(RESOURCES_PARAM, true), + getBooleanParam(SOURCES_PARAM, true), + false // no default excludes, because they + // are already added on client side + // getBooleanParam(DEFAULT_EXCLUDES_PARAM, true) + ); + } +} diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoad.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoad.java new file mode 100644 index 000000000..599b0e88e --- /dev/null +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoad.java @@ -0,0 +1,92 @@ +/* + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2001 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 + * . + */ + +package org.apache.tools.ant.taskdefs.optional.ide; + + +import java.util.Vector; + +/** + * Load specific project versions into the Visual Age for Java workspace. + * Each project and version name has to be specified completely. + * Example: + *
    + * <vajload> + *  <project name="MyVAProject" version="2.1"/> + *  <project name="Apache Xerces" version="1.2.0"/> + * </vajload> + *
    + * + * @author Wolf Siberski, TUI Infotec GmbH + */ + +public class VAJLoad extends VAJTask { + Vector projectDescriptions = new Vector(); + + /** + * Load specified projects. + */ + public void execute() { + getUtil().loadProjects( projectDescriptions ); + } + + /** + * Add a project description entry on the project list. + */ + public VAJProjectDescription createVAJProject() { + VAJProjectDescription d = new VAJProjectDescription(); + projectDescriptions.addElement(d); + return d; + } +} diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadProjects.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadProjects.java index 4f0fc37e1..a0676a159 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadProjects.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadProjects.java @@ -54,8 +54,8 @@ package org.apache.tools.ant.taskdefs.optional.ide; -import com.ibm.ivj.util.base.IvjException; -import com.ibm.ivj.util.base.ProjectEdition; + + import java.util.Enumeration; import java.util.Vector; import org.apache.tools.ant.BuildException; @@ -63,189 +63,23 @@ import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; /** - * Load specific project versions into the Visual Age for Java workspace. - * Each project and version name has to be specified completely. - * Example: - *
    - * <vajload> - *  <project name="MyVAProject" version="2.1"/> - *  <project name="Apache Xerces" version="1.2.0"/> - * </vajload> - *
    + * This is only there for backward compatibility with the default task list + * and will be removed soon * * @author Wolf Siberski, TUI Infotec GmbH */ -public class VAJLoadProjects extends Task { - Vector projectDescriptions = new Vector(); - Vector expandedProjectDescriptions = new Vector(); - - /** - * Class to maintain VisualAge for Java Workspace Project descriptions. - */ - public class VAJProjectDescription { - private String name; - private String version; - private boolean projectFound; - - public VAJProjectDescription() { - } - - public VAJProjectDescription(String n, String v) { - name = n; - version = v; - } - - public String getName() { - return name; - } - - public String getVersion() { - return version; - } - - public boolean projectFound() { - return projectFound; - } - - public void setName(String newName) { - if (newName == null || newName.equals("")) { - throw new BuildException("name attribute must be set"); - } - name = newName; - } - - public void setVersion(String newVersion) { - if (newVersion == null || newVersion.equals("")) { - throw new BuildException("version attribute must be set"); - } - version = newVersion; - } - - public void setProjectFound() { - projectFound = true; - } - } - - /** - * Add a project description entry on the project list. - */ - public VAJProjectDescription createVAJProject() { - VAJProjectDescription d = new VAJProjectDescription(); - projectDescriptions.addElement(d); - return d; - } - /** - * Load specified projects. - */ - public void execute() { - expandDescriptions(); - log( - "Loading " + expandedProjectDescriptions.size() + " project(s) into workspace"); - for (Enumeration e = expandedProjectDescriptions.elements(); - e.hasMoreElements(); - ) { - VAJProjectDescription d = (VAJProjectDescription) e.nextElement(); - - ProjectEdition pe = findProjectEdition(d.getName(), d.getVersion()); - try { - log( "Loading " + d.getName() + ", Version " + d.getVersion() + - ", into Workspace", - Project.MSG_VERBOSE ); - pe.loadIntoWorkspace(); - } catch (IvjException ex) { - throw VAJUtil.createBuildException( "Project " + d.getName() + - " could not be loaded.", - ex ); - } - } - } - - /** - */ - public void expandDescriptions() { - String[] projectNames; - try { - projectNames = VAJUtil.getWorkspace().getRepository().getProjectNames(); - } catch (IvjException e) { - throw VAJUtil.createBuildException("VA Exception occured: ", e); - } - - for (int i = 0; i < projectNames.length; i++) { - for (Enumeration e = projectDescriptions.elements(); e.hasMoreElements();) { - VAJProjectDescription d = (VAJProjectDescription) e.nextElement(); - String pattern = d.getName(); - if (VAJWorkspaceScanner.match(pattern, projectNames[i])) { - d.setProjectFound(); - expandedProjectDescriptions. - addElement(new VAJProjectDescription(projectNames[i], d.getVersion())); - break; - } - } - } - - for (Enumeration e = projectDescriptions.elements(); e.hasMoreElements();) { - VAJProjectDescription d = (VAJProjectDescription) e.nextElement(); - if (!d.projectFound()) { - log("No Projects match the name " + d.getName(), Project.MSG_WARN); - } - } - } - - /** - */ - public static Vector findMatchingProjects(String pattern) { - String[] projectNames; - try { - projectNames = VAJUtil.getWorkspace().getRepository().getProjectNames(); - } catch (IvjException e) { - throw VAJUtil.createBuildException("VA Exception occured: ", e); - } - - Vector matchingProjects = new Vector(); - for (int i = 0; i < projectNames.length; i++) { - if (VAJWorkspaceScanner.match(pattern, projectNames[i])) { - matchingProjects.addElement(projectNames[i]); - } - } - - return matchingProjects; - } - - /** - * Finds a specific project edition in the repository. - * - * @param name project name - * @param versionName project version name - * @return com.ibm.ivj.util.base.ProjectEdition - */ - public static ProjectEdition findProjectEdition( - String name, - String versionName) { - try { - ProjectEdition[] editions = null; - editions = VAJUtil.getWorkspace().getRepository().getProjectEditions(name); - - if (editions == null) { - throw new BuildException("Project " + name + " doesn't exist"); - } - - ProjectEdition pe = null; - - for (int i = 0; i < editions.length && pe == null; i++) { - if (versionName.equals(editions[i].getVersionName())) { - pe = editions[i]; - } - } - if (pe == null) { - throw new BuildException( "Version " + versionName + " of Project " + - name + " doesn't exist" ); - } - return pe; - - } catch (IvjException e) { - throw VAJUtil.createBuildException("VA Exception occured: ", e); - } - - } +public class VAJLoadProjects extends VAJLoad { } + + + + + + + + + + + + diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadServlet.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadServlet.java new file mode 100644 index 000000000..e8d44a15e --- /dev/null +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadServlet.java @@ -0,0 +1,106 @@ +/* + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2001 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", "Tomcat", 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 + * . + */ + +package org.apache.tools.ant.taskdefs.optional.ide; + +import java.util.Vector; + +/** + * A Remote Access to Tools Servlet to load a Project + * from the Repository into the Workbench. The following + * table describes the servlet parameters. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    ParameterDescription
    projectThe name of the Project you want to load into + * the Workbench.
    versionThe version of the package you want to load into + * the Workbench.
    + * + * @author Wolf Siberski, based on servlets written by Glenn McAllister + */ +public class VAJLoadServlet extends VAJToolsServlet { + + // constants for servlet param names + public static final String VERSION_PARAM = "version"; + + /** + * Respond to a request to load a project from the Repository + * into the Workbench. + */ + protected void executeRequest() { + String[] projectNames = getParamValues(PROJECT_NAME_PARAM); + String[] versionNames = getParamValues(VERSION_PARAM); + + Vector projectDescriptions = new Vector(projectNames.length); + for (int i = 0; i < projectNames.length && i < versionNames.length; i++) { + VAJProjectDescription desc = new VAJProjectDescription(); + desc.setName(projectNames[i]); + desc.setVersion(versionNames[i]); + projectDescriptions.addElement(desc); + } + + util.loadProjects(projectDescriptions); + } +} diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLocalUtil.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLocalUtil.java new file mode 100644 index 000000000..6a5f5591d --- /dev/null +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLocalUtil.java @@ -0,0 +1,465 @@ +/* + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2001 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 + * . + */ + +package org.apache.tools.ant.taskdefs.optional.ide; + + +import java.util.Vector; +import java.util.Enumeration; +import java.io.File; + +import com.ibm.ivj.util.base.*; +import com.ibm.ivj.util.base.Package; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.DirectoryScanner; + + +/** + * Helper class for VAJ tasks. Holds Workspace singleton and + * wraps IvjExceptions into BuildExceptions + * + * @author Wolf Siberski, TUI Infotec GmbH + */ +abstract class VAJLocalUtil implements VAJUtil{ + // singleton containing the VAJ workspace + static private Workspace workspace; + + /** + * Wraps IvjException into a BuildException + * + * @return org.apache.tools.ant.BuildException + * @param errMsg Additional error message + * @param e IvjException which is wrapped + */ + static BuildException createBuildException( + String errMsg, IvjException e) { + errMsg = errMsg + "\n" + e.getMessage(); + String[] errors = e.getErrors(); + if (errors != null) { + for (int i = 0; i < errors.length; i++) { + errMsg = errMsg + "\n" + errors[i]; + } + } + return new BuildException(errMsg); + } + + /** + * returns the current VAJ workspace. + * @return com.ibm.ivj.util.base.Workspace + */ + static Workspace getWorkspace() { + if (workspace == null) { + workspace = ToolEnv.connectToWorkspace(); + if (workspace == null) { + throw new BuildException( + "Unable to connect to Workspace! " + + "Make sure you are running in VisualAge for Java."); + } + } + + return workspace; + } + + + //----------------------------------------------------------- + // export + //----------------------------------------------------------- + + /** + * export packages + */ + public void exportPackages( + File dest, + String[] includePatterns, String[] excludePatterns, + boolean exportClasses, boolean exportDebugInfo, + boolean exportResources, boolean exportSources, + boolean useDefaultExcludes, boolean overwrite) { + if (includePatterns == null || includePatterns.length == 0) { + log( "You must specify at least one include attribute. " + + "Not exporting", MSG_ERR); + } else { + try { + VAJWorkspaceScanner scanner = new VAJWorkspaceScanner(); + scanner.setIncludes(includePatterns); + scanner.setExcludes(excludePatterns); + if (useDefaultExcludes) { + scanner.addDefaultExcludes(); + } + scanner.scan(); + + Package[] packages = scanner.getIncludedPackages(); + + log( "Exporting " + packages.length + " package(s) to " + + dest, MSG_INFO); + for (int i = 0; i < packages.length; i++) { + log(" " + packages[i].getName(), MSG_VERBOSE); + } + + ExportCodeSpec exportSpec = new ExportCodeSpec(); + exportSpec.setPackages(packages); + exportSpec.includeJava(exportSources); + exportSpec.includeClass(exportClasses); + exportSpec.includeResources(exportResources); + exportSpec.includeClassDebugInfo(exportDebugInfo); + exportSpec.useSubdirectories(true); + exportSpec.overwriteFiles(overwrite); + exportSpec.setExportDirectory(dest.getAbsolutePath()); + + getWorkspace().exportData(exportSpec); + } catch (IvjException ex) { + throw createBuildException("Exporting failed!", ex); + } + } + } + + + //----------------------------------------------------------- + // load + //----------------------------------------------------------- + + /** + * Load specified projects. + */ + public void loadProjects( Vector projectDescriptions ) { + Vector expandedDescs = getExpandedDescriptions(projectDescriptions); + + // output warnings for projects not found + for (Enumeration e = projectDescriptions.elements(); e.hasMoreElements();) { + VAJProjectDescription d = (VAJProjectDescription) e.nextElement(); + if (!d.projectFound()) { + log("No Projects match the name " + d.getName(), MSG_WARN); + } + } + + log( "Loading " + expandedDescs.size() + + " project(s) into workspace", MSG_INFO); + + for (Enumeration e = expandedDescs.elements(); + e.hasMoreElements(); ) { + VAJProjectDescription d = (VAJProjectDescription) e.nextElement(); + + ProjectEdition pe = findProjectEdition(d.getName(), d.getVersion()); + try { + log( "Loading '" + d.getName() + "', Version '" + d.getVersion() + + "', into Workspace", MSG_VERBOSE ); + pe.loadIntoWorkspace(); + } catch (IvjException ex) { + throw createBuildException( "Project '" + d.getName() + + "' could not be loaded.", ex ); + } + } + } + + /** + * returns a list of project names matching the given pattern + */ + private Vector findMatchingProjects(String pattern) { + String[] projectNames; + try { + projectNames = getWorkspace().getRepository().getProjectNames(); + } catch (IvjException e) { + throw createBuildException("VA Exception occured: ", e); + } + + Vector matchingProjects = new Vector(); + for (int i = 0; i < projectNames.length; i++) { + if (VAJWorkspaceScanner.match(pattern, projectNames[i])) { + matchingProjects.addElement(projectNames[i]); + } + } + + return matchingProjects; + } + + + /** + * return project descriptions containing full project names instead + * of patterns with wildcards. + */ + private Vector getExpandedDescriptions(Vector projectDescs) { + Vector expandedDescs = new Vector(projectDescs.size()); + try { + String[] projectNames = + getWorkspace().getRepository().getProjectNames(); + for (int i = 0; i < projectNames.length; i++) { + for (Enumeration e = projectDescs.elements(); + e.hasMoreElements();) { + VAJProjectDescription d = (VAJProjectDescription) e.nextElement(); + String pattern = d.getName(); + if (VAJWorkspaceScanner.match(pattern, projectNames[i])) { + d.setProjectFound(); + expandedDescs.addElement(new VAJProjectDescription( + projectNames[i], d.getVersion())); + break; + } + } + } + } catch (IvjException e) { + throw createBuildException("VA Exception occured: ", e); + } + + return expandedDescs; + } + + /** + * Finds a specific project edition in the repository. + * + * @param name project name + * @param versionName project version name + * @return com.ibm.ivj.util.base.ProjectEdition the specified edition + */ + private ProjectEdition findProjectEdition( + String name, String versionName) { + try { + ProjectEdition[] editions = null; + editions = getWorkspace().getRepository().getProjectEditions(name); + + if (editions == null) { + throw new BuildException("Project " + name + " doesn't exist"); + } + + ProjectEdition pe = null; + for (int i = 0; i < editions.length && pe == null; i++) { + if (versionName.equals(editions[i].getVersionName())) { + pe = editions[i]; + } + } + if (pe == null) { + throw new BuildException( "Version " + versionName + + " of Project " + name + " doesn't exist" ); + } + return pe; + + } catch (IvjException e) { + throw createBuildException("VA Exception occured: ", e); + } + + } + + + + //----------------------------------------------------------- + // import + //----------------------------------------------------------- + + + /** + * Do the import. + */ + public void importFiles( + String importProject, File srcDir, + String[] includePatterns, String[] excludePatterns, + boolean importClasses, boolean importResources, + boolean importSources, boolean useDefaultExcludes) + throws BuildException { + + if (importProject == null || "".equals(importProject)) { + throw new BuildException("The VisualAge for Java project " + + "name is required!"); + } + + ImportCodeSpec importSpec = new ImportCodeSpec(); + importSpec.setDefaultProject(getVAJProject(importProject)); + + DirectoryScanner ds = new DirectoryScanner(); + ds.setBasedir(srcDir); + ds.setIncludes(includePatterns); + ds.setExcludes(excludePatterns); + if ( useDefaultExcludes ) { + ds.addDefaultExcludes(); + } + ds.scan(); + + Vector classes = new Vector(); + Vector sources = new Vector(); + Vector resources = new Vector(); + + scanForImport( srcDir, ds.getIncludedFiles(), classes, sources, resources); + + StringBuffer summaryLog = new StringBuffer("Importing "); + addFilesToImport( importSpec, importClasses, classes, "Class", summaryLog ); + addFilesToImport( importSpec, importSources, sources, "Java", summaryLog ); + addFilesToImport( importSpec, importResources, resources, "Resource", summaryLog ); + importSpec.setResourcePath(srcDir.getAbsolutePath()); + + summaryLog.append( " into the project '" ); + summaryLog.append( importProject ); + summaryLog.append( "'." ); + + log(summaryLog.toString(), MSG_INFO); + + try { + Type[] importedTypes = getWorkspace().importData(importSpec); + if (importedTypes == null) { + throw new BuildException("Unable to import into Workspace!"); + } + else { + log( importedTypes.length + " types imported", MSG_DEBUG); + for( int i = 0; i < importedTypes.length; i++ ) { + log( importedTypes[i].getPackage().getName() + + "." + importedTypes[i].getName() + + " into " + importedTypes[i].getProject().getName(), + MSG_DEBUG); + } + } + } catch (IvjException ivje) { + throw createBuildException("Error while importing into workspace: ", + ivje); + } + } + + /** + * get a project from the Workspace. + */ + static Project getVAJProject(String importProject) { + Project found = null; + Project[] currentProjects = getWorkspace().getProjects(); + + for (int i = 0; i < currentProjects.length; i++) { + Project p = currentProjects[i]; + if (p.getName().equals(importProject)) { + found = p; + break; + } + } + + + if (found == null) { + try { + found = getWorkspace().createProject(importProject, true); + } catch (IvjException e) { + throw createBuildException( "Error while creating Project " + + importProject + ": ", e ); + } + } + + return found; + } + + + /** + * Sort the files into classes, sources, and resources. + */ + private void scanForImport( + File dir, + String[] files, + Vector classes, + Vector sources, + Vector resources) { + for (int i = 0; i < files.length; i++) { + String file = (new File(dir, files[i])).getAbsolutePath(); + if (file.endsWith(".java") || file.endsWith(".JAVA")) { + sources.addElement(file); + } else + if (file.endsWith(".class") || file.endsWith(".CLASS")) { + classes.addElement(file); + } else { + // for resources VA expects the path relative to the resource path + resources.addElement(files[i]); + } + } + } + + /** + * Adds files to an import specification. Helper method + * for importFiles() + * + * @param spec import specification + * @param doImport only add files if doImport is true + * @param files the files to add + * @param fileType type of files (Source/Class/Resource) + * @param summaryLog buffer for logging + */ + private void addFilesToImport( + ImportCodeSpec spec, boolean doImport, + Vector files, String fileType, + StringBuffer summaryLog) + { + + if (doImport) { + String[] fileArr = new String[files.size()]; + files.copyInto(fileArr); + try { + // here it is assumed that fileType is one of the + // following strings: // "Java", "Class", "Resource" + String methodName = "set"+fileType+"Files"; + Class[] methodParams = new Class[]{fileArr.getClass()}; + java.lang.reflect.Method method = + spec.getClass().getDeclaredMethod( methodName, methodParams); + method.invoke(spec, new Object[]{fileArr}); + } catch( Exception e ) { + throw new BuildException( e ); + } + if (files.size() > 0) { + logFiles(files, fileType ); + summaryLog.append(files.size()); + summaryLog.append(" " + fileType.toLowerCase() + " file"); + summaryLog.append(files.size() > 1 ? "s, " : ", "); + } + } + } + + /** + * Logs a list of file names to the message log + * @param fileNames java.util.Vector file names to be logged + * @param type java.lang.String file type + */ + private void logFiles(Vector fileNames, String fileType) { + log( fileType + " files found for import:", MSG_VERBOSE); + for ( Enumeration e = fileNames.elements(); e.hasMoreElements(); ) { + log( " " + e.nextElement(), MSG_VERBOSE ); + } + } +} diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJProjectDescription.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJProjectDescription.java new file mode 100644 index 000000000..f30b16788 --- /dev/null +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJProjectDescription.java @@ -0,0 +1,105 @@ +/* + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2001 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 + * . + */ + +package org.apache.tools.ant.taskdefs.optional.ide; + +import org.apache.tools.ant.BuildException; + +/** + * Type class. Holds information about a project edition. + * @author: Wolf Siberski + */ +public class VAJProjectDescription { + private String name; + private String version; + private boolean projectFound; + + public VAJProjectDescription() { + } + + public VAJProjectDescription(String n, String v) { + name = n; + version = v; + } + + public String getName() { + return name; + } + + public String getVersion() { + return version; + } + + public boolean projectFound() { + return projectFound; + } + + public void setName(String newName) { + if (newName == null || newName.equals("")) { + throw new BuildException("name attribute must be set"); + } + name = newName; + } + + public void setVersion(String newVersion) { + if (newVersion == null || newVersion.equals("")) { + throw new BuildException("version attribute must be set"); + } + version = newVersion; + } + + public void setProjectFound() { + projectFound = true; + } +} diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJRemoteUtil.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJRemoteUtil.java new file mode 100644 index 000000000..f272ad53a --- /dev/null +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJRemoteUtil.java @@ -0,0 +1,250 @@ +/* + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2001 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 + * . + */ + +package org.apache.tools.ant.taskdefs.optional.ide; + +import java.util.Vector; +import java.net.URLConnection; +import java.net.HttpURLConnection; +import java.util.Enumeration; +import java.net.URL; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.InputStream; +import java.io.File; + +/** + * Helper class for VAJ tasks. Holds Workspace singleton and + * wraps IvjExceptions into BuildExceptions + * + * @author Wolf Siberski, TUI Infotec GmbH + */ +class VAJRemoteUtil implements VAJUtil{ + // calling task + Task caller; + + // VAJ remote tool server + String remoteServer; + + public VAJRemoteUtil( Task caller, String remote ) { + this.caller = caller; + this.remoteServer = remote; + } + + /** + * export the array of Packages + */ + public void exportPackages(File destDir, + String[] includePatterns, String[] excludePatterns, + boolean exportClasses, boolean exportDebugInfo, boolean exportResources, + boolean exportSources, boolean useDefaultExcludes, boolean overwrite ) { + try { + String request = "http://" + remoteServer + "/servlet/vajexport?" + + VAJExportServlet.WITH_DEBUG_INFO + "=" + exportDebugInfo + "&" + + VAJExportServlet.OVERWRITE_PARAM + "=" + overwrite + "&" + + assembleImportExportParams( destDir, + includePatterns, excludePatterns, + exportClasses, exportResources, + exportSources, useDefaultExcludes ); + sendRequest( request); + } catch (Exception ex) { + throw new BuildException(ex); + } + } + + /** + * Do the import. + */ + public void importFiles( + String importProject, File srcDir, + String[] includePatterns, String[] excludePatterns, + boolean importClasses, boolean importResources, + boolean importSources, boolean useDefaultExcludes) { + try { + String request = "http://" + remoteServer + "/servlet/vajimport?" + + VAJImportServlet.PROJECT_NAME_PARAM + "=" + + importProject + "&" + + assembleImportExportParams( srcDir, + includePatterns, excludePatterns, + importClasses, importResources, + importSources, useDefaultExcludes ); + sendRequest( request); + } catch (Exception ex) { + throw new BuildException(ex); + } + + } + + /** + * Assemble string for parameters common for import and export + * Helper method to remove double code. + */ + private String assembleImportExportParams( + File dir, + String[] includePatterns, String[] excludePatterns, + boolean includeClasses, boolean includeResources, + boolean includeSources, boolean useDefaultExcludes) { + String result = + VAJToolsServlet.DIR_PARAM + "=" + + dir.getAbsolutePath().replace('\\', '/') + "&" + + VAJToolsServlet.CLASSES_PARAM + "=" + includeClasses + "&" + + VAJToolsServlet.RESOURCES_PARAM + "=" + includeResources + "&" + + VAJToolsServlet.SOURCES_PARAM + "=" + includeSources + "&" + + VAJToolsServlet.DEFAULT_EXCLUDES_PARAM + "=" + useDefaultExcludes; + + if ( includePatterns != null ) { + for ( int i = 0; i < includePatterns.length; i++ ){ + result= result + "&" + VAJExportServlet.INCLUDE_PARAM + "=" + + includePatterns[i].replace(' ', '+').replace('\\', '/'); + } + } + if ( excludePatterns != null ) { + for ( int i = 0; i < excludePatterns.length; i++ ){ + result = result + "&" + VAJExportServlet.EXCLUDE_PARAM + "=" + + excludePatterns[i].replace(' ', '+').replace('\\', '/'); + } + } + + return result; + } + + /** + * Load specified projects. + */ + public void loadProjects( Vector projectDescriptions) { + try { + String request = "http://" + remoteServer + "/servlet/vajload?"; + String delimiter = ""; + for ( Enumeration e = projectDescriptions.elements(); e.hasMoreElements(); ){ + VAJProjectDescription pd = (VAJProjectDescription)e.nextElement(); + request = request + + delimiter + VAJLoadServlet.PROJECT_NAME_PARAM + + "=" + pd.getName().replace(' ', '+') + + "&" + VAJLoadServlet.VERSION_PARAM + + "=" + pd.getVersion().replace(' ', '+'); + //the first param needs no delimiter, but all other + delimiter = "&"; + } + sendRequest( request); + } catch (Exception ex) { + throw new BuildException(ex); + } + } + + /** + * logs a message. + */ + public void log(String msg, int level) { + caller.log( msg, level ); + } + + /** + * Sends a servlet request. + */ + private void sendRequest(String request) { + boolean requestFailed = false; + try { + log("Request: " + request, MSG_DEBUG); + + //must be HTTP connection + URL requestUrl = new URL( request ); + HttpURLConnection connection = + (HttpURLConnection) requestUrl.openConnection(); + + InputStream is = null; + // retry three times + for (int i = 0; i < 3; i++) { + try { + is = connection.getInputStream(); + break; + } catch (IOException ex) { + } + } + if (is == null) { + log("Can't get " + request, MSG_ERR); + throw new BuildException("Couldn't execute " + request ); + } + + // log the response + BufferedReader br = new BufferedReader( new InputStreamReader( is ) ); + String line = br.readLine(); + while ( line != null ) { + int level = MSG_ERR; + try { + // the first char of each line contains the log level + level = Integer.parseInt( line.substring(0,1) ); + if ( level == MSG_ERR ) { + requestFailed = true; + } + } catch ( Exception e ) { + log( "Response line doesn't contain log level!", MSG_ERR ); + } + log( line.substring(2), level ); + line = br.readLine(); + } + + } catch (IOException ex) { + log("Error sending tool request to VAJ" + ex, MSG_ERR); + throw new BuildException("Couldn't execute " + request ); + } + if ( requestFailed ) { + throw new BuildException( "VAJ tool request failed" ); + } + } +} diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJTask.java new file mode 100644 index 000000000..158a067a3 --- /dev/null +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJTask.java @@ -0,0 +1,103 @@ +/* + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2001 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 + * . + */ + +package org.apache.tools.ant.taskdefs.optional.ide; + +/** + * Super class for all VAJ tasks. Contains common + * attributes (remoteServer) and util methods + * + * @author: Wolf Siberski + */ +import org.apache.tools.ant.Task; + + +public class VAJTask extends Task { + /** + * Adaption of VAJLocalUtil to Task context. + */ + class VAJLocalToolUtil extends VAJLocalUtil { + public void log(String msg, int level) { + VAJTask.this.log( msg, level ); + } + } + + // server name / port of VAJ remote tool api server + protected String remoteServer = null; + + // holds the appropriate VAJUtil implementation + private VAJUtil util = null; + + + /** + * returns the VAJUtil implementation + */ + protected VAJUtil getUtil() { + if ( util == null ) { + if ( remoteServer == null ) { + util = new VAJLocalToolUtil(); + } else { + util = new VAJRemoteUtil( this, remoteServer ); + } + } + return util; + } + + /** + * Set remote server attribute + */ + public void setRemote(String remoteServer) { + this.remoteServer = remoteServer; + } +} diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJToolsServlet.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJToolsServlet.java new file mode 100644 index 000000000..4855d0d12 --- /dev/null +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJToolsServlet.java @@ -0,0 +1,226 @@ +/* + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2001 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", "Tomcat", 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 + * . + */ + +package org.apache.tools.ant.taskdefs.optional.ide; + +import com.ibm.ivj.toolserver.servletclasses.servlet.*; +import com.ibm.ivj.toolserver.servletclasses.servlet.http.*; +import java.io.*; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.ServletException; + +import org.apache.tools.ant.BuildException; + +/** + * Abstract base class to provide common services for the + * VAJ tool API servlets + * + * @author Wolf Siberski, based on servlets written by Glenn McAllister + */ +public abstract class VAJToolsServlet extends HttpServlet { + /** + * Adaptation of VAJUtil for servlet context. + */ + class VAJLocalServletUtil extends VAJLocalUtil { + public void log(String msg, int level) { + try { + if ( msg != null ) { + msg = msg.replace('\r', ' '); + int i = 0; + while ( i < msg.length() ) { + int nlPos = msg.indexOf('\n', i); + if ( nlPos == -1 ) { + nlPos = msg.length(); + } + response.getWriter().println( Integer.toString(level) + + " " + msg.substring( i, nlPos )); + i = nlPos + 1; + } + } + } catch( IOException e ) { + throw new BuildException( "logging failed. msg was: " + + e.getMessage() ); + } + } + } + + // constants for servlet param names + public static final String DIR_PARAM = "dir"; + public static final String INCLUDE_PARAM = "include"; + public static final String EXCLUDE_PARAM = "exclude"; + public static final String CLASSES_PARAM = "cls"; + public static final String SOURCES_PARAM = "src"; + public static final String RESOURCES_PARAM = "res"; + public static final String DEFAULT_EXCLUDES_PARAM = "dex"; + public static final String PROJECT_NAME_PARAM = "project"; + + + // current request + HttpServletRequest request; + + // response to current request + HttpServletResponse response; + + // implementation of VAJUtil used by the servlet + VAJUtil util; + + + /** + * Execute the request by calling the appropriate + * VAJ tool API methods. This method must be implemented + * by the concrete servlets + */ + protected abstract void executeRequest(); + + /** + * Respond to a HTTP request. This method initializes + * the servlet and handles errors. + * The real work is done in the abstract method executeRequest() + */ + public void doGet(HttpServletRequest req, HttpServletResponse res) + throws ServletException, IOException { + try { + response = res; + request = req; + initRequest(); + executeRequest(); + } catch( BuildException e ) { + util.log("Error occured: " + e.getMessage(), VAJUtil.MSG_ERR); + } catch( Exception e ) { + try { + if ( ! (e instanceof BuildException) ) { + StringWriter sw = new StringWriter(); + e.printStackTrace(new PrintWriter(sw)); + String trace = new String( sw.getBuffer() ); + util.log("Program error in " + this.getClass().getName() + + ":\n" + trace, VAJUtil.MSG_ERR); + } + } catch( Throwable t ) { + t.printStackTrace(); + } finally { + if ( ! (e instanceof BuildException) ) + { + throw new ServletException( e.getMessage() ); + } + } + } + } + + /** + * initialize the servlet. + */ + protected void initRequest() throws IOException { + response.setContentType("text/ascii"); + if ( util == null ) { + util = new VAJLocalServletUtil(); + } + } + + /** + * Get the VAJUtil implementation + */ + VAJUtil getUtil() { + return util; + } + + /** + * Get the boolean value of a parameter. + */ + protected boolean getBooleanParam(String param) { + return getBooleanParam(param, false); + } + + /** + * Get the boolean value of a parameter, with a default value if + * the parameter hasn't been passed to the servlet. + */ + protected boolean getBooleanParam(String param, boolean defaultValue) { + String value = getFirstParamValueString(param); + if (value != null) { + return toBoolean(value); + } else { + return defaultValue; + } + } + + /** + * Returns the first encountered value for a parameter. + */ + protected String getFirstParamValueString(String param) { + String[] paramValuesArray = request.getParameterValues(param); + if (paramValuesArray == null) { + return null; + } + return paramValuesArray[0]; + } + + /** + * Returns all values for a parameter. + */ + protected String[] getParamValues(String param) { + return request.getParameterValues(param); + } + + /** + * A utility method to translate the strings "yes", "true", and "ok" + * to boolean true, and everything else to false. + */ + protected boolean toBoolean(String string) { + String lower = string.toLowerCase(); + return (lower.equals("yes") || lower.equals("true") || lower.equals("ok")); + } +} diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJUtil.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJUtil.java index c83d0c267..75fe8e4e5 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJUtil.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJUtil.java @@ -51,58 +51,52 @@ * information on the Apache Software Foundation, please see * . */ -package org.apache.tools.ant.taskdefs.optional.ide; +package org.apache.tools.ant.taskdefs.optional.ide; -import com.ibm.ivj.util.base.IvjException; -import com.ibm.ivj.util.base.ToolEnv; -import com.ibm.ivj.util.base.Workspace; -import org.apache.tools.ant.BuildException; +import java.util.Vector; +import java.io.File; /** - * Helper class for VAJ tasks. Holds Workspace singleton and - * wraps IvjExceptions into BuildExceptions + * Helper interface for VAJ tasks. Encapsulates + * the interface to the VAJ tool API. * * @author Wolf Siberski, TUI Infotec GmbH */ -class VAJUtil { - static private Workspace workspace; - - /** - * Wraps IvjException into a BuildException - * - * @return org.apache.tools.ant.BuildException - * @param errMsg Additional error message - * @param e IvjException which is wrapped - */ - public static BuildException createBuildException( - String errMsg, - IvjException e) { - errMsg = errMsg + "\n" + e.getMessage(); - String[] errors = e.getErrors(); - if (errors != null) { - for (int i = 0; i < errors.length; i++) { - errMsg = errMsg + "\n" + errors[i]; - } - } - return new BuildException(errMsg); - } - - /** - * Insert the method's description here. - * Creation date: (19.09.2000 13:41:21) - * @return com.ibm.ivj.util.base.Workspace - */ - public static Workspace getWorkspace() { - if (workspace == null) { - workspace = ToolEnv.connectToWorkspace(); - if (workspace == null) { - throw new BuildException( - "Unable to connect to Workspace! " - + "Make sure you are running in VisualAge for Java."); - } - } +interface VAJUtil { + // log levels + public static final int MSG_DEBUG = 4; + public static final int MSG_ERR = 0; + public static final int MSG_INFO = 2; + public static final int MSG_VERBOSE = 3; + public static final int MSG_WARN = 1; + + /** + * export the array of Packages + */ + void exportPackages( + File dest, + String[] includePatterns, String[] excludePatterns, + boolean exportClasses, boolean exportDebugInfo, + boolean exportResources, boolean exportSources, + boolean useDefaultExcludes, boolean overwrite); + + /** + * Do the import. + */ + void importFiles( + String importProject, File srcDir, + String[] includePatterns, String[] excludePatterns, + boolean importClasses, boolean importResources, + boolean importSources, boolean useDefaultExcludes); + + /** + * Load specified projects. + */ + void loadProjects(Vector projectDescriptions); - return workspace; - } + /** + * Logs a message with the specified log level. + */ + void log(String msg, int level); } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJWorkspaceScanner.java b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJWorkspaceScanner.java index 134814577..faec26d5b 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJWorkspaceScanner.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJWorkspaceScanner.java @@ -85,13 +85,9 @@ import org.apache.tools.ant.DirectoryScanner; * * @author Wolf Siberski, TUI Infotec (based on Arnout J. Kuipers DirectoryScanner) */ -public class VAJWorkspaceScanner extends DirectoryScanner { +class VAJWorkspaceScanner extends DirectoryScanner { - /** - * Patterns that should be excluded by default. - * - * @see #addDefaultExcludes() - */ + // Patterns that should be excluded by default. private final static String[] DEFAULTEXCLUDES = { "IBM*/**", @@ -101,10 +97,8 @@ public class VAJWorkspaceScanner extends DirectoryScanner { "VisualAge*/**", }; - /** - * The packages that where found and matched at least one includes, and - * matched no excludes. - */ + // The packages that where found and matched at least + // one includes, and matched no excludes. private Vector packagesIncluded = new Vector(); /** @@ -119,18 +113,19 @@ public class VAJWorkspaceScanner extends DirectoryScanner { } for (int i = 0; i < DEFAULTEXCLUDES.length; i++) { newExcludes[i + excludesLength] = DEFAULTEXCLUDES[i]. - replace( '/', File.separatorChar ).replace( '\\', File.separatorChar ); + replace( '/', File.separatorChar ). + replace( '\\', File.separatorChar ); } excludes = newExcludes; } - + /** * Finds all Projects specified in include patterns. * * @return the projects */ public Vector findMatchingProjects() { - Project[] projects = VAJUtil.getWorkspace().getProjects(); + Project[] projects = VAJLocalUtil.getWorkspace().getProjects(); Vector matchingProjects = new Vector(); @@ -138,7 +133,8 @@ public class VAJWorkspaceScanner extends DirectoryScanner { for (int i = 0; i < projects.length; i++) { Project project = projects[i]; for (int j = 0; j < includes.length && !allProjectsMatch; j++) { - StringTokenizer tok = new StringTokenizer(includes[j], File.separator); + StringTokenizer tok = + new StringTokenizer(includes[j], File.separator); String projectNamePattern = tok.nextToken(); if (projectNamePattern.equals("**")) { // if an include pattern starts with '**', @@ -161,7 +157,7 @@ public class VAJWorkspaceScanner extends DirectoryScanner { return matchingProjects; } - + /** * Get the names of the packages that matched at least one of the include * patterns, and didn't match one of the exclude patterns. @@ -176,7 +172,7 @@ public class VAJWorkspaceScanner extends DirectoryScanner { } return packages; } - + /** * Matches a string against a pattern. The pattern contains two special * characters: @@ -193,6 +189,7 @@ public class VAJWorkspaceScanner extends DirectoryScanner { protected static boolean match(String pattern, String str) { return DirectoryScanner.match(pattern, str); } + /** * Scans the workspace for packages that match at least one include * pattern, and don't match any exclude patterns. @@ -215,7 +212,7 @@ public class VAJWorkspaceScanner extends DirectoryScanner { scanProject(project); } } - + /** * Scans a project for packages that match at least one include * pattern, and don't match any exclude patterns. @@ -240,7 +237,7 @@ public class VAJWorkspaceScanner extends DirectoryScanner { } } } catch (IvjException e) { - throw VAJUtil.createBuildException("VA Exception occured: ", e); + throw VAJLocalUtil.createBuildException("VA Exception occured: ", e); } } }