[jboss-cvs] JBossAS SVN: r77840 - in projects/aop/trunk: aophelper and 21 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Sep 3 09:50:14 EDT 2008
Author: stalep
Date: 2008-09-03 09:50:14 -0400 (Wed, 03 Sep 2008)
New Revision: 77840
Added:
projects/aop/trunk/aophelper/
projects/aop/trunk/aophelper/.classpath
projects/aop/trunk/aophelper/.project
projects/aop/trunk/aophelper/.settings/
projects/aop/trunk/aophelper/.settings/org.eclipse.jdt.core.prefs
projects/aop/trunk/aophelper/pom.xml
projects/aop/trunk/aophelper/src/
projects/aop/trunk/aophelper/src/main/
projects/aop/trunk/aophelper/src/main/java/
projects/aop/trunk/aophelper/src/main/java/org/
projects/aop/trunk/aophelper/src/main/java/org/jboss/
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/annotation/
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/annotation/AopHelperAction.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/annotation/Remove.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/compile/
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/compile/CompileManager.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/Action.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopCompile.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/core/AopState.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/SettingInterceptor.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperFrame.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/GenericEditTableModel.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/GenericEditTablePane.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/
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/CompilerPane.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/
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathEditPane.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathPane.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathTableModel.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/
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/
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlEditPane.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlPane.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlTableModel.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/util/
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/AopCompileCommand.java
projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/CommandUtil.java
projects/aop/trunk/aophelper/src/main/resources/
projects/aop/trunk/aophelper/src/main/resources/jboss-aop.xml
projects/aop/trunk/aophelper/src/test/
projects/aop/trunk/aophelper/src/test/java/
projects/aop/trunk/aophelper/src/test/java/org/
projects/aop/trunk/aophelper/src/test/java/org/jboss/
projects/aop/trunk/aophelper/src/test/java/org/jboss/aop/
Log:
[JBAOP-538] Initial upload, compile have only been tested on linux.
Added: projects/aop/trunk/aophelper/.classpath
===================================================================
--- projects/aop/trunk/aophelper/.classpath (rev 0)
+++ projects/aop/trunk/aophelper/.classpath 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <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/log4j/log4j/1.2.14/log4j-1.2.14.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"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-api/2.0.8/maven-plugin-api-2.0.8.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-project/2.0.8/maven-project-2.0.8.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-settings/2.0.8/maven-settings-2.0.8.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-model/2.0.8/maven-model-2.0.8.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/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.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/org/apache/maven/maven-profile/2.0.8/maven-profile-2.0.8.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-artifact-manager/2.0.8/maven-artifact-manager-2.0.8.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-repository-metadata/2.0.8/maven-repository-metadata-2.0.8.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-artifact/2.0.8/maven-artifact-2.0.8.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"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-registry/2.0.8/maven-plugin-registry-2.0.8.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/plugins/maven-surefire-plugin/2.4/maven-surefire-plugin-2.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/surefire/surefire-booter/2.4/surefire-booter-2.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/maven/surefire/surefire-api/2.4/surefire-api-2.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/aop/jboss-aop/2.0.0.CR3/jboss-aop-2.0.0.CR3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/javassist/3.6.0.GA/javassist-3.6.0.GA.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-container/2.0.0.Beta6/jboss-container-2.0.0.Beta6.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.2.GA/jboss-common-core-2.2.2.GA.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jboss/jboss-logging-spi/2.0.3.GA/jboss-logging-spi-2.0.3.GA.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jboss/jboss-common-logging-spi/2.0.4.GA/jboss-common-logging-spi-2.0.4.GA.jar"/>
+ <classpathentry kind="var" path="M2_REPO/trove/trove/2.1.1/trove-2.1.1.jar"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: projects/aop/trunk/aophelper/.project
===================================================================
--- projects/aop/trunk/aophelper/.project (rev 0)
+++ projects/aop/trunk/aophelper/.project 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,13 @@
+<projectDescription>
+ <name>aophelper</name>
+ <comment/>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added: projects/aop/trunk/aophelper/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/aop/trunk/aophelper/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ projects/aop/trunk/aophelper/.settings/org.eclipse.jdt.core.prefs 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,5 @@
+#Sat Mar 15 04:19:32 CET 2008
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
Added: projects/aop/trunk/aophelper/pom.xml
===================================================================
--- projects/aop/trunk/aophelper/pom.xml (rev 0)
+++ projects/aop/trunk/aophelper/pom.xml 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,128 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>aophelper</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0.0-SNAPSHOT</version>
+ <name>JBoss AOP Helper</name>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <releases>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Maven Snapshot Repository</name>
+ <url>http://snapshots.jboss.org/maven2</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <dependencies>
+ <!--
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop</artifactId>
+ <version>2.0.0.CR3</version>
+ <scope>compile</scope>
+ </dependency>
+ -->
+ <dependency>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jbossaop-plugin</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>jboss_repo</id>
+ <name>JBoss Maven Repository</name>
+ <url>http://repository.jboss.com/maven2</url>
+ </repository>
+ </repositories>
+
+ <build>
+ <sourceDirectory>src/main/java</sourceDirectory>
+ <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
+ <testSourceDirectory>src/test/java</testSourceDirectory>
+ <outputDirectory>target/classes</outputDirectory>
+ <testOutputDirectory>target/test-classes</testOutputDirectory>
+ <defaultGoal>install</defaultGoal>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ </testResources>
+ <directory>target</directory>
+
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>${jdkVersion}</source>
+ <target>${jdkVersion}</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jbossaop-plugin</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>compile</id>
+ <configuration>
+ <!-- if you want to include dependencies from the current module
+ (only needed if a class inherits a class thats not defined in this module
+ <includeProjectDependency>true</includeProjectDependency>
+ -->
+ <aoppaths>
+ <aoppath>src/main/resources/jboss-aop.xml</aoppath>
+ </aoppaths>
+ </configuration>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>run</id>
+ <configuration>
+ <aoppaths>
+ <aoppath>src/main/resources/jboss-aop.xml</aoppath>
+ </aoppaths>
+ <loadtime>true</loadtime>
+ <executable>org.jboss.aophelper.ui.AopHelperFrame</executable>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+
+
+
+ </plugins>
+
+ </build>
+
+ <properties>
+ <jdkVersion>1.5</jdkVersion>
+ </properties>
+
+</project>
Property changes on: projects/aop/trunk/aophelper/pom.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/annotation/AopHelperAction.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/annotation/AopHelperAction.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/annotation/AopHelperAction.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,46 @@
+/*
+ * 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.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.jboss.aophelper.core.Action;
+import org.jboss.aophelper.core.AopState;
+import org.jboss.aophelper.core.AopOption;
+/**
+ * A Add.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+ at Target({ElementType.METHOD})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface AopHelperAction
+{
+ Action action();
+ AopState state();
+ AopOption option();
+
+}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/annotation/Remove.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/annotation/Remove.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/annotation/Remove.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,38 @@
+/*
+ * 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.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;;
+
+/**
+ * A Remove.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface Remove
+{
+ String state();
+ String target();
+}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/compile/CompileManager.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/compile/CompileManager.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/compile/CompileManager.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,179 @@
+/*
+ * 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.compile;
+
+import java.io.File;
+
+import org.jboss.aophelper.core.Action;
+import org.jboss.aophelper.core.AopHandler;
+import org.jboss.aophelper.core.AopOption;
+import org.jboss.aophelper.ui.compile.CompileMediator;
+import org.jboss.aophelper.util.AopCompileCommand;
+
+/**
+ * A CompileManager.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class CompileManager
+{
+ private CompileMediator mediator;
+
+ public CompileManager()
+ {
+ mediator = CompileMediator.instance();
+ }
+
+ public void performAction(Action a, AopOption to)
+ {
+ if(a.equals(Action.ADD))
+ {
+ if(to.equals(AopOption.CLASSPATH))
+ addClasspath();
+ else if(to.equals(AopOption.AOPXML))
+ addXml();
+ else if(to.equals(AopOption.SUPPRESS))
+ setSuppress(true);
+ else if(to.equals(AopOption.VERBOSE))
+ setVerbose(true);
+ else if(to.equals(AopOption.NOOPT))
+ setNoopt(true);
+ }
+ else if(a.equals(Action.REMOVE))
+ {
+ if(to.equals(AopOption.CLASSPATH))
+ removeClasspath();
+ else if(to.equals(AopOption.AOPXML))
+ removeXml();
+ else if(to.equals(AopOption.SUPPRESS))
+ setSuppress(false);
+ else if(to.equals(AopOption.VERBOSE))
+ setVerbose(false);
+ else if(to.equals(AopOption.NOOPT))
+ setNoopt(false);
+ }
+ else if(a.equals(Action.SET))
+ {
+ if(to.equals(AopOption.WORKINGDIR))
+ setWorkingdir();
+ }
+ else if(a.equals(Action.RUN))
+ {
+ compile();
+ }
+
+ }
+
+ private void addClasspath()
+ {
+ File[] files = mediator.getHelperFrame().createFileCooser();
+
+ System.out.println("got "+files.length+" number of files");
+
+ for(File f : files)
+ {
+ AopHandler.instance().getCompile().addClasspath(f.getAbsolutePath());
+ mediator.getClasspathModel().addRow(f.getAbsolutePath());
+ }
+ }
+
+ private void removeClasspath()
+ {
+ String selected = mediator.getClasspathTable().getSelectedItem();
+ if(selected != null)
+ {
+ AopHandler.instance().getCompile().removeClasspath(selected);
+ mediator.getClasspathModel().removeRow(selected);
+ mediator.getClasspathTable().clearSelectedItem();
+ }
+ }
+
+ private void addXml()
+ {
+ File[] files = mediator.getHelperFrame().createFileCooser();
+
+ System.out.println("got "+files.length+" number of files");
+
+ for(File f : files)
+ {
+ AopHandler.instance().getCompile().addXml(f.getAbsolutePath());
+ mediator.getXmlModel().addRow(f.getAbsolutePath());
+ }
+ }
+
+ private void removeXml()
+ {
+ String selected = mediator.getXmlTable().getSelectedItem();
+ if(selected != null)
+ {
+ AopHandler.instance().getCompile().removeClasspath(selected);
+ mediator.getXmlModel().removeRow(selected);
+ mediator.getXmlTable().clearSelectedItem();
+ }
+ }
+
+ private void setVerbose(boolean verbose)
+ {
+ AopHandler.instance().getCompile().setVerbose(verbose);
+ }
+
+ private void setSuppress(boolean suppress)
+ {
+ AopHandler.instance().getCompile().setSuppress(suppress);
+ }
+
+ private void setNoopt(boolean noopt)
+ {
+ AopHandler.instance().getCompile().setNoopt(noopt);
+ }
+
+ private void setWorkingdir()
+ {
+ File[] files = mediator.getHelperFrame().createFileCooser();
+ for(File f : files)
+ {
+ AopHandler.instance().getCompile().setWorkingdir(f.getAbsolutePath());
+ mediator.getCompileOptionsPane().setWorkingDir(f.getAbsolutePath());
+ }
+ }
+
+ private void compile()
+ {
+ System.out.println("LETS COMPILE!");
+ AopCompileCommand compile = new AopCompileCommand();
+ String output = compile.execute();
+ mediator.getOutputPane().setText(output);
+ System.out.println("output: "+output);
+//
+// java.util.Properties props = System.getProperties();
+// java.util.Enumeration<?> e = props.propertyNames();
+//
+// while(e.hasMoreElements())
+// System.out.println(e.toString());
+
+ System.out.println("CLASSPATH: "+System.getProperty("java.class.path"));
+
+ }
+
+
+}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/Action.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/Action.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/Action.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,37 @@
+/*
+ * 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.core;
+
+/**
+ * A generic action on properties.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public enum Action
+{
+ ADD,
+ REMOVE,
+ COMPILE,
+ RUN,
+ SET;
+}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopCompile.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopCompile.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopCompile.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,271 @@
+/*
+ * 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.core;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A Compile.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class AopCompile implements Serializable
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+ private List<String> aopXml;
+ private List<String> classpath;
+ private List<String> transformPath;
+ private List<String> aopClasspath;
+
+ /** Set the verbose level of the compiler */
+ private boolean verbose;
+
+ private boolean suppress;
+
+ private boolean noopt;
+
+ private boolean report;
+
+ private String workingdir;
+
+ public AopCompile()
+ {
+ aopXml = new ArrayList<String>();
+ classpath = new ArrayList<String>();
+ transformPath = new ArrayList<String>();
+ aopClasspath = new ArrayList<String>();
+ }
+
+ /**
+ * Get the aopXml.
+ *
+ * @return the aopXml.
+ */
+ public List<String> getAopXml()
+ {
+ return aopXml;
+ }
+
+ /**
+ * Set the aopXml.
+ *
+ * @param aopXml The aopXml to set.
+ */
+ public void setAopXml(List<String> aopXml)
+ {
+ this.aopXml = aopXml;
+ }
+
+ /**
+ * Get the classpath.
+ *
+ * @return the classpath.
+ */
+ public List<String> getClasspath()
+ {
+ return classpath;
+ }
+
+ /**
+ * Set the classpath.
+ *
+ * @param classpath The classpath to set.
+ */
+ public void setClasspath(List<String> classpath)
+ {
+ this.classpath = classpath;
+ }
+
+ public void removeClasspath(String cp)
+ {
+ if(classpath.contains(cp))
+ classpath.remove(cp);
+ }
+
+ public void addClasspath(String cp)
+ {
+ if(!classpath.contains(cp))
+ classpath.add(cp);
+ }
+
+
+ public void removeXml(String cp)
+ {
+ if(aopXml.contains(cp))
+ aopXml.remove(cp);
+ }
+
+ public void addXml(String cp)
+ {
+ if(!aopXml.contains(cp))
+ aopXml.add(cp);
+ }
+
+ /**
+ * Get the transformPath.
+ *
+ * @return the transformPath.
+ */
+ public List<String> getTransformPath()
+ {
+ return transformPath;
+ }
+
+ /**
+ * Set the transformPath.
+ *
+ * @param transformPath The transformPath to set.
+ */
+ public void setTransformPath(List<String> transformPath)
+ {
+ this.transformPath = transformPath;
+ }
+
+ /**
+ * Get the aopClasspath.
+ *
+ * @return the aopClasspath.
+ */
+ public List<String> getAopClasspath()
+ {
+ return aopClasspath;
+ }
+
+ /**
+ * Set the aopClasspath.
+ *
+ * @param aopClasspath The aopClasspath to set.
+ */
+ public void setAopClasspath(List<String> aopClasspath)
+ {
+ this.aopClasspath = aopClasspath;
+ }
+
+ /**
+ * Get the verbose.
+ *
+ * @return the verbose.
+ */
+ public boolean isVerbose()
+ {
+ return verbose;
+ }
+
+ /**
+ * Set the verbose.
+ *
+ * @param verbose The verbose to set.
+ */
+ public void setVerbose(boolean verbose)
+ {
+ this.verbose = verbose;
+ }
+
+ /**
+ * Get the suppress.
+ *
+ * @return the suppress.
+ */
+ public boolean isSuppress()
+ {
+ return suppress;
+ }
+
+ /**
+ * Set the suppress.
+ *
+ * @param suppress The suppress to set.
+ */
+ public void setSuppress(boolean suppress)
+ {
+ this.suppress = suppress;
+ }
+
+ /**
+ * Get the noopt.
+ *
+ * @return the noopt.
+ */
+ public boolean isNoopt()
+ {
+ return noopt;
+ }
+
+ /**
+ * Set the noopt.
+ *
+ * @param noopt The noopt to set.
+ */
+ public void setNoopt(boolean noopt)
+ {
+ System.out.println("setting noopt to: "+noopt);
+ this.noopt = noopt;
+ }
+
+ /**
+ * Get the report.
+ *
+ * @return the report.
+ */
+ public boolean isReport()
+ {
+ return report;
+ }
+
+ /**
+ * Set the report.
+ *
+ * @param report The report to set.
+ */
+ public void setReport(boolean report)
+ {
+ this.report = report;
+ }
+
+ /**
+ * Get the workingdir.
+ *
+ * @return the workingdir.
+ */
+ public String getWorkingdir()
+ {
+ return workingdir;
+ }
+
+ /**
+ * Set the workingdir.
+ *
+ * @param workingdir The workingdir to set.
+ */
+ public void setWorkingdir(String workingdir)
+ {
+ this.workingdir = workingdir;
+ }
+
+
+
+}
Added: 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 (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopHandler.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,107 @@
+/*
+ * 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.core;
+
+/**
+ * A AopHandler.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class AopHandler
+{
+ 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()
+ {
+ return handler;
+ }
+
+ /**
+ * 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.
+ */
+ public AopRun getRun()
+ {
+ return run;
+ }
+
+ /**
+ * Set the run.
+ *
+ * @param run The run to set.
+ */
+ public void setRun(AopRun run)
+ {
+ 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);
+// }
+
+
+
+}
Added: 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 (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopOption.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,40 @@
+/*
+ * 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.core;
+
+/**
+ * The specified option that an action will be performed on.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public enum AopOption
+{
+ CLASSPATH,
+ AOPXML,
+ WORKINGDIR,
+ VERBOSE,
+ SUPPRESS,
+ NOOPT,
+ REPORT,
+ UNSPECIFIED;
+}
Added: 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 (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopRun.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,33 @@
+/*
+ * 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.core;
+
+/**
+ * A AopRun.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class AopRun
+{
+
+}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopState.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopState.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/AopState.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,35 @@
+/*
+ * 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.core;
+
+/**
+ * The specified state the application is in.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public enum AopState
+{
+ UNSPECIFIED,
+ COMPILE,
+ RUN;
+}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/SettingInterceptor.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/SettingInterceptor.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/core/SettingInterceptor.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,59 @@
+/*
+ * 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.core;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.aophelper.annotation.AopHelperAction;
+import org.jboss.aophelper.compile.CompileManager;
+
+/**
+ * A ClasspathInterceptor.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class SettingInterceptor implements Interceptor
+{
+
+ public String getName()
+ {
+ return "ClasspathInterceptor";
+ }
+
+ public Object invoke(Invocation invocation) throws Throwable
+ {
+ AopHelperAction helperAction = (AopHelperAction) invocation.resolveAnnotation(org.jboss.aophelper.annotation.AopHelperAction.class);
+ System.out.println("state: "+helperAction.state().name());
+
+ System.out.println("option: "+helperAction.option().name());
+ System.out.println("action: "+helperAction.action().name());
+
+ if(helperAction.state().equals(AopState.COMPILE))
+ {
+ new CompileManager().performAction(helperAction.action(), helperAction.option());
+ }
+
+ return invocation.invokeNext();
+ }
+
+}
Added: 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 (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/AopHelperFrame.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,131 @@
+/*
+ * 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 java.awt.Dimension;
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.io.File;
+
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.WindowConstants;
+
+import org.jboss.aophelper.ui.compile.CompileMediator;
+import org.jboss.aophelper.ui.compile.CompilerPane;
+
+/**
+ * A AopHelperFrame.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class AopHelperFrame extends JFrame
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+ private JFileChooser fc;
+
+ public AopHelperFrame()
+ {
+ super("AopHelper");
+ setup();
+ }
+
+ private void setup()
+ {
+ // set an icon on the main widget
+// setIconImage(Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("/gicon.jpg")));
+
+ setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+
+// getContentPane().setLayout(new FlowLayout());
+// getContentPane().add(new CompilerPane());
+ setContentPane(new CompilerPane());
+
+ setSize(1024, 768);
+// setSize(600, 400);
+
+ setLocation();
+ setVisible(true);
+
+ CompileMediator.instance().setHelperFrame(this);
+ fc = new JFileChooser();
+ fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
+ fc.setMultiSelectionEnabled(true);
+
+
+ }
+
+ public void setLocation() {
+ // Get the size of the screen
+ Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
+
+ // Determine the new location of the window
+ int w = this.getSize().width;
+ int h = this.getSize().height;
+ int x = (dim.width - w)/2;
+ int y = (dim.height - h)/2;
+
+ // Move the window
+ this.setLocation(x, y);
+ }
+
+ /**
+ * Get the midpoint based on the main location
+ *
+ * @param width
+ * @param height
+ * @return
+ */
+ public Point getMidPoint(int width, int height ) {
+ Point loc = this.getLocation();
+ Dimension mainSize = this.getSize();
+
+ return new Point( (int) (mainSize.getWidth() / 2) - (width / 2) + (int) loc.getX(),
+ (int) (mainSize.getHeight() / 2) - (height / 2) + (int) loc.getY() );
+ }
+
+ public File[] createFileCooser()
+ {
+ int returnVal = fc.showOpenDialog(this);
+ if (returnVal == JFileChooser.APPROVE_OPTION)
+ {
+ File[] files = fc.getSelectedFiles();
+ //This is where a real application would save the file.
+ System.out.println("Saving: " + files[0].getAbsolutePath());
+ return files;
+ }
+ else
+ {
+ System.out.println("Save command cancelled by user.");
+ return new File[0];
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ new AopHelperFrame();
+ }
+
+}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/GenericEditTableModel.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/GenericEditTableModel.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/GenericEditTableModel.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,118 @@
+/*
+ * 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 java.util.List;
+
+import javax.swing.table.AbstractTableModel;
+
+/**
+ * A GenericEditTableModel.
+ *
+ * @author <a href="stalep at gmail.com">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class GenericEditTableModel extends AbstractTableModel
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+ private int numColumns = 1;
+ private int rows = 0;
+
+// private List<String> data;
+
+ public GenericEditTableModel()
+ {
+// data = new ArrayList<String>();
+ }
+
+ public abstract List<String> getData();
+
+
+ public int getColumnCount()
+ {
+ return numColumns;
+ }
+
+ public int getRowCount()
+ {
+ return rows;
+ }
+
+ public String getValueAt(int rowIndex, int columnIndex)
+ {
+ return getData().get(rowIndex);
+ }
+
+ @Override
+ public String getColumnName(int column)
+ {
+ return "Classpath";
+ }
+
+ /**
+ * JTable uses this method to determine the default renderer/
+ * editor for each cell.
+ */
+ @Override
+ public Class<?> getColumnClass(int c)
+ {
+ return getValueAt(0, c).getClass();
+ }
+
+ /**
+ * Set all cells noneditable
+ *
+ * @return false;
+ */
+ @Override
+ public boolean isCellEditable(int row, int col)
+ {
+ return false;
+ }
+
+ public void addRow(String cp)
+ {
+ System.out.println("adding row: "+cp);
+
+ if(cp != null && !getData().contains(cp))
+ {
+ rows++;
+ getData().add(cp);
+ fireTableRowsInserted(rows, rows);
+ }
+ }
+
+ public void removeRow(String row)
+ {
+ if(row != null)
+ {
+ System.out.println("removing row: "+row);
+ getData().remove(row);
+ rows--;
+ fireTableDataChanged();
+ }
+ }
+
+
+}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/GenericEditTablePane.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/GenericEditTablePane.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/GenericEditTablePane.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,144 @@
+/*
+ * 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 java.awt.BorderLayout;
+import java.awt.Point;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+
+/**
+ * A GenericEditTablePane.
+ *
+ * @author <a href="stalep at gmail.com">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class GenericEditTablePane extends JPanel
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ private JTable table;
+// private ClasspathTableModel tableModel;
+ private JScrollPane scrollPane;
+ private int selectedRow;
+ private String selected;
+
+ public GenericEditTablePane()
+ {
+ init();
+
+ }
+
+ protected void init()
+ {
+
+ GenericEditTableModel tableModel = getTableModel();
+ table = new JTable(tableModel);
+
+ table.setColumnSelectionAllowed(false);
+ table.setCellSelectionEnabled(false);
+ table.setRowSelectionAllowed(true);
+ table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ table.getTableHeader().setReorderingAllowed(false);
+
+ scrollPane = new JScrollPane(table);
+
+ //Add the scroll pane to this window.
+ setLayout(new BorderLayout());
+ add(scrollPane, BorderLayout.CENTER);
+
+ table.addMouseListener( new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent e) {
+ //int selRow = tree.getRowForLocation(e.getX(), e.getY());
+ if(e.getClickCount() == 1) {
+ Point p = new Point(e.getX(), e.getY());
+ System.out.println("Point: "+p.toString());
+
+ //selectedRow = table.rowAtPoint(new Point(e.getX(), e.getY() ));
+ selectedRow = table.rowAtPoint( new Point(e.getX(), e.getY()));
+ table.setRowSelectionInterval(selectedRow, selectedRow);
+
+ try {
+ String item = getTableModel().getValueAt(selectedRow, 0);
+ notifyAction();
+ setSelectedItem(item);
+ }
+ catch(Exception ex) {
+ System.err.println("ERROR: when selecting an item");
+ }
+
+ if(e.getButton() == MouseEvent.BUTTON3) {
+ //System.out.println("right click");
+
+// createSelectMenu(e.getX(),
+// e.getY() - scrollPane.getVerticalScrollBar().getValue());
+ }
+
+ }
+ /*
+ else if(e.getClickCount() == 2) {
+ }
+ */
+ }
+ });
+
+
+// CompileMediator.instance().setClasspathModel(tableModel);
+// CompileMediator.instance().setClasspathTable(this);
+ setMediatorTableModel();
+ setMediatorJPanel();
+
+ }
+
+ public abstract void setMediatorTableModel();
+
+ public abstract void setMediatorJPanel();
+
+ public abstract GenericEditTableModel getTableModel();
+
+ public abstract void notifyAction();
+
+ private void setSelectedItem(String item)
+ {
+ System.out.println("selected item is: "+item);
+ selected = item;
+ }
+
+ public String getSelectedItem()
+ {
+ return selected;
+ }
+
+ public void clearSelectedItem()
+ {
+ selected = null;
+ }
+
+}
Added: 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 (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/CompileMediator.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,167 @@
+/*
+ * 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.AopHelperFrame;
+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 AopHelperFrame helperFrame;
+
+ private CompileMediator()
+ {
+
+ }
+
+ public static CompileMediator instance()
+ {
+ return mediator;
+ }
+
+ public void setClasspathTable(ClasspathTablePane table)
+ {
+ this.classpathTable = table;
+ }
+
+ public ClasspathTablePane getClasspathTable()
+ {
+ return classpathTable;
+ }
+
+
+
+ public void setHelperFrame(AopHelperFrame ahf)
+ {
+ helperFrame = ahf;
+ }
+
+ public AopHelperFrame getHelperFrame()
+ {
+ return helperFrame;
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * FIXME Comment this
+ *
+ * @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;
+ }
+
+}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/CompilerPane.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/CompilerPane.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/CompilerPane.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,73 @@
+/*
+ * 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 java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JSplitPane;
+
+import org.jboss.aophelper.ui.compile.classpath.ClasspathPane;
+import org.jboss.aophelper.ui.compile.options.CompileOptionsPane;
+import org.jboss.aophelper.ui.compile.xml.XmlPane;
+
+/**
+ * A CompilerFrame.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class CompilerPane extends JPanel
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ public CompilerPane()
+ {
+ Dimension size = new Dimension(1024, 768);
+ this.setPreferredSize(size);
+ this.setLayout(new FlowLayout());
+
+ JPanel setupPanel = new JPanel();
+ setupPanel.setPreferredSize(new Dimension(1024,450));
+
+
+ JSplitPane mainSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, setupPanel, new OutputPane());
+ mainSplitPane.setPreferredSize(size);
+
+ //setupPanel
+ JPanel tablePane = new JPanel(new BorderLayout());
+ JSplitPane setupSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, tablePane, new CompileOptionsPane());
+ setupPanel.add(setupSplit, BorderLayout.NORTH);
+ setupSplit.setPreferredSize(new Dimension(1024, 450));
+ JSplitPane tableSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, new ClasspathPane(), new XmlPane());
+ tablePane.add(tableSplit, BorderLayout.NORTH);
+ tableSplit.setPreferredSize(new Dimension(500, 450));
+
+ add(mainSplitPane);
+ }
+
+}
Added: 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 (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/OutputPane.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,77 @@
+/*
+ * 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 java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+
+/**
+ * A OutputPane.
+ *
+ * @author <a href="stalep at gmail.com">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class OutputPane extends JPanel
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ private JTextArea outputArea;
+ public OutputPane()
+ {
+ init();
+ }
+
+ private void init()
+ {
+ CompileMediator.instance().setOutputPane(this);
+
+ setBackground(Color.white);
+ setLayout(new FlowLayout());
+
+ outputArea = new JTextArea();
+ outputArea.setText("logs from the aopcompile will be seen here");
+ outputArea.setLineWrap(true);
+ outputArea.setWrapStyleWord(true);
+ outputArea.setEditable(false);
+ JScrollPane longScroll = new JScrollPane(outputArea);
+ longScroll.setVisible(true);
+ longScroll.setPreferredSize(new Dimension(1020, 270));
+
+ add(longScroll, BorderLayout.CENTER);
+
+ }
+
+ public void setText(String text)
+ {
+ outputArea.setText(text);
+ }
+
+}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathEditPane.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathEditPane.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathEditPane.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,105 @@
+/*
+ * 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.classpath;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.jboss.aophelper.annotation.AopHelperAction;
+import org.jboss.aophelper.core.Action;
+import org.jboss.aophelper.core.AopState;
+import org.jboss.aophelper.core.AopOption;
+
+/**
+ * A ClasspathEditPanel.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class ClasspathEditPane extends JPanel
+{
+
+ private JButton addButton;
+ private JButton removeButton;
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ public ClasspathEditPane()
+ {
+ init();
+ }
+
+ private void init()
+ {
+// setLayout(new BorderLayout());
+ addButton = new JButton("Add to Classpath");
+ removeButton = new JButton("Remove from Classpath");
+
+
+ ActionListener action = new ActionListener()
+ {
+ public void actionPerformed(ActionEvent event)
+ {
+ if(event.getSource() == addButton)
+ {
+ System.out.println("We need to add");
+ add();
+
+ }
+ else if(event.getSource() == removeButton)
+ {
+ System.out.println("remove");
+ remove();
+
+ }
+ }
+ };
+ addButton.addActionListener(action);
+ removeButton.addActionListener(action);
+
+ add(addButton); //, BorderLayout.CENTER);
+ add(removeButton); //, BorderLayout.CENTER);
+
+ }
+
+ @AopHelperAction(
+ action=Action.ADD,
+ state=AopState.COMPILE,
+ option=AopOption.CLASSPATH)
+ public void add()
+ {
+ }
+
+ @AopHelperAction(
+ action=Action.REMOVE,
+ state=AopState.COMPILE,
+ option=AopOption.CLASSPATH)
+ public void remove()
+ {
+
+ }
+
+}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathPane.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathPane.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathPane.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,60 @@
+/*
+ * 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.classpath;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+
+import javax.swing.JPanel;
+
+/**
+ * A ClasspathPane.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class ClasspathPane extends JPanel
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ public ClasspathPane()
+ {
+ init();
+ }
+
+ private void init()
+ {
+ setLayout(new BorderLayout());
+
+ ClasspathTablePane classpathTable = new ClasspathTablePane();
+ ClasspathEditPane classpathEditPane = new ClasspathEditPane();
+
+ add(classpathEditPane, BorderLayout.NORTH);
+ add(classpathTable, BorderLayout.CENTER);
+
+ Dimension size = new Dimension(500, 200);
+ setPreferredSize(size);
+
+ }
+}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathTableModel.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathTableModel.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathTableModel.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,61 @@
+/*
+ * 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.classpath;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.aophelper.ui.GenericEditTableModel;
+
+/**
+ * A ClasspathTableModel.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class ClasspathTableModel extends GenericEditTableModel
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+
+ private List<String> data;
+
+ public ClasspathTableModel()
+ {
+ data = new ArrayList<String>();
+ }
+
+ @Override
+ public List<String> getData()
+ {
+ return data;
+ }
+
+ @Override
+ public String getColumnName(int column)
+ {
+ return "Classpath";
+ }
+
+}
Added: 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 (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/classpath/ClasspathTablePane.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,80 @@
+/*
+ * 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.classpath;
+
+import org.jboss.aophelper.annotation.AopHelperAction;
+import org.jboss.aophelper.core.Action;
+import org.jboss.aophelper.core.AopOption;
+import org.jboss.aophelper.core.AopState;
+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.
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class ClasspathTablePane extends GenericEditTablePane
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ private ClasspathTableModel tableModel;
+
+ public ClasspathTablePane()
+ {
+ init();
+ }
+
+
+ @Override
+ public void setMediatorTableModel()
+ {
+ if(tableModel == null)
+ tableModel = new ClasspathTableModel();
+ System.out.println("setting tablemodel to the mediator: "+tableModel.getClass().getName());
+ CompileMediator.instance().setClasspathModel(tableModel);
+ }
+
+ @Override
+ public void setMediatorJPanel()
+ {
+ CompileMediator.instance().setClasspathTable(this);
+ }
+
+ @Override
+ public GenericEditTableModel getTableModel()
+ {
+ return tableModel;
+ }
+
+ @Override
+ @AopHelperAction(action=Action.SET, state=AopState.UNSPECIFIED, option=AopOption.CLASSPATH)
+ public void notifyAction()
+ {
+
+ }
+}
Added: 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 (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/options/CompileOptionsPane.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,219 @@
+/*
+ * 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.options;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.jboss.aophelper.annotation.AopHelperAction;
+import org.jboss.aophelper.core.Action;
+import org.jboss.aophelper.core.AopOption;
+import org.jboss.aophelper.core.AopState;
+import org.jboss.aophelper.ui.compile.CompileMediator;
+
+/**
+ * A CompileOptionsPane.
+ *
+ * @author <a href="stalep at gmail.com">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class CompileOptionsPane extends JPanel
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ private JCheckBox verbose, suppress, noopt;
+ private JTextField workingdir;
+ public CompileOptionsPane()
+ {
+ init();
+ }
+
+ private void init()
+ {
+ CompileMediator.instance().setCompileOptionsPane(this);
+ setLayout(new BorderLayout());
+
+// JLabel heading = new JLabel("Settings");
+// heading.setFont(new Font("SansSerif", 1, 24));
+// add(heading, BorderLayout.NORTH);
+
+ verbose = new JCheckBox("Verbose");
+ suppress = new JCheckBox("Suppress");
+ noopt = new JCheckBox("Not optimize");
+ verbose.addItemListener(new ItemListener() {
+ public void itemStateChanged(ItemEvent ie)
+ {
+ if(ie.getStateChange() == ItemEvent.SELECTED)
+ addVerbose();
+ else
+ removeVerbose();
+ }
+ });
+
+ suppress.addItemListener(new ItemListener() {
+ public void itemStateChanged(ItemEvent ie)
+ {
+ if(ie.getStateChange() == ItemEvent.SELECTED)
+ addSuppress();
+ else
+ removeSuppress();
+ }
+ });
+
+ noopt.addItemListener(new ItemListener() {
+ public void itemStateChanged(ItemEvent ie)
+ {
+ if(ie.getStateChange() == ItemEvent.SELECTED)
+ addNoopt();
+ else
+ removeNoopt();
+ }
+ });
+
+ JPanel checkBoxPanel = new JPanel(new GridLayout(0,1));
+ JLabel checkHeading = new JLabel("Optional Settings:");
+ checkBoxPanel.setBorder(BorderFactory.createLineBorder(Color.black));
+ checkBoxPanel.add(checkHeading);
+ checkBoxPanel.add(verbose);
+ checkBoxPanel.add(suppress);
+ checkBoxPanel.add(noopt);
+
+ add(checkBoxPanel, BorderLayout.NORTH);
+// Dimension minSize = new Dimension(300, 300);
+// setMinimumSize(minSize);
+
+ JButton compile = new JButton("Compile!");
+ compile.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent event)
+ {
+ System.out.println("COMPILING!");
+ compile();
+ }
+ });
+
+ JPanel workingdirPanel = new JPanel(new FlowLayout());
+ workingdir = new JTextField("must select the working director", 20);
+ workingdir.setEditable(false);
+ JLabel workingLabel = new JLabel("Set the working directory from where aop should compile the classes");
+ workingLabel.setLabelFor(workingdir);
+ workingdirPanel.add(workingLabel);
+ workingdirPanel.add(workingdir);
+ JButton workingdirButton = new JButton("Select working directory");
+ workingdirButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent event)
+ {
+ setWorkingDir();
+ }
+ });
+ workingdirPanel.add(workingdirButton);
+
+ add(workingdirPanel, BorderLayout.CENTER);
+
+
+ add(compile, BorderLayout.SOUTH);
+ }
+
+ @AopHelperAction(
+ action=Action.ADD,
+ state=AopState.COMPILE,
+ option=AopOption.VERBOSE)
+ private void addVerbose()
+ {
+ }
+
+ @AopHelperAction(
+ action=Action.REMOVE,
+ state=AopState.COMPILE,
+ option=AopOption.VERBOSE)
+ private void removeVerbose()
+ {
+ }
+
+ @AopHelperAction(
+ action=Action.ADD,
+ state=AopState.COMPILE,
+ option=AopOption.SUPPRESS)
+ private void addSuppress()
+ {
+ }
+
+ @AopHelperAction(
+ action=Action.REMOVE,
+ state=AopState.COMPILE,
+ option=AopOption.SUPPRESS)
+ private void removeSuppress()
+ {
+ }
+
+ @AopHelperAction(
+ action=Action.ADD,
+ state=AopState.COMPILE,
+ option=AopOption.NOOPT)
+ private void addNoopt()
+ {
+ }
+
+ @AopHelperAction(
+ action=Action.REMOVE,
+ state=AopState.COMPILE,
+ option=AopOption.NOOPT)
+ private void removeNoopt()
+ {
+ }
+
+ @AopHelperAction(
+ action=Action.SET,
+ state=AopState.COMPILE,
+ option=AopOption.WORKINGDIR)
+ private void setWorkingDir()
+ {
+ }
+
+ @AopHelperAction(
+ action=Action.RUN,
+ state=AopState.COMPILE,
+ option=AopOption.UNSPECIFIED)
+ private void compile()
+ {
+ }
+
+ public void setWorkingDir(String dir)
+ {
+ workingdir.setText(dir);
+ }
+
+}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlEditPane.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlEditPane.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlEditPane.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,103 @@
+/*
+ * 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.xml;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.jboss.aophelper.annotation.AopHelperAction;
+import org.jboss.aophelper.core.Action;
+import org.jboss.aophelper.core.AopOption;
+import org.jboss.aophelper.core.AopState;
+
+/**
+ * A XmlEditPane.
+ *
+ * @author <a href="stalep at gmail.com">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class XmlEditPane extends JPanel
+{
+
+ private JButton addButton;
+ private JButton removeButton;
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ public XmlEditPane()
+ {
+ init();
+ }
+
+ private void init()
+ {
+// setLayout(new BorderLayout());
+ addButton = new JButton("Add XML file");
+ removeButton = new JButton("Remove XML file");
+
+
+ ActionListener action = new ActionListener()
+ {
+ public void actionPerformed(ActionEvent event)
+ {
+ if(event.getSource() == addButton)
+ {
+ add();
+
+ }
+ else if(event.getSource() == removeButton)
+ {
+ remove();
+ }
+ }
+ };
+ addButton.addActionListener(action);
+ removeButton.addActionListener(action);
+
+ add(addButton); //, BorderLayout.CENTER);
+ add(removeButton); //, BorderLayout.CENTER);
+
+ }
+
+ @AopHelperAction(
+ action=Action.ADD,
+ state=AopState.COMPILE,
+ option=AopOption.AOPXML)
+ private void add()
+ {
+ }
+
+ @AopHelperAction(
+ action=Action.REMOVE,
+ state=AopState.COMPILE,
+ option=AopOption.AOPXML)
+ private void remove()
+ {
+
+ }
+
+
+}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlPane.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlPane.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlPane.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,59 @@
+/*
+ * 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.xml;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+
+import javax.swing.JPanel;
+/**
+ * A XmlPane.
+ *
+ * @author <a href="stalep at gmail.com">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class XmlPane extends JPanel
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ public XmlPane()
+ {
+ init();
+ }
+
+ private void init()
+ {
+ setLayout(new BorderLayout());
+
+ XmlTablePane xmlTable = new XmlTablePane();
+ XmlEditPane xmlEditPane = new XmlEditPane();
+
+ add(xmlEditPane, BorderLayout.NORTH);
+ add(xmlTable, BorderLayout.CENTER);
+
+ Dimension size = new Dimension(500, 200);
+ setPreferredSize(size);
+ }
+
+}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlTableModel.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlTableModel.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlTableModel.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,61 @@
+/*
+ * 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.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.aophelper.ui.GenericEditTableModel;
+
+/**
+ * A XmlTableModel.
+ *
+ * @author <a href="stalep at gmail.com">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class XmlTableModel extends GenericEditTableModel
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+
+ private List<String> data;
+
+ public XmlTableModel()
+ {
+ data = new ArrayList<String>();
+ }
+
+ @Override
+ public List<String> getData()
+ {
+ return data;
+ }
+
+ @Override
+ public String getColumnName(int column)
+ {
+ return "JBoss AOP Xml";
+ }
+
+}
Added: 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 (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/ui/compile/xml/XmlTablePane.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,81 @@
+/*
+ * 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.xml;
+
+import org.jboss.aophelper.annotation.AopHelperAction;
+import org.jboss.aophelper.core.Action;
+import org.jboss.aophelper.core.AopOption;
+import org.jboss.aophelper.core.AopState;
+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.
+ *
+ * @author <a href="stalep at gmail.com">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class XmlTablePane extends GenericEditTablePane
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ private XmlTableModel tableModel;
+
+ public XmlTablePane()
+ {
+ init();
+ }
+
+
+ @Override
+ public void setMediatorTableModel()
+ {
+ if(tableModel == null)
+ tableModel = new XmlTableModel();
+// System.out.println("setting tablemodel to the mediator: "+tableModel.getClass().getName());
+ CompileMediator.instance().setXmlModel(tableModel);
+ }
+
+ @Override
+ public void setMediatorJPanel()
+ {
+ CompileMediator.instance().setXmlTable(this);
+ }
+
+ @Override
+ public GenericEditTableModel getTableModel()
+ {
+ return tableModel;
+ }
+
+ @Override
+ @AopHelperAction(action=Action.SET, state=AopState.UNSPECIFIED, option=AopOption.CLASSPATH)
+ public void notifyAction()
+ {
+
+ }
+
+}
Added: 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 (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/AopCompileCommand.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,149 @@
+/*
+ * 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;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import org.jboss.aophelper.core.AopCompile;
+import org.jboss.aophelper.core.AopHandler;
+
+/**
+ * A AopCompileCommand.
+ *
+ * @author <a href="stalep at gmail.com">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class AopCompileCommand
+{
+
+ public String execute()
+ {
+ String execute = setup();
+ try
+ {
+
+ String[] emptyArray = new String[0];
+ Process process = Runtime.getRuntime().exec( execute, emptyArray, new File(AopHandler.instance().getCompile().getWorkingdir()));
+
+ return analyzeProcess(process);
+ }
+ catch ( IOException ie )
+ {
+ System.out.println("Error while aopcompiling: "+ie.getMessage());
+ ie.printStackTrace();
+
+ return null;
+ }
+ }
+
+ private String analyzeProcess(Process process)
+ {
+ BufferedReader br = new BufferedReader( new InputStreamReader( process.getInputStream() ) );
+
+ String line;
+
+ StringBuffer output = new StringBuffer();
+
+ try
+ {
+ while ( ( line = br.readLine() ) != null )
+ {
+ System.out.println("line: "+line);
+ output.append("\n").append(line);
+ }
+ }
+ catch (IOException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ BufferedReader errorBr = new BufferedReader(new InputStreamReader(process.getErrorStream()));
+ try
+ {
+ while(( line = errorBr.readLine()) != null)
+ {
+ System.out.println("ERROR: "+line);
+ }
+ }
+ catch(IOException e)
+ {
+ e.printStackTrace();
+ }
+
+ System.out.println("INPUTSTREAM: "+output.toString());
+
+ return output.toString();
+ }
+
+
+
+ private String setup()
+ {
+ AopCompile compileOptions = AopHandler.instance().getCompile();
+
+ StringBuilder execute = new StringBuilder();
+// execute.append(getShell());
+// execute.append("\"cd ").append(compileOptions.getWorkingdir()).append("; ");
+ execute.append("java -cp ").append(CommandUtil.getAopPaths());
+ execute.append(" org.jboss.aop.standalone.Compiler ");
+ if(compileOptions.isVerbose())
+ execute.append("-verbose ");
+ if(compileOptions.isNoopt())
+ execute.append("-noopt ");
+ if(compileOptions.isSuppress())
+ execute.append("-suppress ");
+
+ if(compileOptions.getAopXml().size() > 0)
+ {
+ execute.append("-aoppath ");
+ String pathSep = System.getProperty("path.separator");
+ StringBuffer xmlPaths = new StringBuffer();
+ for(String xml : compileOptions.getAopXml())
+ {
+ if(xmlPaths.length() > 0)
+ xmlPaths.append(pathSep);
+ System.out.println("appending xml: "+xml);
+ xmlPaths.append(xml);
+ }
+ execute.append(xmlPaths.toString()).append(" ");
+ }
+
+ execute.append(compileOptions.getWorkingdir());
+
+// execute.append("\"");
+ System.out.println("EXECUTING: "+execute.toString());
+
+
+ return execute.toString();
+
+ }
+
+ private String getShell()
+ {
+ return "/bin/sh -c ";
+ }
+
+}
Added: projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/CommandUtil.java
===================================================================
--- projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/CommandUtil.java (rev 0)
+++ projects/aop/trunk/aophelper/src/main/java/org/jboss/aophelper/util/CommandUtil.java 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,61 @@
+/*
+ * 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;
+
+/**
+ * A CommandUtil.
+ *
+ * @author <a href="stalep at gmail.com">Stale W. Pedersen</a>
+ * @version $Revision: 1.1 $
+ */
+public class CommandUtil
+{
+
+ public static String getAopPaths()
+ {
+ StringBuilder aopPaths = new StringBuilder();
+ String pathSeparator = System.getProperty("path.separator");
+ String[] paths = System.getProperty("java.class.path").split(pathSeparator);
+ for(String p : paths)
+ {
+ if(p.endsWith("jboss-aop-jdk50.jar"))
+ aopPaths.append(p).append(pathSeparator);
+ else if(p.contains("trove-2"))
+ aopPaths.append(p).append(pathSeparator);
+ else if(p.contains("javassist-3"))
+ aopPaths.append(p).append(pathSeparator);
+ else if(p.contains("jboss-common-core-2"))
+ aopPaths.append(p).append(pathSeparator);
+ else if(p.contains("jboss-logging-spi-2"))
+ aopPaths.append(p).append(pathSeparator);
+ else if(p.contains("jboss-container-"))
+ aopPaths.append(p).append(pathSeparator);
+ else if(p.contains("jboss-common-logging-spi"))
+ aopPaths.append(p).append(pathSeparator);
+
+ }
+ aopPaths.append(".");
+
+ return aopPaths.toString();
+ }
+
+}
Added: projects/aop/trunk/aophelper/src/main/resources/jboss-aop.xml
===================================================================
--- projects/aop/trunk/aophelper/src/main/resources/jboss-aop.xml (rev 0)
+++ projects/aop/trunk/aophelper/src/main/resources/jboss-aop.xml 2008-09-03 13:50:14 UTC (rev 77840)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<aop>
+
+ <bind pointcut="execution(* *->@org.jboss.aophelper.annotation.AopHelperAction(..))">
+ <interceptor class="org.jboss.aophelper.core.SettingInterceptor"/>
+ </bind>
+<!--
+ <bind pointcut="execution(* *->@org.jboss.aophelper.annotation.Remove(..))">
+ <interceptor class="org.jboss.aophelper.ui.aopcompile.ClasspathInterceptor"/>
+ </bind>
+
+
+ <bind pointcut="all(@org.jboss.aop.annotation.Add)">
+ <interceptor class="org.jboss.aop.ui.aopcompile.ClasspathInterceptor"/>
+ </bind>
+ -->
+
+<!--
+ <bind pointcut="execution(public void org.jboss.aop.ui.aopcompile.*->add())">
+ <interceptor class="org.jboss.aop.ui.aopcompile.ClasspathInterceptor"/>
+ </bind>
+ -->
+
+</aop>
More information about the jboss-cvs-commits
mailing list