[jboss-cvs] JBossAS SVN: r82303 - in projects/aop/trunk/aophelper: src/main/java/org/jboss/aophelper/core and 12 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Dec 16 04:13:20 EST 2008
Author: stalep
Date: 2008-12-16 04:13:19 -0500 (Tue, 16 Dec 2008)
New Revision: 82303
Added:
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperUiMediator.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/xml/AntBuildCreator.java
Removed:
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/CompileMediator.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/RunMediator.java
Modified:
projects/aop/trunk/aophelper/.classpath
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopBaseSettings.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopHandler.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopOption.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopRun.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/manager/CompileManager.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/manager/RunManager.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperFrame.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperMediator.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperMenuBar.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/OutputPane.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathTablePane.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/options/CompileOptionsPane.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlTablePane.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/RunOutputPane.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/classpath/RunClasspathTablePane.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/options/RunOptionsPane.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/xml/RunXmlTablePane.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/AopCompileCommand.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/AopRunCommand.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/xml/BaseConfigParser.java
Log:
[JBAOP-538]
Rewritten most of the "backend" logic. No difference between compile and run mode
internally. Needs more cleanup.
Added support for generating an ant buildfile from the settings.
Modified: projects/aop/trunk/aophelper/.classpath
===================================================================
--- projects/aop/trunk/aophelper/.classpath 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/.classpath 2008-12-16 09:13:19 UTC (rev 82303)
@@ -1,35 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
- <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
- <classpathentry kind="output" path="target/classes"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant/1.7.0/ant-1.7.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant-launcher/1.7.0/ant-launcher-1.7.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.jar"/>
- <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA.jar" sourcepath="M2_REPO/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA-sources.jar"/>
- <classpathentry kind="src" path="/jboss-aop"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-log4j/2.0.5.GA/jboss-logging-log4j-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-log4j/2.0.5.GA/jboss-logging-log4j-2.0.5.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-mdr/2.0.1.GA/jboss-mdr-2.0.1.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-mdr/2.0.1.GA/jboss-mdr-2.0.1.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-reflect/2.0.2.GA/jboss-reflect-2.0.2.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-reflect/2.0.2.GA/jboss-reflect-2.0.2.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-artifact/2.0.9/maven-artifact-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-artifact/2.0.9/maven-artifact-2.0.9-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-artifact-manager/2.0.9/maven-artifact-manager-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-artifact-manager/2.0.9/maven-artifact-manager-2.0.9-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/maven/plugins/maven-jbossaop-plugin/1.0.0-SNAPSHOT/maven-jbossaop-plugin-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/maven/plugins/maven-jbossaop-plugin/1.0.0-SNAPSHOT/maven-jbossaop-plugin-1.0.0-SNAPSHOT-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-model/2.0.9/maven-model-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-model/2.0.9/maven-model-2.0.9-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-registry/2.0.9/maven-plugin-registry-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-plugin-registry/2.0.9/maven-plugin-registry-2.0.9-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-profile/2.0.9/maven-profile-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-profile/2.0.9/maven-profile-2.0.9-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-project/2.0.9/maven-project-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-project/2.0.9/maven-project-2.0.9-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-repository-metadata/2.0.9/maven-repository-metadata-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-repository-metadata/2.0.9/maven-repository-metadata-2.0.9-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-settings/2.0.9/maven-settings-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-settings/2.0.9/maven-settings-2.0.9-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/maven/plugins/maven-surefire-plugin/2.4/maven-surefire-plugin-2.4.jar" sourcepath="M2_REPO/org/apache/maven/plugins/maven-surefire-plugin/2.4/maven-surefire-plugin-2.4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-utils/1.4.9/plexus-utils-1.4.9.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/maven/surefire/surefire-api/2.4/surefire-api-2.4.jar" sourcepath="M2_REPO/org/apache/maven/surefire/surefire-api/2.4/surefire-api-2.4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/maven/surefire/surefire-booter/2.4/surefire-booter-2.4.jar" sourcepath="M2_REPO/org/apache/maven/surefire/surefire-booter/2.4/surefire-booter-2.4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/trove/trove/2.1.1/trove-2.1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2-sources.jar"/>
-</classpath>
\ No newline at end of file
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant/1.7.0/ant-1.7.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant-launcher/1.7.0/ant-launcher-1.7.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA.jar" sourcepath="M2_REPO/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-log4j/2.0.5.GA/jboss-logging-log4j-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-log4j/2.0.5.GA/jboss-logging-log4j-2.0.5.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-mdr/2.0.1.GA/jboss-mdr-2.0.1.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-mdr/2.0.1.GA/jboss-mdr-2.0.1.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-reflect/2.0.2.GA/jboss-reflect-2.0.2.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-reflect/2.0.2.GA/jboss-reflect-2.0.2.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-artifact/2.0.9/maven-artifact-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-artifact/2.0.9/maven-artifact-2.0.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-artifact-manager/2.0.9/maven-artifact-manager-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-artifact-manager/2.0.9/maven-artifact-manager-2.0.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/maven/plugins/maven-jbossaop-plugin/1.0.0-SNAPSHOT/maven-jbossaop-plugin-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/maven/plugins/maven-jbossaop-plugin/1.0.0-SNAPSHOT/maven-jbossaop-plugin-1.0.0-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-model/2.0.9/maven-model-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-model/2.0.9/maven-model-2.0.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-registry/2.0.9/maven-plugin-registry-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-plugin-registry/2.0.9/maven-plugin-registry-2.0.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-profile/2.0.9/maven-profile-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-profile/2.0.9/maven-profile-2.0.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-project/2.0.9/maven-project-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-project/2.0.9/maven-project-2.0.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-repository-metadata/2.0.9/maven-repository-metadata-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-repository-metadata/2.0.9/maven-repository-metadata-2.0.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-settings/2.0.9/maven-settings-2.0.9.jar" sourcepath="M2_REPO/org/apache/maven/maven-settings/2.0.9/maven-settings-2.0.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/plugins/maven-surefire-plugin/2.4/maven-surefire-plugin-2.4.jar" sourcepath="M2_REPO/org/apache/maven/plugins/maven-surefire-plugin/2.4/maven-surefire-plugin-2.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-utils/1.4.9/plexus-utils-1.4.9.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/surefire/surefire-api/2.4/surefire-api-2.4.jar" sourcepath="M2_REPO/org/apache/maven/surefire/surefire-api/2.4/surefire-api-2.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/surefire/surefire-booter/2.4/surefire-booter-2.4.jar" sourcepath="M2_REPO/org/apache/maven/surefire/surefire-booter/2.4/surefire-booter-2.4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/trove/trove/2.1.1/trove-2.1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2-sources.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/aop"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopBaseSettings.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopBaseSettings.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopBaseSettings.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -21,6 +21,7 @@
*/
package org.jboss.aophelper.core;
+import java.io.File;
import java.util.List;
/**
@@ -87,6 +88,26 @@
{
return aopXml;
}
+
+ public String getAopXmlAsString()
+ {
+ StringBuffer sb = new StringBuffer();
+ if(aopXml != null)
+ {
+ for(String aoppath : aopXml)
+ {
+ if(aoppath != null)
+ {
+ if(sb.length() > 0)
+ sb.append(File.pathSeparator);
+ sb.append(aoppath);
+ }
+ }
+ return sb.toString();
+ }
+ else
+ return null;
+ }
/**
* Set the aopXml.
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopHandler.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopHandler.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopHandler.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -31,15 +31,11 @@
{
private static final AopHandler handler = new AopHandler();
- private AopCompile compile;
private AopRun run;
-// private Map<AopHelperAction, String> aopHelperMap;
private AopHandler()
{
- compile = new AopCompile();
run = new AopRun();
-// aopHelperMap = new Hashtable<AopHelperAction, String>(20);
}
public static AopHandler instance()
@@ -48,26 +44,6 @@
}
/**
- * Get the compile.
- *
- * @return the compile.
- */
- public AopCompile getCompile()
- {
- return compile;
- }
-
- /**
- * Set the compile.
- *
- * @param compile The compile to set.
- */
- public void setCompile(AopCompile compile)
- {
- this.compile = compile;
- }
-
- /**
* Get the run.
*
* @return the run.
@@ -87,21 +63,4 @@
this.run = run;
}
-// /**
-// * Get the aopHelperMap.
-// *
-// * @return the aopHelperMap.
-// */
-// public String getActionValue(AopHelperAction action)
-// {
-// return aopHelperMap.get(action);
-// }
-//
-// public void addToActionMap(AopHelperAction action, String target)
-// {
-// aopHelperMap.put(action, target);
-// }
-
-
-
}
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopOption.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopOption.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopOption.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -38,5 +38,6 @@
LOADTIME,
REPORT,
EXECLASS,
+ SRCPATH,
UNSPECIFIED;
}
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopRun.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopRun.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopRun.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -38,6 +38,7 @@
private boolean loadtime;
private String executionClass;
+ private String srcPath;
public AopRun()
{
@@ -66,7 +67,26 @@
{
this.executionClass = executionClass;
}
+
+ public final String calculateCorrectExecutionClass()
+ {
+ if(getExecutionClass().startsWith(getWorkingdir()))
+ {
+ String rest = getExecutionClass().split(getWorkingdir())[1];
+ if(rest.startsWith("/"))
+ rest = rest.substring(1);
+ rest = rest.replaceAll("/",".");
+ int index = rest.lastIndexOf(".class");
+ rest = rest.substring(0,index);
+ System.out.println("rest="+rest);
+ return rest;
+ }
+ else
+ return null;
+
+ }
+
/**
* Get the runtime.
*
@@ -86,6 +106,26 @@
{
this.loadtime = runtime;
}
+
+ /**
+ * Get the srcPath.
+ *
+ * @return the srcPath.
+ */
+ public String getSrcPath()
+ {
+ return srcPath;
+ }
+
+ /**
+ * Set the srcPath.
+ *
+ * @param srcPath The srcPath to set.
+ */
+ public void setSrcPath(String srcPath)
+ {
+ this.srcPath = srcPath;
+ }
}
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/manager/CompileManager.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/manager/CompileManager.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/manager/CompileManager.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -27,7 +27,7 @@
import org.jboss.aophelper.core.AopHandler;
import org.jboss.aophelper.core.AopOption;
import org.jboss.aophelper.ui.AopHelperMediator;
-import org.jboss.aophelper.ui.compile.CompileMediator;
+import org.jboss.aophelper.ui.AopHelperUiMediator;
import org.jboss.aophelper.util.AopCompileCommand;
/**
@@ -38,11 +38,11 @@
*/
public class CompileManager
{
- private CompileMediator mediator;
+ private AopHelperUiMediator mediator;
public CompileManager()
{
- mediator = CompileMediator.instance();
+ mediator = AopHelperUiMediator.instance();
}
public void performAction(Action a, AopOption to)
@@ -90,9 +90,9 @@
File[] files = AopHelperMediator.instance().getMainPane().createFileCooser();
for(File f : files)
{
- AopHandler.instance().getCompile().addClasspath(f.getAbsolutePath());
- mediator.getClasspathModel().addRow(f.getAbsolutePath());
+ AopHandler.instance().getRun().addClasspath(f.getAbsolutePath());
}
+ mediator.refresh();
}
private void removeClasspath()
@@ -100,10 +100,10 @@
String selected = mediator.getClasspathTable().getSelectedItem();
if(selected != null)
{
- AopHandler.instance().getCompile().removeClasspath(selected);
- mediator.getClasspathModel().removeRow(selected);
- mediator.getClasspathTable().clearSelectedItem();
+ AopHandler.instance().getRun().removeClasspath(selected);
+ mediator.clearSelected();
}
+ mediator.refresh();
}
private void addXml()
@@ -111,9 +111,9 @@
File[] files = AopHelperMediator.instance().getMainPane().createFileCooser();
for(File f : files)
{
- AopHandler.instance().getCompile().addXml(f.getAbsolutePath());
- mediator.getXmlModel().addRow(f.getAbsolutePath());
+ AopHandler.instance().getRun().addXml(f.getAbsolutePath());
}
+ mediator.refresh();
}
private void removeXml()
@@ -121,25 +121,26 @@
String selected = mediator.getXmlTable().getSelectedItem();
if(selected != null)
{
- AopHandler.instance().getCompile().removeClasspath(selected);
- mediator.getXmlModel().removeRow(selected);
- mediator.getXmlTable().clearSelectedItem();
+ System.out.println("removing Xml");
+ AopHandler.instance().getRun().removeXml(selected);
+ mediator.clearSelected();
}
+ mediator.refresh();
}
private void setVerbose(boolean verbose)
{
- AopHandler.instance().getCompile().setVerbose(verbose);
+ AopHandler.instance().getRun().setVerbose(verbose);
}
private void setSuppress(boolean suppress)
{
- AopHandler.instance().getCompile().setSuppress(suppress);
+ AopHandler.instance().getRun().setSuppress(suppress);
}
private void setNoopt(boolean noopt)
{
- AopHandler.instance().getCompile().setNoopt(noopt);
+ AopHandler.instance().getRun().setNoopt(noopt);
}
private void setWorkingdir()
@@ -147,14 +148,14 @@
File[] files = AopHelperMediator.instance().getMainPane().createFileCooser();
for(File f : files)
{
- AopHandler.instance().getCompile().setWorkingdir(f.getAbsolutePath());
- mediator.getCompileOptionsPane().setWorkingDir(f.getAbsolutePath());
+ AopHandler.instance().getRun().setWorkingdir(f.getAbsolutePath());
}
+ mediator.refresh();
}
private void compile()
{
- if(AopHandler.instance().getCompile().getWorkingdir() == null)
+ if(AopHandler.instance().getRun().getWorkingdir() == null)
AopHelperMediator.instance().getMainPane().displayMessageDialog("Must set working directory");
else
{
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/manager/RunManager.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/manager/RunManager.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/manager/RunManager.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -27,7 +27,7 @@
import org.jboss.aophelper.core.AopHandler;
import org.jboss.aophelper.core.AopOption;
import org.jboss.aophelper.ui.AopHelperMediator;
-import org.jboss.aophelper.ui.run.RunMediator;
+import org.jboss.aophelper.ui.AopHelperUiMediator;
import org.jboss.aophelper.util.AopRunCommand;
/**
@@ -39,11 +39,11 @@
public class RunManager
{
- private RunMediator runMediator;
+ private AopHelperUiMediator mediator;
public RunManager()
{
- runMediator = RunMediator.instance();
+ mediator = AopHelperUiMediator.instance();
}
public void performAction(Action a, AopOption to)
@@ -84,6 +84,8 @@
setWorkingdir();
else if(to.equals(AopOption.EXECLASS))
setExecutionClass();
+ else if(to.equals(AopOption.SRCPATH))
+ setSrcPath();
}
else if(a.equals(Action.RUN))
{
@@ -98,19 +100,19 @@
for(File f : files)
{
AopHandler.instance().getRun().addClasspath(f.getAbsolutePath());
- runMediator.getRunClasspathModel().addRow(f.getAbsolutePath());
}
+ mediator.refresh();
}
private void removeClasspath()
{
- String selected = runMediator.getRunClasspathTable().getSelectedItem();
+ String selected = mediator.getRunClasspathTable().getSelectedItem();
if(selected != null)
{
AopHandler.instance().getRun().removeClasspath(selected);
- runMediator.getRunClasspathModel().removeRow(selected);
- runMediator.getRunClasspathTable().clearSelectedItem();
+ mediator.clearSelected();
}
+ mediator.refresh();
}
private void addXml()
@@ -119,19 +121,19 @@
for(File f : files)
{
AopHandler.instance().getRun().addXml(f.getAbsolutePath());
- runMediator.getRunXmlModel().addRow(f.getAbsolutePath());
}
+ mediator.refresh();
}
private void removeXml()
{
- String selected = runMediator.getRunXmlTable().getSelectedItem();
+ String selected = mediator.getRunXmlTable().getSelectedItem();
if(selected != null)
{
- AopHandler.instance().getRun().removeClasspath(selected);
- runMediator.getRunXmlModel().removeRow(selected);
- runMediator.getRunXmlTable().clearSelectedItem();
+ AopHandler.instance().getRun().removeXml(selected);
+ mediator.clearSelected();
}
+ mediator.refresh();
}
private void setVerbose(boolean verbose)
@@ -161,8 +163,8 @@
for(File f : files)
{
AopHandler.instance().getRun().setWorkingdir(f.getAbsolutePath());
- runMediator.getRunOptionsPane().setWorkingDir(f.getAbsolutePath());
}
+ mediator.refresh();
}
private void setExecutionClass()
@@ -171,10 +173,20 @@
for(File f : files)
{
AopHandler.instance().getRun().setExecutionClass(f.getAbsolutePath());
- runMediator.getRunOptionsPane().setExecutionClass(f.getAbsolutePath());
}
+ mediator.refresh();
}
+ private void setSrcPath()
+ {
+ File[] files = AopHelperMediator.instance().getMainPane().createFileCooser();
+ for(File f : files)
+ {
+ AopHandler.instance().getRun().setSrcPath(f.getAbsolutePath());
+ }
+ mediator.refresh();
+ }
+
private void run()
{
if(AopHandler.instance().getRun().getWorkingdir() == null)
@@ -185,8 +197,8 @@
{
AopRunCommand run = new AopRunCommand();
String[] out = run.execute();
- runMediator.getRunOutputPane().setText(out[0]);
- runMediator.getRunOutputPane().setError(out[1]);
+ mediator.getRunOutputPane().setText(out[0]);
+ mediator.getRunOutputPane().setError(out[1]);
}
}
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperFrame.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperFrame.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperFrame.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -28,6 +28,7 @@
import java.awt.event.WindowEvent;
import java.io.File;
+import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
@@ -133,6 +134,19 @@
return new File[0];
}
}
+
+ public boolean createConfirmWindow(String text)
+ {
+// JOptionPane optionPane = new JOptionPane(this, text, "Click Ok", JOptionPane.OK_CANCEL_OPTION);
+ int retval = JOptionPane.showConfirmDialog(this, text, "Click Ok", JOptionPane.OK_CANCEL_OPTION);
+
+ if(retval == JOptionPane.YES_OPTION)
+ {
+ System.out.println("User said yes!");
+ return true;
+ }
+ return false;
+ }
public void setRunMode()
{
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperMediator.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperMediator.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperMediator.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -26,8 +26,7 @@
import java.io.FileWriter;
import java.io.IOException;
-import org.jboss.aophelper.ui.compile.CompileMediator;
-import org.jboss.aophelper.ui.run.RunMediator;
+import org.jboss.aophelper.util.xml.AntBuildCreator;
import org.jboss.aophelper.util.xml.BaseConfigParser;
/**
@@ -108,8 +107,7 @@
if(file[0] != null)
{
BaseConfigParser.parse(file[0]);
- CompileMediator.instance().refresh();
- RunMediator.instance().refresh();
+ AopHelperUiMediator.instance().refresh();
}
}
@@ -120,18 +118,47 @@
*/
public void saveSettings()
{
-
+
File[] file = mainPane.createFileCooser();
if(file[0] != null && !file[0].isDirectory())
{
- System.out.println("saving to file: "+file[0].getAbsoluteFile());
- String output = BaseConfigParser.getDOMAsString();
- try {
- BufferedWriter out = new BufferedWriter(new FileWriter(file[0].getAbsoluteFile()));
- out.write(output);
- out.close();
- } catch (IOException e) {
- }
+ System.out.println("saving to file: "+file[0].getAbsoluteFile());
+ String output = BaseConfigParser.getSettingsAsString();
+ try
+ {
+ BufferedWriter out = new BufferedWriter(new FileWriter(file[0].getAbsoluteFile()));
+ out.write(output);
+ out.close();
+ }
+ catch (IOException e)
+ {
+ }
}
}
+
+ public void saveAntSettings()
+ {
+
+ if(mainPane.createConfirmWindow("You have to set the correct sourcepath for the ant file to work"))
+ {
+
+ File[] file = mainPane.createFileCooser();
+ if(file[0] != null && !file[0].isDirectory())
+ {
+ System.out.println("saving to file: "+file[0].getAbsoluteFile());
+ String output = AntBuildCreator.getAntSettingsAsString();
+ try
+ {
+ BufferedWriter out = new BufferedWriter(new FileWriter(file[0].getAbsoluteFile()));
+ out.write(output);
+ out.close();
+ }
+ catch (IOException e)
+ {
+ }
+ }
+ }
+ }
+
+
}
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperMenuBar.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperMenuBar.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperMenuBar.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -167,6 +167,17 @@
});
editMenu.add(load);
+ JMenuItem saveAnt = new JMenuItem("Save settings as ant build file", 'A');
+// saveAnt.setAccelerator(KeyStroke.getKeyStroke('S',
+// Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
+ saveAnt.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent event)
+ {
+ AopHelperMediator.instance().saveAntSettings();
+ }
+ });
+ editMenu.add(saveAnt);
+
return editMenu;
}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperUiMediator.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperUiMediator.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperUiMediator.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -0,0 +1,301 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.aophelper.ui;
+
+import org.jboss.aophelper.ui.compile.OutputPane;
+import org.jboss.aophelper.ui.compile.classpath.ClasspathTableModel;
+import org.jboss.aophelper.ui.compile.classpath.ClasspathTablePane;
+import org.jboss.aophelper.ui.compile.options.CompileOptionsPane;
+import org.jboss.aophelper.ui.compile.xml.XmlTableModel;
+import org.jboss.aophelper.ui.compile.xml.XmlTablePane;
+import org.jboss.aophelper.ui.run.RunOutputPane;
+import org.jboss.aophelper.ui.run.classpath.RunClasspathTableModel;
+import org.jboss.aophelper.ui.run.classpath.RunClasspathTablePane;
+import org.jboss.aophelper.ui.run.options.RunOptionsPane;
+import org.jboss.aophelper.ui.run.xml.RunXmlTableModel;
+import org.jboss.aophelper.ui.run.xml.RunXmlTablePane;
+
+/**
+ * A AopHelperUiMediator.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class AopHelperUiMediator
+{
+ private static final AopHelperUiMediator mediator = new AopHelperUiMediator();
+
+ private RunClasspathTablePane runClasspathTable;
+ private RunClasspathTableModel runClasspathModel;
+
+ private RunXmlTablePane runXmlTable;
+ private RunXmlTableModel runXmlModel;
+
+ private RunOptionsPane runOptionsPane;
+ private RunOutputPane runOutputPane;
+
+ private ClasspathTablePane classpathTable;
+ private ClasspathTableModel classpathModel;
+
+ private XmlTablePane xmlTable;
+ private XmlTableModel xmlModel;
+
+ private CompileOptionsPane compileOptionsPane;
+ private OutputPane outputPane;
+
+
+ private AopHelperUiMediator()
+ {
+ }
+
+ public static AopHelperUiMediator instance()
+ {
+ return mediator;
+ }
+
+ public void setClasspathTable(ClasspathTablePane table)
+ {
+ this.classpathTable = table;
+ }
+
+ public ClasspathTablePane getClasspathTable()
+ {
+ return classpathTable;
+ }
+
+ /**
+ * Get the classpathModel.
+ *
+ * @return the classpathModel.
+ */
+ public ClasspathTableModel getClasspathModel()
+ {
+ return classpathModel;
+ }
+
+ /**
+ * Set the classpathModel.
+ *
+ * @param classpathModel The classpathModel to set.
+ */
+ public void setClasspathModel(ClasspathTableModel classpathModel)
+ {
+ this.classpathModel = classpathModel;
+ }
+
+ /**
+ *
+ * @param tableModel
+ */
+ public void setXmlModel(XmlTableModel tableModel)
+ {
+ xmlModel = tableModel;
+ }
+
+ public XmlTableModel getXmlModel()
+ {
+ return xmlModel;
+ }
+
+ public void setXmlTable(XmlTablePane tableP)
+ {
+ xmlTable = tableP;
+ }
+
+ public XmlTablePane getXmlTable()
+ {
+ return xmlTable;
+ }
+
+ /**
+ * Get the compileOptionsPane.
+ *
+ * @return the compileOptionsPane.
+ */
+ public CompileOptionsPane getCompileOptionsPane()
+ {
+ return compileOptionsPane;
+ }
+
+ /**
+ * Set the compileOptionsPane.
+ *
+ * @param compileOptionsPane The compileOptionsPane to set.
+ */
+ public void setCompileOptionsPane(CompileOptionsPane compileOptionsPane)
+ {
+ this.compileOptionsPane = compileOptionsPane;
+ }
+
+ /**
+ * Get the outputPane.
+ *
+ * @return the outputPane.
+ */
+ public OutputPane getOutputPane()
+ {
+ return outputPane;
+ }
+
+ /**
+ * Set the outputPane.
+ *
+ * @param outputPane The outputPane to set.
+ */
+ public void setOutputPane(OutputPane outputPane)
+ {
+ this.outputPane = outputPane;
+ }
+
+
+ /**
+ * FIXME Comment this
+ *
+ * @param tableModel
+ */
+ public void setRunClasspathModel(RunClasspathTableModel tableModel)
+ {
+ runClasspathModel = tableModel;
+ }
+
+ public RunClasspathTableModel getRunClasspathModel()
+ {
+ return runClasspathModel;
+ }
+
+ /**
+ * FIXME Comment this
+ *
+ * @param runClasspathTablePane
+ */
+ public void setRunClasspathTable(RunClasspathTablePane classpathTablePane)
+ {
+ runClasspathTable = classpathTablePane;
+ }
+
+ public RunClasspathTablePane getRunClasspathTable()
+ {
+ return runClasspathTable;
+ }
+
+ /**
+ * Get the runXmlTable.
+ *
+ * @return the runXmlTable.
+ */
+ public RunXmlTablePane getRunXmlTable()
+ {
+ return runXmlTable;
+ }
+
+ /**
+ * Set the runXmlTable.
+ *
+ * @param runXmlTable The runXmlTable to set.
+ */
+ public void setRunXmlTable(RunXmlTablePane runXmlTable)
+ {
+ this.runXmlTable = runXmlTable;
+ }
+
+ /**
+ * Get the runXmlModel.
+ *
+ * @return the runXmlModel.
+ */
+ public RunXmlTableModel getRunXmlModel()
+ {
+ return runXmlModel;
+ }
+
+ /**
+ * Set the runXmlModel.
+ *
+ * @param runXmlModel The runXmlModel to set.
+ */
+ public void setRunXmlModel(RunXmlTableModel runXmlModel)
+ {
+ this.runXmlModel = runXmlModel;
+ }
+
+ /**
+ * Get the runOptionsPane.
+ *
+ * @return the runOptionsPane.
+ */
+ public final RunOptionsPane getRunOptionsPane()
+ {
+ return runOptionsPane;
+ }
+
+ /**
+ * Set the runOptionsPane.
+ *
+ * @param runOptionsPane The runOptionsPane to set.
+ */
+ public final void setRunOptionsPane(RunOptionsPane runOptionsPane)
+ {
+ this.runOptionsPane = runOptionsPane;
+ }
+
+ /**
+ * Get the runOutputPane.
+ *
+ * @return the runOutputPane.
+ */
+ public final RunOutputPane getRunOutputPane()
+ {
+ return runOutputPane;
+ }
+
+ /**
+ * Set the runOutputPane.
+ *
+ * @param runOutputPane The runOutputPane to set.
+ */
+ public final void setRunOutputPane(RunOutputPane runOutputPane)
+ {
+ this.runOutputPane = runOutputPane;
+ }
+
+ public void refresh()
+ {
+ classpathTable.refresh();
+ xmlTable.refresh();
+ compileOptionsPane.refresh();
+ runClasspathTable.refresh();
+ runXmlTable.refresh();
+ runOptionsPane.refresh();
+ }
+
+ public void clearSelected()
+ {
+ xmlTable.clearSelectedItem();
+ classpathTable.clearSelectedItem();
+ runXmlTable.clearSelectedItem();
+ runClasspathTable.clearSelectedItem();
+ }
+
+
+
+
+}
Deleted: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/CompileMediator.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/CompileMediator.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/CompileMediator.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -1,162 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.aophelper.ui.compile;
-
-import org.jboss.aophelper.ui.compile.classpath.ClasspathTableModel;
-import org.jboss.aophelper.ui.compile.classpath.ClasspathTablePane;
-import org.jboss.aophelper.ui.compile.options.CompileOptionsPane;
-import org.jboss.aophelper.ui.compile.xml.XmlTableModel;
-import org.jboss.aophelper.ui.compile.xml.XmlTablePane;
-
-/**
- * A CompileMediator.
- *
- * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
- * @version $Revision: 1.1 $
- */
-public class CompileMediator
-{
- private static final CompileMediator mediator = new CompileMediator();
-
- private ClasspathTablePane classpathTable;
- private ClasspathTableModel classpathModel;
-
- private XmlTablePane xmlTable;
- private XmlTableModel xmlModel;
-
- private CompileOptionsPane compileOptionsPane;
- private OutputPane outputPane;
-
- private CompileMediator()
- {
-
- }
-
- public static CompileMediator instance()
- {
- return mediator;
- }
-
- public void setClasspathTable(ClasspathTablePane table)
- {
- this.classpathTable = table;
- }
-
- public ClasspathTablePane getClasspathTable()
- {
- return classpathTable;
- }
-
- /**
- * Get the classpathModel.
- *
- * @return the classpathModel.
- */
- public ClasspathTableModel getClasspathModel()
- {
- return classpathModel;
- }
-
- /**
- * Set the classpathModel.
- *
- * @param classpathModel The classpathModel to set.
- */
- public void setClasspathModel(ClasspathTableModel classpathModel)
- {
- this.classpathModel = classpathModel;
- }
-
- /**
- *
- * @param tableModel
- */
- public void setXmlModel(XmlTableModel tableModel)
- {
- xmlModel = tableModel;
- }
-
- public XmlTableModel getXmlModel()
- {
- return xmlModel;
- }
-
- public void setXmlTable(XmlTablePane tableP)
- {
- xmlTable = tableP;
- }
-
- public XmlTablePane getXmlTable()
- {
- return xmlTable;
- }
-
- /**
- * Get the compileOptionsPane.
- *
- * @return the compileOptionsPane.
- */
- public CompileOptionsPane getCompileOptionsPane()
- {
- return compileOptionsPane;
- }
-
- /**
- * Set the compileOptionsPane.
- *
- * @param compileOptionsPane The compileOptionsPane to set.
- */
- public void setCompileOptionsPane(CompileOptionsPane compileOptionsPane)
- {
- this.compileOptionsPane = compileOptionsPane;
- }
-
- /**
- * Get the outputPane.
- *
- * @return the outputPane.
- */
- public OutputPane getOutputPane()
- {
- return outputPane;
- }
-
- /**
- * Set the outputPane.
- *
- * @param outputPane The outputPane to set.
- */
- public void setOutputPane(OutputPane outputPane)
- {
- this.outputPane = outputPane;
- }
-
- public void refresh()
- {
- classpathTable.refresh();
- xmlTable.refresh();
- compileOptionsPane.refresh();
- }
-
-
-
-}
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/OutputPane.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/OutputPane.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/OutputPane.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -30,6 +30,8 @@
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
+import org.jboss.aophelper.ui.AopHelperUiMediator;
+
/**
* A OutputPane.
*
@@ -51,7 +53,7 @@
private void init()
{
- CompileMediator.instance().setOutputPane(this);
+ AopHelperUiMediator.instance().setOutputPane(this);
// setBackground(Color.white);
setLayout(new FlowLayout());
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathTablePane.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathTablePane.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathTablePane.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -26,10 +26,10 @@
import org.jboss.aophelper.core.AopHandler;
import org.jboss.aophelper.core.AopOption;
import org.jboss.aophelper.core.AopState;
+import org.jboss.aophelper.ui.AopHelperUiMediator;
import org.jboss.aophelper.ui.GenericEditTableModel;
import org.jboss.aophelper.ui.GenericEditTablePane;
import org.jboss.aophelper.ui.compile.classpath.ClasspathTableModel;
-import org.jboss.aophelper.ui.compile.CompileMediator;
/**
* A ClasspathTablePane.
@@ -57,13 +57,13 @@
{
if(tableModel == null)
tableModel = new ClasspathTableModel();
- CompileMediator.instance().setClasspathModel(tableModel);
+ AopHelperUiMediator.instance().setClasspathModel(tableModel);
}
@Override
public void setMediatorJPanel()
{
- CompileMediator.instance().setClasspathTable(this);
+ AopHelperUiMediator.instance().setClasspathTable(this);
}
@Override
@@ -85,13 +85,13 @@
for(String path : cp)
{
tableModel.addRow(path);
- AopHandler.instance().getCompile().addClasspath(path);
+ AopHandler.instance().getRun().addClasspath(path);
}
}
public void refresh()
{
tableModel.clearRows();
- tableModel.addRows(AopHandler.instance().getCompile().getClasspath());
+ tableModel.addRows(AopHandler.instance().getRun().getClasspath());
}
}
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/options/CompileOptionsPane.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/options/CompileOptionsPane.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/options/CompileOptionsPane.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -42,7 +42,7 @@
import org.jboss.aophelper.core.AopHandler;
import org.jboss.aophelper.core.AopOption;
import org.jboss.aophelper.core.AopState;
-import org.jboss.aophelper.ui.compile.CompileMediator;
+import org.jboss.aophelper.ui.AopHelperUiMediator;
/**
* A CompileOptionsPane.
@@ -65,7 +65,7 @@
private void init()
{
- CompileMediator.instance().setCompileOptionsPane(this);
+ AopHelperUiMediator.instance().setCompileOptionsPane(this);
setLayout(new BorderLayout());
// JLabel heading = new JLabel("Settings");
@@ -221,10 +221,10 @@
public void refresh()
{
- setWorkingDir(AopHandler.instance().getCompile().getWorkingdir());
- verbose.setSelected(AopHandler.instance().getCompile().isVerbose());
- noopt.setSelected(AopHandler.instance().getCompile().isNoopt());
- suppress.setSelected(AopHandler.instance().getCompile().isSuppress());
+ setWorkingDir(AopHandler.instance().getRun().getWorkingdir());
+ verbose.setSelected(AopHandler.instance().getRun().isVerbose());
+ noopt.setSelected(AopHandler.instance().getRun().isNoopt());
+ suppress.setSelected(AopHandler.instance().getRun().isSuppress());
}
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlTablePane.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlTablePane.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlTablePane.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -26,10 +26,10 @@
import org.jboss.aophelper.core.AopHandler;
import org.jboss.aophelper.core.AopOption;
import org.jboss.aophelper.core.AopState;
+import org.jboss.aophelper.ui.AopHelperUiMediator;
import org.jboss.aophelper.ui.GenericEditTableModel;
import org.jboss.aophelper.ui.GenericEditTablePane;
import org.jboss.aophelper.ui.compile.xml.XmlTableModel;
-import org.jboss.aophelper.ui.compile.CompileMediator;
/**
* A XmlTablePane.
@@ -56,14 +56,13 @@
{
if(tableModel == null)
tableModel = new XmlTableModel();
-// System.out.println("setting tablemodel to the mediator: "+tableModel.getClass().getName());
- CompileMediator.instance().setXmlModel(tableModel);
+ AopHelperUiMediator.instance().setXmlModel(tableModel);
}
@Override
public void setMediatorJPanel()
{
- CompileMediator.instance().setXmlTable(this);
+ AopHelperUiMediator.instance().setXmlTable(this);
}
@Override
@@ -82,7 +81,7 @@
public void refresh()
{
tableModel.clearRows();
- tableModel.addRows(AopHandler.instance().getCompile().getAopXml());
+ tableModel.addRows(AopHandler.instance().getRun().getAopXml());
}
}
Deleted: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/RunMediator.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/RunMediator.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/RunMediator.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -1,175 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.aophelper.ui.run;
-
-import org.jboss.aophelper.ui.run.classpath.RunClasspathTableModel;
-import org.jboss.aophelper.ui.run.classpath.RunClasspathTablePane;
-import org.jboss.aophelper.ui.run.options.RunOptionsPane;
-import org.jboss.aophelper.ui.run.xml.RunXmlTableModel;
-import org.jboss.aophelper.ui.run.xml.RunXmlTablePane;
-
-/**
- * A RunMediator.
- *
- * @author <a href="stalep at gmail.com">Stale W. Pedersen</a>
- * @version $Revision: 1.1 $
- */
-public class RunMediator
-{
- private static final RunMediator mediator = new RunMediator();
-
- private RunClasspathTablePane runClasspathTable;
- private RunClasspathTableModel runClasspathModel;
-
- private RunXmlTablePane runXmlTable;
- private RunXmlTableModel runXmlModel;
-
- private RunOptionsPane runOptionsPane;
- private RunOutputPane runOutputPane;
-
- private RunMediator()
- {
-
- }
-
- public static RunMediator instance()
- {
- return mediator;
- }
-
- /**
- * FIXME Comment this
- *
- * @param tableModel
- */
- public void setRunClasspathModel(RunClasspathTableModel tableModel)
- {
- runClasspathModel = tableModel;
- }
-
- public RunClasspathTableModel getRunClasspathModel()
- {
- return runClasspathModel;
- }
-
- /**
- * FIXME Comment this
- *
- * @param runClasspathTablePane
- */
- public void setRunClasspathTable(RunClasspathTablePane classpathTablePane)
- {
- runClasspathTable = classpathTablePane;
- }
-
- public RunClasspathTablePane getRunClasspathTable()
- {
- return runClasspathTable;
- }
-
- /**
- * Get the runXmlTable.
- *
- * @return the runXmlTable.
- */
- public RunXmlTablePane getRunXmlTable()
- {
- return runXmlTable;
- }
-
- /**
- * Set the runXmlTable.
- *
- * @param runXmlTable The runXmlTable to set.
- */
- public void setRunXmlTable(RunXmlTablePane runXmlTable)
- {
- this.runXmlTable = runXmlTable;
- }
-
- /**
- * Get the runXmlModel.
- *
- * @return the runXmlModel.
- */
- public RunXmlTableModel getRunXmlModel()
- {
- return runXmlModel;
- }
-
- /**
- * Set the runXmlModel.
- *
- * @param runXmlModel The runXmlModel to set.
- */
- public void setRunXmlModel(RunXmlTableModel runXmlModel)
- {
- this.runXmlModel = runXmlModel;
- }
-
- /**
- * Get the runOptionsPane.
- *
- * @return the runOptionsPane.
- */
- public final RunOptionsPane getRunOptionsPane()
- {
- return runOptionsPane;
- }
-
- /**
- * Set the runOptionsPane.
- *
- * @param runOptionsPane The runOptionsPane to set.
- */
- public final void setRunOptionsPane(RunOptionsPane runOptionsPane)
- {
- this.runOptionsPane = runOptionsPane;
- }
-
- /**
- * Get the runOutputPane.
- *
- * @return the runOutputPane.
- */
- public final RunOutputPane getRunOutputPane()
- {
- return runOutputPane;
- }
-
- /**
- * Set the runOutputPane.
- *
- * @param runOutputPane The runOutputPane to set.
- */
- public final void setRunOutputPane(RunOutputPane runOutputPane)
- {
- this.runOutputPane = runOutputPane;
- }
-
- public void refresh()
- {
- runClasspathTable.refresh();
- runXmlTable.refresh();
- runOptionsPane.refresh();
- }
-}
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/RunOutputPane.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/RunOutputPane.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/RunOutputPane.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -30,7 +30,7 @@
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
-import org.jboss.aophelper.ui.run.RunMediator;
+import org.jboss.aophelper.ui.AopHelperUiMediator;
/**
* A RunOutputPane.
@@ -54,7 +54,7 @@
private void init()
{
- RunMediator.instance().setRunOutputPane(this);
+ AopHelperUiMediator.instance().setRunOutputPane(this);
setLayout(new FlowLayout());
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/classpath/RunClasspathTablePane.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/classpath/RunClasspathTablePane.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/classpath/RunClasspathTablePane.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -26,9 +26,9 @@
import org.jboss.aophelper.core.AopHandler;
import org.jboss.aophelper.core.AopOption;
import org.jboss.aophelper.core.AopState;
+import org.jboss.aophelper.ui.AopHelperUiMediator;
import org.jboss.aophelper.ui.GenericEditTableModel;
import org.jboss.aophelper.ui.GenericEditTablePane;
-import org.jboss.aophelper.ui.run.RunMediator;
/**
* A RunClasspathTablePane.
@@ -57,13 +57,13 @@
if(tableModel == null)
tableModel = new RunClasspathTableModel();
System.out.println("setting tablemodel to the mediator: "+tableModel.getClass().getName());
- RunMediator.instance().setRunClasspathModel(tableModel);
+ AopHelperUiMediator.instance().setRunClasspathModel(tableModel);
}
@Override
public void setMediatorJPanel()
{
- RunMediator.instance().setRunClasspathTable(this);
+ AopHelperUiMediator.instance().setRunClasspathTable(this);
}
@Override
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/options/RunOptionsPane.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/options/RunOptionsPane.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/options/RunOptionsPane.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -42,7 +42,7 @@
import org.jboss.aophelper.core.AopHandler;
import org.jboss.aophelper.core.AopOption;
import org.jboss.aophelper.core.AopState;
-import org.jboss.aophelper.ui.run.RunMediator;
+import org.jboss.aophelper.ui.AopHelperUiMediator;
/**
* A RunOptionsPane.
@@ -57,7 +57,7 @@
private static final long serialVersionUID = 1L;
private JCheckBox verbose, suppress, noopt, loadtime;
- private JTextField workingdir, executionClass;
+ private JTextField workingdir, executionClass, srcPath;
public RunOptionsPane()
{
init();
@@ -65,7 +65,7 @@
private void init()
{
- RunMediator.instance().setRunOptionsPane(this);
+ AopHelperUiMediator.instance().setRunOptionsPane(this);
setLayout(new BorderLayout());
// JLabel heading = new JLabel("Settings");
@@ -140,7 +140,7 @@
});
JPanel workingdirPanel = new JPanel(new FlowLayout());
- workingdir = new JTextField("must set the working directory", 20);
+ workingdir = new JTextField("must set the working directory", 25);
workingdir.setEditable(false);
JLabel workingLabel = new JLabel("Set the working directory ");
workingLabel.setLabelFor(workingdir);
@@ -156,7 +156,7 @@
workingdirPanel.add(workingdirButton);
JPanel exeClassPanel = new JPanel(new FlowLayout());
- executionClass = new JTextField("must set the execution class", 20);
+ executionClass = new JTextField("must set the execution class", 25);
executionClass.setEditable(false);
JLabel executionLabel = new JLabel("Set the execution class");
executionLabel.setLabelFor(executionClass);
@@ -171,9 +171,28 @@
});
exeClassPanel.add(executionButton);
+
+ JPanel srcPanel = new JPanel(new FlowLayout());
+ srcPath = new JTextField("only needed if you want to create an ant buildfile", 25);
+ srcPath.setEditable(false);
+ JLabel srcLabel = new JLabel("Set source path: ");
+ executionLabel.setLabelFor(srcPath);
+ srcPanel.add(srcLabel);
+ srcPanel.add(srcPath);
+ JButton srcButton = new JButton("Set source path");
+ srcButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent event)
+ {
+ setSrcPath();
+ }
+ });
+ srcPanel.add(srcButton);
+
+
JPanel settingPanel = new JPanel(new FlowLayout());
settingPanel.add(workingdirPanel);
settingPanel.add(exeClassPanel);
+ settingPanel.add(srcPanel);
add(settingPanel, BorderLayout.CENTER);
@@ -270,6 +289,14 @@
{
}
+ @AopHelperAction(
+ action=Action.SET,
+ state=AopState.RUN,
+ option=AopOption.SRCPATH)
+ private void setSrcPath()
+ {
+ }
+
public void setWorkingDir(String dir)
{
workingdir.setText(dir);
@@ -280,10 +307,16 @@
executionClass.setText(exeClass);
}
+ public void setSrcPath(String srcPath)
+ {
+ this.srcPath.setText(srcPath);
+ }
+
public void refresh()
{
setWorkingDir(AopHandler.instance().getRun().getWorkingdir());
setExecutionClass(AopHandler.instance().getRun().getExecutionClass());
+ setSrcPath(AopHandler.instance().getRun().getSrcPath());
verbose.setSelected(AopHandler.instance().getRun().isVerbose());
noopt.setSelected(AopHandler.instance().getRun().isNoopt());
suppress.setSelected(AopHandler.instance().getRun().isSuppress());
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/xml/RunXmlTablePane.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/xml/RunXmlTablePane.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/run/xml/RunXmlTablePane.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -26,9 +26,9 @@
import org.jboss.aophelper.core.AopHandler;
import org.jboss.aophelper.core.AopOption;
import org.jboss.aophelper.core.AopState;
+import org.jboss.aophelper.ui.AopHelperUiMediator;
import org.jboss.aophelper.ui.GenericEditTableModel;
import org.jboss.aophelper.ui.GenericEditTablePane;
-import org.jboss.aophelper.ui.run.RunMediator;
/**
* A RunXmlTablePane.
@@ -57,13 +57,13 @@
tableModel = new RunXmlTableModel();
// System.out.println("setting tablemodel to the mediator: "+tableModel.getClass().getName());
- RunMediator.instance().setRunXmlModel(tableModel);
+ AopHelperUiMediator.instance().setRunXmlModel(tableModel);
}
@Override
public void setMediatorJPanel()
{
- RunMediator.instance().setRunXmlTable(this);
+ AopHelperUiMediator.instance().setRunXmlTable(this);
}
@Override
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/AopCompileCommand.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/AopCompileCommand.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/AopCompileCommand.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -26,6 +26,7 @@
import org.jboss.aophelper.core.AopCompile;
import org.jboss.aophelper.core.AopHandler;
+import org.jboss.aophelper.core.AopRun;
/**
* A AopCompileCommand.
@@ -43,7 +44,7 @@
{
String[] emptyArray = new String[0];
- Process process = Runtime.getRuntime().exec( execute, emptyArray, new File(AopHandler.instance().getCompile().getWorkingdir()));
+ Process process = Runtime.getRuntime().exec( execute, emptyArray, new File(AopHandler.instance().getRun().getWorkingdir()));
return CommandUtil.analyzeProcess(process);
}
@@ -59,24 +60,24 @@
private String setup()
{
- AopCompile compileOptions = AopHandler.instance().getCompile();
+ AopRun options = AopHandler.instance().getRun();
StringBuilder execute = new StringBuilder();
execute.append("java -cp ").append(getClasspath());
execute.append(" org.jboss.aop.standalone.Compiler ");
- if(compileOptions.isVerbose())
+ if(options.isVerbose())
execute.append("-verbose ");
- if(compileOptions.isNoopt())
+ if(options.isNoopt())
execute.append("-noopt ");
- if(compileOptions.isSuppress())
+ if(options.isSuppress())
execute.append("-suppress ");
- if(compileOptions.getAopXml().size() > 0)
+ if(options.getAopXml().size() > 0)
{
execute.append("-aoppath ");
String pathSep = System.getProperty("path.separator");
StringBuffer xmlPaths = new StringBuffer();
- for(String xml : compileOptions.getAopXml())
+ for(String xml : options.getAopXml())
{
if(xmlPaths.length() > 0)
xmlPaths.append(pathSep);
@@ -86,7 +87,7 @@
execute.append(xmlPaths.toString()).append(" ");
}
- execute.append(compileOptions.getWorkingdir());
+ execute.append(options.getWorkingdir());
// execute.append("\"");
System.out.println("EXECUTING: "+execute.toString());
@@ -100,7 +101,7 @@
{
StringBuilder sb = new StringBuilder();
String pathSeparator = System.getProperty("path.separator");
- for(String path : AopHandler.instance().getCompile().getClasspath())
+ for(String path : AopHandler.instance().getRun().getClasspath())
{
if(sb.length() > 0)
sb.append(pathSeparator);
@@ -108,7 +109,7 @@
}
if(sb.length() > 0)
sb.append(pathSeparator);
- sb.append(AopHandler.instance().getCompile().getWorkingdir());
+ sb.append(AopHandler.instance().getRun().getWorkingdir());
return sb.toString();
}
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/AopRunCommand.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/AopRunCommand.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/AopRunCommand.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -91,7 +91,7 @@
execute.append(xmlPaths.toString()).append(" ");
}
- execute.append(calculateCorrectExecutionClass(runOptions));
+ execute.append(runOptions.calculateCorrectExecutionClass());
// execute.append("\"");
System.out.println("EXECUTING: "+execute.toString());
@@ -100,29 +100,7 @@
return execute.toString();
}
-
- private String calculateCorrectExecutionClass(AopRun runOptions)
- {
- String workingdir = runOptions.getWorkingdir();
- String exeClass = runOptions.getExecutionClass();
-
- if(exeClass.startsWith(workingdir))
- {
- String rest = exeClass.split(workingdir)[1];
- if(rest.startsWith("/"))
- rest = rest.substring(1);
- rest = rest.replaceAll("/",".");
- int index = rest.lastIndexOf(".class");
- rest = rest.substring(0,index);
- System.out.println("rest="+rest);
-
- return rest;
- }
- else
- return null;
-
- }
-
+
private String getLoadtimePath()
{
String pathSeparator = System.getProperty("path.separator");
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/xml/AntBuildCreator.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/xml/AntBuildCreator.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/xml/AntBuildCreator.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -0,0 +1,246 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.aophelper.util.xml;
+
+import java.io.StringWriter;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.jboss.aophelper.core.AopBaseSettings;
+import org.jboss.aophelper.core.AopHandler;
+import org.jboss.aophelper.core.AopRun;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * A AntBuildCreator.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class AntBuildCreator
+{
+
+ private static Document createAntDOM()
+ {
+ try
+ {
+
+ AopRun aopCompile = AopHandler.instance().getRun();
+
+ DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ Document doc = builder.newDocument();
+ Element project = doc.createElement("project");
+ project.setAttribute("default", "usage");
+ project.setAttribute("name", "JBoss AOP build");
+
+ doc.appendChild(project);
+ createPrepareElement(aopCompile, doc, project);
+ createUsageElement(doc, project);
+ createCompileElement(aopCompile, doc, project);
+ createAopCompileElement(aopCompile, doc, project);
+ createRunElement(AopHandler.instance().getRun(), doc, project);
+
+ return doc;
+ }
+ catch (ParserConfigurationException e)
+ {
+ System.out.println("ERROR in createAntDOM \n"+e.toString());
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ private static void createUsageElement(Document doc, Element project)
+ {
+ Element usageTarget = doc.createElement("target");
+ usageTarget.setAttribute("name", "usage");
+
+ Element echo1 = doc.createElement("echo");
+ echo1.appendChild(doc.createTextNode("Use one of the following targets:"));
+ usageTarget.appendChild(echo1);
+
+ Element echo2 = doc.createElement("echo");
+ echo2.appendChild(doc.createTextNode("ant aoprun Run with compile-time weaving."));
+ usageTarget.appendChild(echo2);
+
+ project.appendChild(usageTarget);
+ }
+
+ private static void createPrepareElement(AopBaseSettings aopBase, Document doc, Element project)
+ {
+ Element prepareTarget = doc.createElement("target");
+ prepareTarget.setAttribute("name", "prepare");
+
+ Element classPath = doc.createElement("path");
+ classPath.setAttribute("id", "classpath");
+
+ for(String path : aopBase.getClasspath())
+ {
+ Element pathElement = doc.createElement("pathelement");
+ pathElement.setAttribute("path", path);
+ classPath.appendChild(pathElement);
+ }
+
+ Element pathElement = doc.createElement("pathelement");
+ pathElement.setAttribute("path", aopBase.getWorkingdir());
+ classPath.appendChild(pathElement);
+
+ prepareTarget.appendChild(classPath);
+ project.appendChild(prepareTarget);
+ }
+
+ private static void createCompileElement(AopRun aopBase, Document doc, Element project)
+ {
+ Element compileTarget = doc.createElement("target");
+ compileTarget.setAttribute("name", "compile");
+ compileTarget.setAttribute("depends", "prepare");
+
+ Element javac = doc.createElement("javac");
+ if(aopBase.getSrcPath() == null || aopBase.getSrcPath().length() < 1)
+ javac.setAttribute("srcdir", aopBase.getWorkingdir());
+ else
+ javac.setAttribute("srcdir", aopBase.getSrcPath());
+ javac.setAttribute("destdir", aopBase.getWorkingdir());
+ javac.setAttribute("debug", "on");
+ javac.setAttribute("deprecation", "on");
+ javac.setAttribute("optimize", "off");
+ javac.setAttribute("includes", "**");
+
+ Element cp = doc.createElement("classpath");
+ cp.setAttribute("refid", "classpath");
+
+ javac.appendChild(cp);
+ compileTarget.appendChild(javac);
+
+ project.appendChild(compileTarget);
+ }
+
+ public static void createAopCompileElement(AopRun aopBase, Document doc, Element project)
+ {
+ Element aopCompile = doc.createElement("target");
+ aopCompile.setAttribute("name", "aopcompile");
+ aopCompile.setAttribute("depends", "compile");
+
+ Element taskdef = doc.createElement("taskdef");
+ taskdef.setAttribute("name", "aopc");
+ taskdef.setAttribute("classname", "org.jboss.aop.ant.AopC");
+ taskdef.setAttribute("classpathref", "classpath");
+ aopCompile.appendChild(taskdef);
+
+ Element aopc = doc.createElement("aopc");
+ aopc.setAttribute("compilerclasspathref", "classpath");
+ aopc.setAttribute("classpathref","classpath");
+
+ Element sysprop = doc.createElement("sysproperty");
+ sysprop.setAttribute("key", "jboss.aop.path");
+ sysprop.setAttribute("value", aopBase.getAopXmlAsString());
+ aopc.appendChild(sysprop);
+
+ Element classpath = doc.createElement("classpath");
+ classpath.setAttribute("path", "classpath"); //TODO
+ aopc.appendChild(classpath);
+
+ Element src = doc.createElement("src");
+ if(aopBase.getSrcPath() == null || aopBase.getSrcPath().length() < 1)
+ src.setAttribute("path", aopBase.getWorkingdir());
+ else
+ src.setAttribute("path", aopBase.getSrcPath());
+ aopc.appendChild(src);
+
+ Element aoppath = doc.createElement("aoppath");
+ aoppath.setAttribute("path", aopBase.getAopXmlAsString());
+ aopc.appendChild(aoppath);
+
+ aopCompile.appendChild(aopc);
+ project.appendChild(aopCompile);
+
+ }
+
+ public static void createRunElement(AopRun run, Document doc, Element project)
+ {
+ Element aopRun = doc.createElement("target");
+ aopRun.setAttribute("name", "aoprun");
+ aopRun.setAttribute("depends", "aopcompile");
+
+ Element java = doc.createElement("java");
+ java.setAttribute("fork", "yes");
+ java.setAttribute("failOnError", "true");
+ java.setAttribute("className", run.calculateCorrectExecutionClass()); //TODO
+
+ Element sysprop = doc.createElement("sysproperty");
+ sysprop.setAttribute("key", "jboss.aop.path");
+ sysprop.setAttribute("value", run.getAopXmlAsString()); //TODO
+ java.appendChild(sysprop);
+
+ Element classpath = doc.createElement("classpath");
+ classpath.setAttribute("refid", "classpath");
+ java.appendChild(classpath);
+
+ aopRun.appendChild(java);
+ project.appendChild(aopRun);
+
+ }
+
+ public static String getAntSettingsAsString()
+ {
+ try
+ {
+ Document doc = createAntDOM();
+ Source source = new DOMSource(doc);
+
+ StringWriter writer = new StringWriter();
+ Result result = new StreamResult(writer);
+
+ // Write the DOM document to the writer
+ Transformer xformer = TransformerFactory.newInstance().newTransformer();
+ xformer.transform(source, result);
+
+ return writer.toString();
+ }
+ catch (TransformerConfigurationException e)
+ {
+ e.printStackTrace();
+ }
+ catch (TransformerException e)
+ {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static void main(String[] args)
+ {
+ System.out.println(AntBuildCreator.getAntSettingsAsString());
+ }
+
+}
Modified: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/xml/BaseConfigParser.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/xml/BaseConfigParser.java 2008-12-16 07:05:46 UTC (rev 82302)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/xml/BaseConfigParser.java 2008-12-16 09:13:19 UTC (rev 82303)
@@ -109,7 +109,7 @@
Node compile = findElementNode("compile", aophelper);
Node run = findElementNode("run", aophelper);
- AopHandler.instance().setCompile( parseCompile(compile));
+ AopHandler.instance().setRun( parseCompile(compile));
AopHandler.instance().setRun(parseRun(run));
}
@@ -128,12 +128,12 @@
}
- private static AopCompile parseCompile(Node compile)
+ private static AopRun parseCompile(Node compile)
{
- AopCompile aopCompile = new AopCompile();
- parseBaseSettings(compile, aopCompile);
+ AopRun compileSettings = new AopRun();
+ parseBaseSettings(compile, compileSettings);
- return aopCompile;
+ return compileSettings;
}
private static void parseBaseSettings(Node root, AopBaseSettings base)
@@ -240,8 +240,10 @@
// System.out.println("OUT: \n"+BaseConfigParser.getDOMAsString(createDOM()));
// }
- public static String getDOMAsString() {
- try {
+ public static String getSettingsAsString()
+ {
+ try
+ {
Document doc = createDOM();
Source source = new DOMSource(doc);
@@ -254,17 +256,21 @@
return writer.toString();
}
- catch (TransformerConfigurationException e) {
+ catch (TransformerConfigurationException e)
+ {
e.printStackTrace();
}
- catch (TransformerException e) {
+ catch (TransformerException e)
+ {
e.printStackTrace();
}
return null;
}
- private static Document createDOM() {
- try {
+ private static Document createDOM()
+ {
+ try
+ {
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.newDocument();
Element root = doc.createElement("aophelper");
@@ -278,7 +284,8 @@
return doc;
}
- catch (ParserConfigurationException e) {
+ catch (ParserConfigurationException e)
+ {
System.out.println("ERROR in CreateDOM \n"+e.toString());
e.printStackTrace();
}
@@ -287,7 +294,7 @@
private static void populateCompile(Element compile, Document doc)
{
- populateBase(compile, doc, AopHandler.instance().getCompile());
+ populateBase(compile, doc, AopHandler.instance().getRun());
}
private static void populateRun(Element run, Document doc)
More information about the jboss-cvs-commits
mailing list