Revision: 5820
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=5820&view=rev
Author: manningr
Date: 2010-08-21 17:55:58 +0000 (Sat, 21 Aug 2010)
Log Message:
-----------
Initial changes to convert from Ant build to Maven build
Added Paths:
-----------
trunk/sql12/plugins/sqlparam/pom.xml
trunk/sql12/plugins/sqlparam/src/main/
trunk/sql12/plugins/sqlparam/src/main/java/
trunk/sql12/plugins/sqlparam/src/main/java/net/
trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/
trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/
trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/
trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/
trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/Resources.java
trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/SQLParamExecutionListener.java
trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/SQLParamPlugin.java
trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/gui/
trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/gui/AskParamValueDialog.java
trunk/sql12/plugins/sqlparam/src/main/resources/
trunk/sql12/plugins/sqlparam/src/main/resources/doc/
trunk/sql12/plugins/sqlparam/src/main/resources/net/
trunk/sql12/plugins/sqlparam/src/main/resources/net/sourceforge/
trunk/sql12/plugins/sqlparam/src/main/resources/net/sourceforge/squirrel_sql/
trunk/sql12/plugins/sqlparam/src/main/resources/net/sourceforge/squirrel_sql/plugins/
trunk/sql12/plugins/sqlparam/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlparam/
trunk/sql12/plugins/sqlparam/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlparam/Resources.properties
trunk/sql12/plugins/sqlparam/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlparam/gui/
trunk/sql12/plugins/sqlparam/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlparam/gui/I18NStrings.properties
trunk/sql12/plugins/sqlparam/src/test/
trunk/sql12/plugins/sqlparam/src/test/java/
trunk/sql12/plugins/sqlparam/src/test/java/net/
trunk/sql12/plugins/sqlparam/src/test/java/net/sourceforge/
trunk/sql12/plugins/sqlparam/src/test/java/net/sourceforge/squirrel_sql/
trunk/sql12/plugins/sqlparam/src/test/java/net/sourceforge/squirrel_sql/plugins/
trunk/sql12/plugins/sqlparam/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlparam/
trunk/sql12/plugins/sqlparam/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlparam/ResourcesTest.java
trunk/sql12/plugins/sqlparam/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlparam/SQLParamPluginTest.java
trunk/sql12/plugins/sqlreplace/pom.xml
trunk/sql12/plugins/sqlreplace/src/main/
trunk/sql12/plugins/sqlreplace/src/main/java/
trunk/sql12/plugins/sqlreplace/src/main/java/net/
trunk/sql12/plugins/sqlreplace/src/main/java/net/sourceforge/
trunk/sql12/plugins/sqlreplace/src/main/java/net/sourceforge/squirrel_sql/
trunk/sql12/plugins/sqlreplace/src/main/java/net/sourceforge/squirrel_sql/plugins/
trunk/sql12/plugins/sqlreplace/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlreplace/
trunk/sql12/plugins/sqlreplace/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlreplace/Replacement.java
trunk/sql12/plugins/sqlreplace/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlreplace/ReplacementManager.java
trunk/sql12/plugins/sqlreplace/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlreplace/SQLReplaceExecutionListener.java
trunk/sql12/plugins/sqlreplace/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlreplace/SQLReplacePlugin.java
trunk/sql12/plugins/sqlreplace/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlreplace/SQLReplacePreferencesController.java
trunk/sql12/plugins/sqlreplace/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlreplace/SQLReplaceResources.java
trunk/sql12/plugins/sqlreplace/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlreplace/SQLReplacementPreferencesPanel.java
trunk/sql12/plugins/sqlreplace/src/main/resources/
trunk/sql12/plugins/sqlreplace/src/main/resources/doc/
trunk/sql12/plugins/sqlreplace/src/main/resources/net/
trunk/sql12/plugins/sqlreplace/src/main/resources/net/sourceforge/
trunk/sql12/plugins/sqlreplace/src/main/resources/net/sourceforge/squirrel_sql/
trunk/sql12/plugins/sqlreplace/src/main/resources/net/sourceforge/squirrel_sql/plugins/
trunk/sql12/plugins/sqlreplace/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlreplace/
trunk/sql12/plugins/sqlreplace/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlreplace/sqlreplace.properties
trunk/sql12/plugins/sqlreplace/src/test/
trunk/sql12/plugins/sqlreplace/src/test/java/
trunk/sql12/plugins/sqlreplace/src/test/java/net/
trunk/sql12/plugins/sqlreplace/src/test/java/net/sourceforge/
trunk/sql12/plugins/sqlreplace/src/test/java/net/sourceforge/squirrel_sql/
trunk/sql12/plugins/sqlreplace/src/test/java/net/sourceforge/squirrel_sql/plugins/
trunk/sql12/plugins/sqlreplace/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlreplace/
trunk/sql12/plugins/sqlreplace/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlreplace/ReplacementManagerTest.java
trunk/sql12/plugins/sqlreplace/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlreplace/SQLReplacePluginTest.java
trunk/sql12/plugins/sqlreplace/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlreplace/SQLReplaceResourcesTest.java
trunk/sql12/plugins/sqlscript/pom.xml
trunk/sql12/plugins/sqlscript/src/main/
trunk/sql12/plugins/sqlscript/src/main/java/
trunk/sql12/plugins/sqlscript/src/main/java/net/
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/FrameWorkAcessor.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/ISessionKeys.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/SQLPluginResources.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/SQLScriptConstants.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/SQLScriptExternalService.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/SQLScriptPlugin.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/SQLScriptPreferenceBean.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/SQLScriptPreferencesManager.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/SQLScriptPreferencesPanel.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/SQLScriptPreferencesTab.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/AbortController.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateDataScriptAction.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateDataScriptCommand.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateDataScriptOfCurrentSQLAction.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateDataScriptOfCurrentSQLCommand.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateSelectScriptAction.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateSelectScriptCommand.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateTableOfCurrentSQLAction.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateTableOfCurrentSQLCommand.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateTableOfCurrentSQLCtrl.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateTableOfCurrentSQLDialog.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateTableScriptAction.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateTableScriptCommand.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateTemplateDataScriptAction.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/DropTableScriptAction.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/DropTableScriptCommand.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/IAbortController.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/ScriptUtil.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/TableScriptConfigCtrl.java
trunk/sql12/plugins/sqlscript/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/TableScriptConfigFrame.java
trunk/sql12/plugins/sqlscript/src/main/resources/
trunk/sql12/plugins/sqlscript/src/main/resources/doc/
trunk/sql12/plugins/sqlscript/src/main/resources/net/
trunk/sql12/plugins/sqlscript/src/main/resources/net/sourceforge/
trunk/sql12/plugins/sqlscript/src/main/resources/net/sourceforge/squirrel_sql/
trunk/sql12/plugins/sqlscript/src/main/resources/net/sourceforge/squirrel_sql/plugins/
trunk/sql12/plugins/sqlscript/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlscript/
trunk/sql12/plugins/sqlscript/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlscript/I18NStrings.properties
trunk/sql12/plugins/sqlscript/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlscript/images/
trunk/sql12/plugins/sqlscript/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlscript/images/copy2table.gif
trunk/sql12/plugins/sqlscript/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/
trunk/sql12/plugins/sqlscript/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/I18NStrings.properties
trunk/sql12/plugins/sqlscript/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlscript/sqlscript.properties
trunk/sql12/plugins/sqlscript/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/
trunk/sql12/plugins/sqlscript/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/I18NStrings.properties
trunk/sql12/plugins/sqlscript/src/test/
trunk/sql12/plugins/sqlscript/src/test/java/
trunk/sql12/plugins/sqlscript/src/test/java/net/
trunk/sql12/plugins/sqlscript/src/test/java/net/sourceforge/
trunk/sql12/plugins/sqlscript/src/test/java/net/sourceforge/squirrel_sql/
trunk/sql12/plugins/sqlscript/src/test/java/net/sourceforge/squirrel_sql/plugins/
trunk/sql12/plugins/sqlscript/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlscript/
trunk/sql12/plugins/sqlscript/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlscript/SQLPluginResourcesTest.java
trunk/sql12/plugins/sqlscript/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlscript/SQLScriptPluginTest.java
trunk/sql12/plugins/sqlscript/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/
trunk/sql12/plugins/sqlscript/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/SQLScriptPreferenceBeanTest.java
Removed Paths:
-------------
trunk/sql12/plugins/sqlparam/doc/
trunk/sql12/plugins/sqlparam/plugin_build.xml
trunk/sql12/plugins/sqlparam/src/net/
trunk/sql12/plugins/sqlreplace/doc/
trunk/sql12/plugins/sqlreplace/plugin_build.xml
trunk/sql12/plugins/sqlreplace/src/net/
trunk/sql12/plugins/sqlscript/doc/
trunk/sql12/plugins/sqlscript/plugin_build.xml
trunk/sql12/plugins/sqlscript/src/net/
Property Changed:
----------------
trunk/sql12/plugins/sqlparam/
trunk/sql12/plugins/sqlreplace/
trunk/sql12/plugins/sqlscript/
Property changes on: trunk/sql12/plugins/sqlparam
___________________________________________________________________
Added: svn:ignore
+ target
.settings
.project
.classpath
Deleted: trunk/sql12/plugins/sqlparam/plugin_build.xml
===================================================================
--- trunk/sql12/plugins/sqlparam/plugin_build.xml 2010-08-21 17:53:40 UTC (rev 5819)
+++ trunk/sql12/plugins/sqlparam/plugin_build.xml 2010-08-21 17:55:58 UTC (rev 5820)
@@ -1,87 +0,0 @@
-<?xml version="1.0"?>
-<!--
- This is an Apache Ant build file to build the sql param plugin
- for distribution.
--->
-<project name="plugin-sqlparam" default="build" basedir=".">
- <target name="init">
- <tstamp/>
- <property name="internal_name" value="sqlparam"/>
- <property name="version" value="1.0"/>
-
- <property name="debug" value="on"/>
- <property name="optimize" value="off"/>
- <property name="deprecation" value="on"/>
- <property name="targetVM" value="1.6"/>
-
- <echo message="---------------- ${internal_name} ${version} ----------------"/>
- <property environment="env"/>
- </target>
-
- <target name="initdirs" unless="p_plugin.work_dir">
- <property name="dist_dir" value="../../../squirrel-sql-dist/squirrel-sql"/>
- <property name="plugins_dist_dir" value="${dist_dir}/plugins"/>
- <property name="p_plugin.work_dir" value="${plugins_dist_dir}/${internal_name}/work"/>
- <property name="p_plugin.core_libs_dir" value="${dist_dir}/core/dist/lib"/>
- <property name="p_plugin.dist_dir" value="${dist_dir}/core/dist/plugins"/>
- </target>
-
- <!--
- ==================================================================
- Compile the plugin.
- No parameters.
- ==================================================================
- -->
- <target name="build" depends="init, initdirs">
- <property name="obj_dir" value="${p_plugin.work_dir}/obj"/>
-
- <mkdir dir="${obj_dir}"/>
- <mkdir dir="${p_plugin.dist_dir}"/>
-
- <javac srcdir="src"
- destdir="${obj_dir}"
- deprecation="${deprecation}"
- debug="${debug}"
- optimize="${optimize}"
- includeJavaRuntime="yes"
- source="${targetVM}"
- target="${targetVM}">
-
- <classpath>
- <fileset dir="${p_plugin.core_libs_dir}">
- <include name="**/*.*"/>
- </fileset>
- </classpath>
- </javac>
- <copy todir="${obj_dir}" >
- <fileset dir="src" >
- <include name="**/*.gif"/>
- <include name="**/*.jpg"/>
- <include name="**/*.jpeg"/>
- <include name="**/*.xml"/>
- <include name="**/*.properties"/>
- </fileset>
- </copy>
-
- <jar jarfile="${p_plugin.dist_dir}/${internal_name}.jar" compress="false">
- <fileset dir="${obj_dir}">
- <include name="**/*.*"/>
- </fileset>
- </jar>
-
- <copy todir="${p_plugin.dist_dir}/${internal_name}" >
- <fileset dir="doc" >
- <include name="*.*"/>
- </fileset>
- </copy>
-
- <jar jarfile="${p_plugin.dist_dir}/${internal_name}/src.jar" compress="false">
- <fileset dir=".">
- <include name="src/**/*.*"/>
- <include name="plugin_build.xml"/>
- </fileset>
- </jar>
- </target>
-
-</project>
-
Added: trunk/sql12/plugins/sqlparam/pom.xml
===================================================================
--- trunk/sql12/plugins/sqlparam/pom.xml (rev 0)
+++ trunk/sql12/plugins/sqlparam/pom.xml 2010-08-21 17:55:58 UTC (rev 5820)
@@ -0,0 +1,135 @@
+<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>
+ <parent>
+ <groupId>net.sf.squirrel-sql.plugins</groupId>
+ <artifactId>squirrelsql-plugins-parent-pom</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <groupId>net.sf.squirrel-sql.plugins</groupId>
+ <artifactId>sqlparam</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>Sqlparam Plugin</name>
+ <description>Sqlparam Plugin</description>
+ <inceptionYear>2001</inceptionYear>
+ <developers>
+ <developer>
+ <name>Gerd Wagner</name>
+ <roles>
+ <role>Administrator</role>
+ <role>Developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <name>Rob Manning</name>
+ <roles>
+ <role>Developer</role>
+ <role>Release Manager</role>
+ </roles>
+ </developer>
+ </developers>
+ <licenses>
+ <license>
+ <name>GNU Lesser General Public License</name>
+ <url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+ <url>http://www.squirrelsql.org/</url>
+ <scm>
+ <connection>scm:svn:https://squirrel-sql.svn.sourceforge.net/svnroot/squirrel-sql/trunk/sql12/</connection>
+ <developerConnection>scm:svn:http://squirrel-sql.svn.sourceforge.net/viewvc/squirrel-sql/trunk/sql12/</developerConnection>
+ <url>http://squirrel-sql.svn.sourceforge.net/viewvc/squirrel-sql/trunk/sql12/</url>
+ </scm>
+ <issueManagement>
+ <system>SourceForge Tracker</system>
+ <url>http://sourceforge.net/tracker/?group_id=28383%26atid=393414</url>
+ </issueManagement>
+ <ciManagement>
+ <system>Hudson</system>
+ <url>https://www.squirrel-sql.org/hudson/</url>
+ </ciManagement>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.squirrel-sql</groupId>
+ <artifactId>fw</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.squirrel-sql</groupId>
+ <artifactId>squirrel-sql</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.squirrel-sql</groupId>
+ <artifactId>squirrel-sql</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.squirrel-sql</groupId>
+ <artifactId>squirrelsql-test-utils</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>${source-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${surefire-plugin-version}</version>
+ <configuration>
+ <parallel>${surefire-parallel-type}</parallel>
+ <threadCount>${surefire-thread-count}</threadCount>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>${jar-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>${assembly-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <version>${findbugs-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <version>${pmd-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>${checkstyle-plugin-version}</version>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <!--
+ Since generating javadoc can be time-consuming, this is not done unless a "javadoc" profile is activated.
+ -->
+ <profile>
+ <id>javadoc</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>${javadoc-plugin-version}</version>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file
Copied: trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/Resources.java (from rev 5805, trunk/sql12/plugins/sqlparam/src/net/sourceforge/squirrel_sql/plugins/sqlparam/Resources.java)
===================================================================
--- trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/Resources.java (rev 0)
+++ trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/Resources.java 2010-08-21 17:55:58 UTC (rev 5820)
@@ -0,0 +1,32 @@
+package net.sourceforge.squirrel_sql.plugins.sqlparam;
+/*
+ * Copyright (C) 2007 Thorsten Mürell
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+import net.sourceforge.squirrel_sql.client.plugin.IPlugin;
+import net.sourceforge.squirrel_sql.client.plugin.PluginResources;
+
+/**
+ * Plugin resources.
+ *
+ * @author Thorsten Mürell
+ */
+public final class Resources extends PluginResources
+{
+ public Resources(IPlugin plugin) {
+ super(Resources.class.getName(), plugin);
+ }
+}
Copied: trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/SQLParamExecutionListener.java (from rev 5805, trunk/sql12/plugins/sqlparam/src/net/sourceforge/squirrel_sql/plugins/sqlparam/SQLParamExecutionListener.java)
===================================================================
--- trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/SQLParamExecutionListener.java (rev 0)
+++ trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/SQLParamExecutionListener.java 2010-08-21 17:55:58 UTC (rev 5820)
@@ -0,0 +1,200 @@
+package net.sourceforge.squirrel_sql.plugins.sqlparam;
+/*
+ * Copyright (C) 2007 Thorsten Mürell
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+import net.sourceforge.squirrel_sql.client.gui.desktopcontainer.SelectWidgetCommand;
+import net.sourceforge.squirrel_sql.client.gui.desktopcontainer.DialogWidget;
+import net.sourceforge.squirrel_sql.client.session.ISession;
+import net.sourceforge.squirrel_sql.client.session.event.ISQLExecutionListener;
+import net.sourceforge.squirrel_sql.fw.gui.GUIUtils;
+import net.sourceforge.squirrel_sql.fw.util.log.ILogger;
+import net.sourceforge.squirrel_sql.fw.util.log.LoggerController;
+import net.sourceforge.squirrel_sql.plugins.sqlparam.gui.AskParamValueDialog;
+
+import javax.swing.*;
+import java.awt.*;
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * This listener listens for SQL execution.
+ *
+ * @author Thorsten Mürell
+ */
+public class SQLParamExecutionListener implements ISQLExecutionListener {
+
+ private final static ILogger log = LoggerController.createLogger(SQLParamPlugin.class);
+ private ISession session = null;
+ private SQLParamPlugin plugin = null;
+ private AskParamValueDialog dialog = null;
+
+ /**
+ * The constructor
+ *
+ * @param plugin
+ * @param session
+ */
+ public SQLParamExecutionListener(SQLParamPlugin plugin, ISession session) {
+ this.session = session;
+ this.plugin = plugin;
+ }
+
+ /**
+ * This method is called when the SQL was executed.
+ *
+ * @param sql
+ */
+ public void statementExecuted(String sql) {
+ // log.info("SQL executed: " + sql);
+ }
+
+ /**
+ * Called prior to an individual statement being executed. If you modify the
+ * script remember to return it so that the caller knows about the
+ * modifications.
+ *
+ * @param sql The SQL to be executed.
+ *
+ * @return The SQL to be executed. If <TT>null</TT> returned then the
+ * statement will not be executed.
+ */
+ public String statementExecuting(String sql) {
+ // log.info("SQL starting to execute: " + sql);
+ StringBuffer buffer = new StringBuffer(sql);
+ Map<String, String> cache = plugin.getCache();
+ Map<String, String> currentCache = new HashMap<String, String>();
+ Pattern p = Pattern.compile(":[a-zA-Z]\\w+");
+
+ Matcher m = p.matcher(buffer);
+
+ while (m.find()) {
+ if (isQuoted(buffer, m.start()))
+ continue;
+ final String var = m.group();
+ String value = null;
+ if (currentCache.containsKey(var)) {
+ value = currentCache.get(var);
+ } else {
+ final String oldValue = cache.get(var);
+ if (SwingUtilities.isEventDispatchThread()) {
+ createParameterDialog(var, oldValue);
+ while (!dialog.isDone()) {
+ try {
+ AWTEvent event = Toolkit.getDefaultToolkit().getSystemEventQueue().getNextEvent();
+ Object source = event.getSource();
+ if (event instanceof ActiveEvent) {
+ ((ActiveEvent)event).dispatch();
+ } else if (source instanceof Component) {
+ ((Component)source).dispatchEvent(
+ event);
+ } else if (source instanceof MenuComponent) {
+ ((MenuComponent)source).dispatchEvent(
+ event);
+ } else {
+ System.err.println(
+ "Unable to dispatch: " + event);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ } else {
+ try {
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ createParameterDialog(var, oldValue);
+ }
+ });
+ while (!dialog.isDone()) {
+ wait();
+ }
+ } catch (InvocationTargetException ite) {
+ ite.printStackTrace();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+ if (dialog.isCancelled()) {
+ dialog = null;
+ return null;
+ }
+ value = sanitizeValue(dialog.getValue(), dialog.isQuotingNeeded());
+ cache.put(var, dialog.getValue());
+ currentCache.put(var, value);
+ dialog = null;
+ }
+ buffer.replace(m.start(), m.end(), value);
+ m.reset();
+ }
+
+ GUIUtils.processOnSwingEventThread(new Runnable() {
+ public void run() {
+ new SelectWidgetCommand(session.getActiveSessionWindow()).execute();
+ }
+ });
+ // log.info("SQL passing to execute: " + buffer.toString());
+ return buffer.toString();
+ }
+
+ private void createParameterDialog(String parameter, String oldValue) {
+ dialog = new AskParamValueDialog(parameter, oldValue, session.getApplication());
+ session.getApplication().getMainFrame().addWidget(dialog);
+ dialog.setLayer(JLayeredPane.MODAL_LAYER);
+ dialog.moveToFront();
+ DialogWidget.centerWithinDesktop(dialog);
+ dialog.setVisible(true);
+ }
+
+ private String sanitizeValue(String value, boolean quoting) {
+ String retValue = value;
+ boolean quotesNeeded = quoting;
+
+ try {
+ Float.parseFloat(value);
+ } catch (NumberFormatException nfe) {
+ quotesNeeded = true;
+ }
+
+ if (quotesNeeded) {
+ retValue = "'" + value + "'";
+ }
+ return retValue;
+ }
+
+ private boolean isQuoted(StringBuffer buffer, int position) {
+ String part = buffer.substring(0, position);
+ if (searchAllOccurences(part, "\"") % 2 != 0)
+ return true;
+ if (searchAllOccurences(part, "'") % 2 != 0)
+ return true;
+ return false;
+ }
+
+ private int searchAllOccurences(String haystack, String needle) {
+ int i = 0;
+ int pos = 0;
+ while ((pos = haystack.indexOf(needle, pos + 1)) > -1) {
+ i++;
+ }
+ return i;
+ }
+
+}
Copied: trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/SQLParamPlugin.java (from rev 5805, trunk/sql12/plugins/sqlparam/src/net/sourceforge/squirrel_sql/plugins/sqlparam/SQLParamPlugin.java)
===================================================================
--- trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/SQLParamPlugin.java (rev 0)
+++ trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/SQLParamPlugin.java 2010-08-21 17:55:58 UTC (rev 5820)
@@ -0,0 +1,280 @@
+package net.sourceforge.squirrel_sql.plugins.sqlparam;
+/*
+ * Copyright (C) 2007 Thorsten Mürell
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+
+import net.sourceforge.squirrel_sql.client.gui.session.ObjectTreeInternalFrame;
+import net.sourceforge.squirrel_sql.client.gui.session.SQLInternalFrame;
+import net.sourceforge.squirrel_sql.client.plugin.DefaultSessionPlugin;
+import net.sourceforge.squirrel_sql.client.plugin.PluginException;
+import net.sourceforge.squirrel_sql.client.plugin.PluginResources;
+import net.sourceforge.squirrel_sql.client.plugin.PluginSessionCallback;
+import net.sourceforge.squirrel_sql.client.session.ISQLPanelAPI;
+import net.sourceforge.squirrel_sql.client.session.ISession;
+import net.sourceforge.squirrel_sql.client.session.event.ISQLExecutionListener;
+import net.sourceforge.squirrel_sql.fw.gui.GUIUtils;
+import net.sourceforge.squirrel_sql.fw.util.log.ILogger;
+import net.sourceforge.squirrel_sql.fw.util.log.LoggerController;
+
+
+/**
+ * The plugin class.
+ *
+ * @author Thorsten Mürell
+ */
+public class SQLParamPlugin extends DefaultSessionPlugin
+{
+ private final static ILogger log = LoggerController.createLogger(SQLParamPlugin.class);
+
+ private Resources resources;
+// private static final String PREFS_FILE_NAME = "sqlparamprefs.xml";
+ Map<String, String> cache;
+
+ /**
+ * Remember which sqlpanelapis we've registered listeners with so that we
+ * can unregister them when it's time to unload.
+ */
+ HashMap<ISQLPanelAPI, ISQLExecutionListener> panelListenerMap =
+ new HashMap<ISQLPanelAPI, ISQLExecutionListener>();
+
+ /**
+ * Return the internal name of this plugin.
+ *
+ * @return the internal name of this plugin.
+ */
+ public String getInternalName()
+ {
+ return "sqlparam";
+ }
+
+ /**
+ * Return the descriptive name of this plugin.
+ *
+ * @return the descriptive name of this plugin.
+ */
+ public String getDescriptiveName()
+ {
+ return "SQL Parametrisation";
+ }
+
+ /**
+ * Returns the current version of this plugin.
+ *
+ * @return the current version of this plugin.
+ */
+ public String getVersion()
+ {
+ return "1.0.1";
+ }
+
+
+ /**
+ * Returns a comma separated list of other contributors.
+ *
+ * @return Contributors names.
+ */
+ @Override
+ public String getContributors()
+ {
+ return "";
+ }
+
+ /**
+ * Returns the authors name.
+ *
+ * @return the authors name.
+ */
+ public String getAuthor()
+ {
+ return "Thorsten Mürell";
+ }
+
+ /**
+ * Returns the name of the change log for the plugin. This should
+ * be a text or HTML file residing in the <TT>getPluginAppSettingsFolder</TT>
+ * directory.
+ *
+ * @return the changelog file name or <TT>null</TT> if plugin doesn't have
+ * a change log.
+ */
+ @Override
+ public String getChangeLogFileName()
+ {
+ return "changes.txt";
+ }
+
+ /**
+ * Returns the name of the Help file for the plugin. This should
+ * be a text or HTML file residing in the <TT>getPluginAppSettingsFolder</TT>
+ * directory.
+ *
+ * @return the Help file name or <TT>null</TT> if plugin doesn't have
+ * a help file.
+ */
+ @Override
+ public String getHelpFileName()
+ {
+ return "readme.html";
+ }
+
+ /**
+ * Returns the name of the Licence file for the plugin. This should
+ * be a text or HTML file residing in the <TT>getPluginAppSettingsFolder</TT>
+ * directory.
+ *
+ * @return the Licence file name or <TT>null</TT> if plugin doesn't have
+ * a licence file.
+ */
+ @Override
+ public String getLicenceFileName()
+ {
+ return "licence.txt";
+ }
+
+ /**
+ * Called on application startup after application started.
+ */
+ @Override
+ public void initialize() throws PluginException
+ {
+ resources = new Resources(this);
+ }
+
+ /**
+ * Called on plugin unloading.
+ */
+ @Override
+ public void unload()
+ {
+ for (Map.Entry<ISQLPanelAPI, ISQLExecutionListener> entry : panelListenerMap.entrySet()) {
+ ISQLPanelAPI api = entry.getKey();
+ ISQLExecutionListener listener = entry.getValue();
+ removeSQLExecutionListener(api, listener);
+ }
+ panelListenerMap.clear();
+ }
+
+ /**
+ *
+ */
+ @Override
+ public boolean allowsSessionStartedInBackground()
+ {
+ return true;
+ }
+
+ /**
+ * Called on session creating by callback.
+ *
+ * @param session The session
+ */
+ @Override
+ public void sessionCreated(ISession session)
+ {
+ cache = new Hashtable<String, String>();
+ }
+
+ /**
+ * Returns the value cache.
+ *
+ * @return A map caching parameters to old values
+ */
+ public Map<String, String> getCache() {
+ return cache;
+ }
+
+ /**
+ * Session has been started.
+ *
+ * @param session Session that has started.
+ * @return The callback to start on session events.
+ */
+ public PluginSessionCallback sessionStarted(final ISession session)
+ {
+ log.info("Initializing plugin");
+ ISQLPanelAPI sqlPaneAPI = session.getSessionSheet().getSQLPaneAPI();
+
+ initSQLParam(sqlPaneAPI, session);
+
+ PluginSessionCallback ret = new PluginSessionCallback()
+ {
+ public void sqlInternalFrameOpened(final SQLInternalFrame sqlInternalFrame, final ISession sess)
+ {
+ initSQLParam(sqlInternalFrame.getSQLPanelAPI(), sess);
+ }
+
+ public void objectTreeInternalFrameOpened(ObjectTreeInternalFrame objectTreeInternalFrame, ISession sess)
+ {
+ // Nothing to do if object tree is opened.
+ }
+
+ };
+
+ return ret;
+ }
+
+ /**
+ * This method is called on session closing an needs to free resources.
+ *
+ * @param session the session to be closed
+ */
+ @Override
+ public void sessionEnding(ISession session) {
+ ISQLPanelAPI sqlPaneAPI = session.getSessionSheet().getSQLPaneAPI();
+ ISQLExecutionListener listener = panelListenerMap.remove(sqlPaneAPI);
+ removeSQLExecutionListener(sqlPaneAPI, listener);
+ }
+
+ private void removeSQLExecutionListener(ISQLPanelAPI api, ISQLExecutionListener listener)
+ {
+ if (api != null && listener != null) {
+ api.removeSQLExecutionListener(listener);
+ }
+ }
+
+ private void initSQLParam(final ISQLPanelAPI sqlPaneAPI, final ISession session)
+ {
+ final SQLParamPlugin plugin = this;
+
+ GUIUtils.processOnSwingEventThread(new Runnable()
+ {
+ public void run()
+ {
+ log.info("Adding SQL execution listener.");
+ ISQLExecutionListener listener =
+ new SQLParamExecutionListener(plugin, session);
+ sqlPaneAPI.addSQLExecutionListener(listener);
+ panelListenerMap.put(sqlPaneAPI, listener);
+ }
+
+ });
+ }
+
+ /**
+ * Retrieve plugins resources.
+ *
+ * @return Plugins resources.
+ */
+ public PluginResources getResources()
+ {
+ return resources;
+ }
+
+}
Copied: trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/gui/AskParamValueDialog.java (from rev 5805, trunk/sql12/plugins/sqlparam/src/net/sourceforge/squirrel_sql/plugins/sqlparam/gui/AskParamValueDialog.java)
===================================================================
--- trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/gui/AskParamValueDialog.java (rev 0)
+++ trunk/sql12/plugins/sqlparam/src/main/java/net/sourceforge/squirrel_sql/plugins/sqlparam/gui/AskParamValueDialog.java 2010-08-21 17:55:58 UTC (rev 5820)
@@ -0,0 +1,242 @@
+package net.sourceforge.squirrel_sql.plugins.sqlparam.gui;
+/*
+ * Copyright (C) 2007 Thorsten Mürell
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+import com.jgoodies.forms.builder.PanelBuilder;
+import com.jgoodies.forms.layout.CellConstraints;
+import com.jgoodies.forms.layout.FormLayout;
+import net.sourceforge.squirrel_sql.client.IApplication;
+import net.sourceforge.squirrel_sql.client.gui.IOkClosePanelListener;
+import net.sourceforge.squirrel_sql.client.gui.OkClosePanel;
+import net.sourceforge.squirrel_sql.client.gui.OkClosePanelEvent;
+import net.sourceforge.squirrel_sql.client.gui.desktopcontainer.DialogWidget;
+import net.sourceforge.squirrel_sql.fw.util.StringManager;
+import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
+
+import javax.swing.*;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import java.awt.*;
+
+
+/**
+ * The dialog to ask the user for a value.
+ *
+ * @author Thorsten Mürell
+ */
+public class AskParamValueDialog extends DialogWidget
+{
+ private static final long serialVersionUID = 3470927611018381204L;
+
+
+ private static final StringManager stringMgr =
+ StringManagerFactory.getStringManager(AskParamValueDialog.class);
+
+ private OkClosePanel btnsPnl = new OkClosePanel();
+ private JTextField value = new JTextField();
+ private JCheckBox quote = new JCheckBox();
+ private String parameter = null;
+ private String oldValue = null;
+
+ private boolean done = false;
+ private boolean cancelled = false;
+
+ /**
+ * Creates the dialog.
+ *
+ * @param parameter The name of the parameter to replace.
+ * @param oldValue The old value of the parameter to provide as a default.
+ * @param application
+ */
+ public AskParamValueDialog(String parameter, String oldValue, IApplication application) {
+ //i18n[sqlparam.inputParameterValues=Please input the parameter values]
+ super(stringMgr.getString("sqlparam.inputParameterValues"), true, application);
+ this.parameter = parameter;
+ this.oldValue = oldValue;
+
+ setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+ makeToolWindow(true);
+
+ final JPanel content = new JPanel(new BorderLayout());
+ content.add(createMainPanel(), BorderLayout.CENTER);
+ setContentPane(content);
+ btnsPnl.makeOKButtonDefault();
+ btnsPnl.getRootPane().setDefaultButton(btnsPnl.getOKButton());
+ pack();
+ }
+
+ /**
+ * @return <code>true</code> if the dialog is done
+ */
+ public boolean isDone() {
+ return done;
+ }
+
+ /**
+ * If the user doesn't want to input a value, he hits the close
+ * button. The this method returns true.
+ *
+ * @return <code>true</code> if the dialog was cancelled by the user.
+ */
+ public boolean isCancelled() {
+ return cancelled;
+ }
+
+ /**
+ * Sets the value of the dialog.
+ *
+ * @param defaultValue the value to set as a default in this dialog.
+ */
+ public void setValue(String defaultValue) {
+ value.setText(defaultValue);
+ }
+
+ /**
+ * Gets the value of the input field in this dialog.
+ *
+ * @return The value for the parameter.
+ */
+ public String getValue() {
+ return value.getText();
+ }
+
+ /**
+ * Returns if quotes around the value are needed.
+ *
+ * @return <code>true</code> if quoting is needed.
+ */
+ public boolean isQuotingNeeded() {
+ return quote.isSelected();
+ }
+
+ private void updateCheckbox() {
+ boolean isNumber = false;
+
+ try {
+ Float.parseFloat(value.getText());
+ isNumber = true;
+ } catch (NumberFormatException nfe) {
+ isNumber = false;
+ }
+
+ if (isNumber) {
+ quote.setSelected(false);
+ quote.setEnabled(true);
+ } else {
+ quote.setSelected(true);
+ quote.setEnabled(false);
+ }
+ }
+
+ private Component createMainPanel()
+ {
+ value.setColumns(20);
+ value.setText(oldValue);
+ value.getDocument().addDocumentListener(new DocumentListener() {
+ public void changedUpdate(DocumentEvent e) { AskParamValueDialog.this.updateCheckbox(); }
+ public void insertUpdate(DocumentEvent e) { AskParamValueDialog.this.updateCheckbox(); }
+ public void removeUpdate(DocumentEvent e) { AskParamValueDialog.this.updateCheckbox(); }
+ });
+ updateCheckbox();
+ btnsPnl.addListener(new MyOkClosePanelListener());
+
+ final FormLayout layout = new FormLayout(
+ // Columns
+ "right:pref, 8dlu, left:min(100dlu;pref):grow",
+ // Rows
+ "pref, 6dlu, pref, 6dlu, pref, 6dlu, pref, 6dlu, pref, 3dlu, pref, 3dlu, pref");
+
+ PanelBuilder builder = new PanelBuilder(layout);
+ CellConstraints cc = new CellConstraints();
+ builder.setDefaultDialogBorder();
+
+ int y = 1;
+ builder.addSeparator(getTitle(), cc.xywh(1, y, 3, 1));
+
+ y += 2;
+ //i18n[sqlparam.valueFor=Value for {0}]
+ builder.addLabel(stringMgr.getString("sqlparam.valueFor", parameter), cc.xy(1, y));
+ builder.add(value, cc.xywh(3, y, 1, 1));
+
+ y += 2;
+ //i18n[sqlparam.quoteValues=Quote Values]
+ builder.addLabel(stringMgr.getString("sqlparam.quoteValues"), cc.xy(1, y));
+ builder.add(quote, cc.xywh(3, y, 1, 1));
+
+ y += 2;
+ builder.addSeparator("", cc.xywh(1, y, 3, 1));
+
+ y += 2;
+ builder.add(btnsPnl, cc.xywh(1, y, 3, 1));
+
+ return builder.getPanel();
+ }
+
+ /**
+ * Cancels the dialog.
+ */
+ public void cancel() {
+ done = true;
+ cancelled = true;
+ dispose();
+ }
+
+ /**
+ * Confirms the dialog.
+ */
+ public void ok() {
+ done = true;
+ dispose();
+ }
+
+
+
+ private final class MyOkClosePanelListener implements IOkClosePanelListener
+ {
+ /**
+ * Callback for the ok key.
+ *
+ * @param evt the event
+ */
+ public void okPressed(OkClosePanelEvent evt)
+ {
+ AskParamValueDialog.this.ok();
+ }
+
+ /**
+ * Callback for the close key.
+ *
+ * @param evt the event
+ */
+ public void closePressed(OkClosePanelEvent evt)
+ {
+ AskParamValueDialog.this.cancel();
+ }
+
+ /**
+ * Callback for the cancel key.
+ *
+ * @param evt the event
+ */
+ public void cancelPressed(OkClosePanelEvent evt)
+ {
+ AskParamValueDialog.this.cancel();
+ }
+ }
+
+}
Copied: trunk/sql12/plugins/sqlparam/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlparam/Resources.properties (from rev 5805, trunk/sql12/plugins/sqlparam/src/net/sourceforge/squirrel_sql/plugins/sqlparam/Resources.properties)
===================================================================
--- trunk/sql12/plugins/sqlparam/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlparam/Resources.properties (rev 0)
+++ trunk/sql12/plugins/sqlparam/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlparam/Resources.properties 2010-08-21 17:55:58 UTC (rev 5820)
@@ -0,0 +1,9 @@
+############################
+# Resources.properties
+
+
+########
+# Path to images. Should be terminated with a forward slash.
+########
+path.images=/net/sourceforge/squirrel_sql/plugins/sqlparam/images/
+
Copied: trunk/sql12/plugins/sqlparam/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlparam/gui/I18NStrings.properties (from rev 5805, trunk/sql12/plugins/sqlparam/src/net/sourceforge/squirrel_sql/plugins/sqlparam/gui/I18NStrings.properties)
===================================================================
--- trunk/sql12/plugins/sqlparam/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlparam/gui/I18NStrings.properties (rev 0)
+++ trunk/sql12/plugins/sqlparam/src/main/resources/net/sourceforge/squirrel_sql/plugins/sqlparam/gui/I18NStrings.properties 2010-08-21 17:55:58 UTC (rev 5820)
@@ -0,0 +1,6 @@
+#
+#Missing/changed properties generated by I18n Plugin on Thu Apr 19 23:54:08 CEST 2007
+#
+sqlparam.inputParameterValues=Please input the parameter values
+sqlparam.valueFor=Value for ''{0}''
+sqlparam.quoteValues=Quote Values
Copied: trunk/sql12/plugins/sqlparam/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlparam/ResourcesTest.java (from rev 5805, trunk/sql12/test/src/net/sourceforge/squirrel_sql/plugins/sqlparam/ResourcesTest.java)
===================================================================
--- trunk/sql12/plugins/sqlparam/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlparam/ResourcesTest.java (rev 0)
+++ trunk/sql12/plugins/sqlparam/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlparam/ResourcesTest.java 2010-08-21 17:55:58 UTC (rev 5820)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2008 Rob Manning
+ * man...@us...
+ *
+ * This library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package net.sourceforge.squirrel_sql.plugins.sqlparam;
+
+
+import static net.sourceforge.squirrel_sql.client.AppTestUtil.getMockPlugin;
+import net.sourceforge.squirrel_sql.fw.util.AbstractResourcesTest;
+
+import org.junit.Before;
+
+public class ResourcesTest extends AbstractResourcesTest
+{
+
+ @Before
+ public void setUp() throws Exception
+ {
+ classUnderTest = new Resources(getMockPlugin(mockHelper));
+ }
+
+}
Copied: trunk/sql12/plugins/sqlparam/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlparam/SQLParamPluginTest.java (from rev 5805, trunk/sql12/test/src/net/sourceforge/squirrel_sql/plugins/sqlparam/SQLParamPluginTest.java)
===================================================================
--- trunk/sql12/plugins/sqlparam/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlparam/SQLParamPluginTest.java (rev 0)
+++ trunk/sql12/plugins/sqlparam/src/test/java/net/sourceforge/squirrel_sql/plugins/sqlparam/SQLParamPluginTest.java 2010-08-21 17:55:58 UTC (rev 5820)
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2008 Rob Manning
+ * man...@us...
+ *
+ * This library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package net.sourceforge.squirrel_sql.plugins.sqlparam;
+
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.isA;
+import net.sourceforge.squirrel_sql.client.gui.session.SessionPanel;
+import net.sourceforge.squirrel_sql.client.plugin.AbstractPluginTest;
+import net.sourceforge.squirrel_sql.client.plugin.DatabaseProductVersionData;
+import net.sourceforge.squirrel_sql.client.plugin.ISessionPlugin;
+import net.sourceforge.squirrel_sql.client.session.ISQLPanelAPI;
+import net.sourceforge.squirrel_sql.client.session.ISession;
+import net.sourceforge.squirrel_sql.client.session.event.ISQLExecutionListener;
+
+import org.easymock.EasyMock;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class SQLParamPluginTest extends AbstractPluginTest implements DatabaseProductVersionData
+{
+ @Before
+ public void setUp() throws Exception
+ {
+ classUnderTest = new SQLParamPlugin();
+ }
+
+ @After
+ public void tearDown() throws Exception
+ {
+ classUnderTest = null;
+ }
+
+ // Bug 2746982: Error occured in IPlugin.sessionEnded() for SQL Parametrisat
+ // My theory here is that the session ending method was called twice (possibly user clicked the close
+ // session tab 'X' and close application window 'X' in rapid succession. In any case, the plugin
+ // shouldn't behave badly if this happens - no guarantees that the PluginManager won't send spurious
+ // close events on shutdown.
+ @Test
+ public void testMultipleSessionEndings() {
+
+ ISession mockSession = mockHelper.createMock("mockSession", ISession.class);
+ SessionPanel mockSessionPanel = mockHelper.createMock("mockSessionPanel", SessionPanel.class);
+ ISQLPanelAPI mockSQLPanelAPI = mockHelper.createMock("mockSQLPanelAPI", ISQLPanelAPI.class);
+ EasyMock.makeThreadSafe(mockSQLPanelAPI, true);
+
+ expect(mockSession.getSessionSheet()).andStubReturn(mockSessionPanel);
+ expect(mockSessionPanel.getSQLPaneAPI()).andStubReturn(mockSQLPanelAPI);
+ mockSQLPanelAPI.addSQLExecutionListener(isA(ISQLExecutionListener.class));
+ expectLastCall().anyTimes();
+ mockSQLPanelAPI.removeSQLExecutionListener(isA(ISQLExecutionListener.class));
+ expectLastCall().anyTimes();
+
+ mockHelper.replayAll();
+
+ ((ISessionPlugin)classUnderTest).sessionCreated(mockSession);
+ ((ISessionPlugin)classUnderTest).sessionStarted(mockSession);
+ // Give the AWT thread time to finish processing the event.
+ Thread.yield();
+
+ ((ISessionPlugin)classUnderTest).sessionEnding(mockSession);
+ ((ISessionPlugin)classUnderTest).sessionEnding(mockSession);
+
+
+ mockHelper.verifyAll();
+ }
+
+}
Property changes on: trunk/sql12/plugins/sqlreplace
___________________________________________________________________
Added: svn:ignore
+ target
.settings
.project
.classpath
Deleted: trunk/sql12/plugins/sqlreplace/plugin_build.xml
===================================================================
--- trunk/sql12/plugins/sqlreplace/plugin_build.xml 2010-08-21 17:53:40 UTC (rev 5819)
+++ trunk/sql12/plugins/sqlreplace/plugin_build.xml 2010-08-21 17:55:58 UTC (rev 5820)
@@ -1,86 +0,0 @@
-<?xml version="1.0"?>
-<!--
- This is an Apache Ant build file to build the SQLReplace plugin
- for distribution.
--->
-<project name="plugin-sqlreplace" default="build" basedir=".">
- <target name="init">
- <tstamp/>
- <property name="internal_name" value="sqlreplace"/>
- <property name="version" value="0.0.1"/>
- <property name="debug" value="on"/>
- <property name="optimize" value="off"/>
- <property name="deprecation" value="on"/>
- <property name="targetVM" value="1.6"/>
-
- <echo message="---------------- ${internal_name} ${version} ----------------"/>
-
- <property environment="env"/>
- </target>
- <target name="initdirs" unless="p_plugin.work_dir">
- <property name="dist_dir" value="../../../squirrel-sql-dist/squirrel-sql"/>
- <property name="plugins_dist_dir" value="${dist_dir}/plugins"/>
- <property name="p_plugin.work_dir" value="${plugins_dist_dir}/${internal_name}/work"/>
- <property name="p_plugin.core_libs_dir" value="${dist_dir}/core/dist/lib"/>
- <property name="p_plugin.dist_dir" value="${dist_dir}/core/dist/plugins"/>
- </target>
- <!--
- ==================================================================
- Compile the plugin.
- No parameters.
- ==================================================================
- -->
- <target name="build" depends="init, initdirs">
- <property name="obj_dir" value="${p_plugin.work_dir}/obj"/>
-
- <mkdir dir="${obj_dir}"/>
- <mkdir dir="${p_plugin.dist_dir}"/>
-
- <javac srcdir="src"
- destdir="${obj_dir}"
- deprecation="${deprecation}"
- debug="${debug}"
- optimize="${optimize}"
- includeJavaRuntime="yes"
- source="${targetVM}"
- target="${targetVM}">
-
- <classpath>
- <fileset dir="${p_plugin.core_libs_dir}">
- <include name="**/*.*"/>
- </fileset>
- </classpath>
- </javac>
- <copy todir="${obj_dir}" >
- <fileset dir="src" >
- <include name="**/*.gif"/>
- <include name="**/*.jpg"/>
- <include name="**/*.jpeg"/>
- <include name="**/*.xml"/>
- <include name="**/*.xsl"/>
- <include name="**/*.properties"/>
- </fileset>
- </copy>
-
- <jar jarfile="${p_plugin.dist_dir}/${internal_name}.jar" compress="false">
- <fileset dir="${obj_dir}">
- <include name="**/*.*"/>
- </fileset>
- </jar>
-
- <copy todir="${p_plugin.dist_dir}/${internal_name}" >
- <fileset dir="doc" >
- <include name="*.*"/>
- </fileset>
- </copy>
-
- <jar jarfile="${p_plugin.dist_dir}/${internal_name}/src.jar" compress="false">
- <fileset dir=".">
- <include name="src/**/*.*"/>
- <include name="plugin_build.xml"/>
- </fileset>
- </jar>
- </target>
-
-</project>
-
Added: trunk/sql12/plugins/sqlreplace/pom.xml
===================================================================
--- trunk/sql12/plugins/sqlreplace/pom.xml (rev 0)
+++ trunk/sql12/plugins/sqlreplace/pom.xml 2010-08-21 17:55:58 UTC (rev 5820)
@@ -0,0 +1,135 @@
+<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>
+ <parent>
+ <groupId>net.sf.squirrel-sql.plugins</groupId>
+ <artifactId>squirrelsql-plugins-parent-pom</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <groupId>net.sf.squirrel-sql.plugins</groupId>
+ <artifactId>sqlreplace</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>Sqlreplace Plugin</name>
+ <description>Sqlreplace Plugin</description>
+ <inceptionYear>2001</inceptionYear>
+ <developers>
+ <developer>
+ <name>Gerd Wagner</name>
+ <roles>
+ <role>Administrator</role>
+ <role>Developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <name>Rob Manning</name>
+ <roles>
+ <role>Developer</role>
+ <role>Release Manager</role>
+ </roles>
+ </developer>
+ </developers>
+ <licenses>
+ <license>
+ <name>GNU Lesser General Public License</name>
+ <url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+ <url>http://www.squirrelsql.org/</url>
+ <scm>
+ <connection>scm:svn:https://squirrel-sql.svn.sourceforge.net/svnroot/squirrel-sql/trunk/sql12/</connection>
+ <developerConnection>scm:svn:http://squirrel-sql.svn.sourceforge.net/viewvc/squirrel-sql/trunk/sql12/</developerConnection>
+ <url>http://squirrel-sql.svn.sourceforge.net/viewvc/squirrel-sql/trunk/sql12/</url>
+ </scm>
+ <issueManagement>
+ <system>SourceForge Tracker</system>
+ <url>http://sourceforge.net/tracker/?group_id=28383%26atid=393414</url>
+ </issueManagement>
+ <ciManagement>
+ <system>Hudson</system>
+ <url>https://www.squirrel-sql.org/hudson/</url>
+ </ciManagement>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.squirrel-sql</groupId>
+ <artifactId>fw</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.squirrel-sql</groupId>
+ <artifactId>squirrel-sql</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.squirrel-sql</groupId>
+ <artifactId>squirrel-sql</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.squirrel-sql</groupId>
+ <artifactId>squirrelsql-test-utils</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>${source-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${surefire-plugin-version}</version>
+ <configuration>
+ <parallel>${surefire-parallel-type}</parallel>
+ <threadCount>${surefire-thread-count}</threadCount>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>${jar-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>${assembly-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ ...
[truncated message content] |