You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ibatis.apache.org by jg...@apache.org on 2008/12/10 23:16:52 UTC
svn commit: r725464 [1/2] - in /ibatis/trunk/java/tools/ibator: core/build/
eclipse/ eclipse/org.apache.ibatis.ibator.core/
eclipse/org.apache.ibatis.ibator.core/.settings/
eclipse/org.apache.ibatis.ibator.core/META-INF/
eclipse/org.apache.ibatis.ibato...
Author: jgbutler
Date: Wed Dec 10 14:16:50 2008
New Revision: 725464
URL: http://svn.apache.org/viewvc?rev=725464&view=rev
Log:
[ibator] initial commit of the new Eclipse plugin
Added:
ibatis/trunk/java/tools/ibator/eclipse/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/.classpath
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/.project
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/.settings/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/.settings/org.eclipse.jdt.core.prefs
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/META-INF/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/META-INF/MANIFEST.MF
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/build.properties
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/buildIbator.xml
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/ibator-src.zip (with props)
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/ibator.jar (with props)
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/.classpath
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/.project
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/.settings/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/.settings/org.eclipse.jdt.core.prefs
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/META-INF/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/META-INF/MANIFEST.MF
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/build.properties
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/callback/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/callback/EclipseProgressCallback.java
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/callback/EclipseShellCallback.java
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/merge/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/merge/ExistingJavaFileVisitor.java
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/merge/JavaFileMerger.java
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/merge/NewJavaFileVisitor.java
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/.project
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/META-INF/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/META-INF/MANIFEST.MF
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/build.properties
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/buildDoc.xml
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/buildingFromSVN.html
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/eclipseui.html
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/importWizard.gif (with props)
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/quickstart.html
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/releasenotes.html
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/usingAnt.html
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/ibatordoc/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/ibatordoc/ibator.css
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/plugin.xml
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/toc.xml
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/toc_eclipseui.xml
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/toc_ibatordoc.xml
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/toc_javadoc.xml
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/.classpath
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/.project
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/.settings/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/.settings/org.eclipse.jdt.core.prefs
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/.settings/org.eclipse.pde.core.prefs
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/META-INF/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/META-INF/MANIFEST.MF
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/antsrc/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/antsrc/org/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/antsrc/org/apache/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/antsrc/org/apache/ibatis/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/antsrc/org/apache/ibatis/ibator/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/antsrc/org/apache/ibatis/ibator/eclipse/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/antsrc/org/apache/ibatis/ibator/eclipse/ui/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/antsrc/org/apache/ibatis/ibator/eclipse/ui/ant/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/antsrc/org/apache/ibatis/ibator/eclipse/ui/ant/IbatorEclipseAntTask.java
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/build.properties
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/icons/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/icons/iBatisLogo.gif (with props)
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/lib/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/lib/antsupport.jar (with props)
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/plugin.xml
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/apache/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/apache/ibatis/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/apache/ibatis/ibator/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/apache/ibatis/ibator/eclipse/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/apache/ibatis/ibator/eclipse/ui/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/apache/ibatis/ibator/eclipse/ui/IbatorUIPlugin.java
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/apache/ibatis/ibator/eclipse/ui/actions/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/apache/ibatis/ibator/eclipse/ui/actions/RunIbatorAction.java
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/apache/ibatis/ibator/eclipse/ui/actions/RunIbatorThread.java
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/apache/ibatis/ibator/eclipse/ui/content/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/apache/ibatis/ibator/eclipse/ui/content/AdapterFactory.java
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/apache/ibatis/ibator/eclipse/ui/content/IbatorConfigVerifyer.java
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/apache/ibatis/ibator/eclipse/ui/content/IbatorConfigurationFileAdapter.java
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/apache/ibatis/ibator/eclipse/ui/wizards/
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/apache/ibatis/ibator/eclipse/ui/wizards/NewConfigFileWizard.java
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.ui/src/org/apache/ibatis/ibator/eclipse/ui/wizards/NewConfigFileWizardPage1.java
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator/.project
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator/build.properties
ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator/feature.xml
Modified:
ibatis/trunk/java/tools/ibator/core/build/build.xml
ibatis/trunk/java/tools/ibator/core/build/version.properties
Modified: ibatis/trunk/java/tools/ibator/core/build/build.xml
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/build/build.xml?rev=725464&r1=725463&r2=725464&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/build/build.xml (original)
+++ ibatis/trunk/java/tools/ibator/core/build/build.xml Wed Dec 10 14:16:50 2008
@@ -1,7 +1,7 @@
-<project name="Apache iBATIS ibator" default="buildIbator" basedir=".">
+<project name="Apache iBATIS Ibator" default="buildIbator" basedir=".">
<!--
- This is the build file for ibator. To run the build,
+ This is the build file for Ibator. To run the build,
execute this command:
ant -lib ../devlib
@@ -17,7 +17,7 @@
Important: the build requires JDK 5.0 or greater.
- Note: to update the version of ibator, change the
+ Note: to update the version of Ibator, change the
version.properties file (the "version" property).
-->
Modified: ibatis/trunk/java/tools/ibator/core/build/version.properties
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/core/build/version.properties?rev=725464&r1=725463&r2=725464&view=diff
==============================================================================
--- ibatis/trunk/java/tools/ibator/core/build/version.properties (original)
+++ ibatis/trunk/java/tools/ibator/core/build/version.properties Wed Dec 10 14:16:50 2008
@@ -1,4 +1,4 @@
#ibator build version info
-#Tue Dec 09 09:52:26 CST 2008
+#Wed Dec 10 15:49:21 CST 2008
version=1.2.0
-buildNum=653
+buildNum=656
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/.classpath
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/.classpath?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/.classpath (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/.classpath Wed Dec 10 14:16:50 2008
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry exported="true" kind="lib" path="ibator.jar" sourcepath="ibator-src.zip"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/.project
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/.project?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/.project (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/.project Wed Dec 10 14:16:50 2008
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.apache.ibatis.ibator.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/.settings/org.eclipse.jdt.core.prefs?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/.settings/org.eclipse.jdt.core.prefs (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/.settings/org.eclipse.jdt.core.prefs Wed Dec 10 14:16:50 2008
@@ -0,0 +1,7 @@
+#Tue Oct 14 09:47:40 CDT 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/META-INF/MANIFEST.MF?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/META-INF/MANIFEST.MF (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/META-INF/MANIFEST.MF Wed Dec 10 14:16:50 2008
@@ -0,0 +1,30 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Ibator Core Plug-in
+Bundle-SymbolicName: org.apache.ibatis.ibator.core
+Bundle-Version: 1.2.0
+Bundle-ClassPath: ibator.jar
+Export-Package: org.apache.ibatis.ibator.ant,
+ org.apache.ibatis.ibator.api,
+ org.apache.ibatis.ibator.api.dom,
+ org.apache.ibatis.ibator.api.dom.java,
+ org.apache.ibatis.ibator.api.dom.xml,
+ org.apache.ibatis.ibator.config,
+ org.apache.ibatis.ibator.config.xml,
+ org.apache.ibatis.ibator.exception,
+ org.apache.ibatis.ibator.generator,
+ org.apache.ibatis.ibator.generator.ibatis2,
+ org.apache.ibatis.ibator.generator.ibatis2.dao,
+ org.apache.ibatis.ibator.generator.ibatis2.dao.elements,
+ org.apache.ibatis.ibator.generator.ibatis2.dao.templates,
+ org.apache.ibatis.ibator.generator.ibatis2.model,
+ org.apache.ibatis.ibator.generator.ibatis2.sqlmap,
+ org.apache.ibatis.ibator.generator.ibatis2.sqlmap.elements,
+ org.apache.ibatis.ibator.internal,
+ org.apache.ibatis.ibator.internal.db,
+ org.apache.ibatis.ibator.internal.rules,
+ org.apache.ibatis.ibator.internal.types,
+ org.apache.ibatis.ibator.internal.util,
+ org.apache.ibatis.ibator.internal.util.messages,
+ org.apache.ibatis.ibator.plugins
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/build.properties
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/build.properties?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/build.properties (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/build.properties Wed Dec 10 14:16:50 2008
@@ -0,0 +1,2 @@
+bin.includes = META-INF/,\
+ ibator.jar
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/buildIbator.xml
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/buildIbator.xml?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/buildIbator.xml (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/buildIbator.xml Wed Dec 10 14:16:50 2008
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project default="copyFiles">
+
+ <target name="compile">
+ <!-- call the build.xml file in the regular distribution to build the core jars -->
+ <ant dir="../../core/build" target="assemble.zipfile"/>
+ </target>
+
+ <target name="copyFiles" depends="compile">
+ <!-- now copy the new JARs into this plugin dir -->
+ <copy todir="." file="../../core/build/deploy/files/ibator.jar" />
+ <copy todir="." file="../../core/build/deploy/files/ibator-src.zip" />
+ </target>
+</project>
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/ibator-src.zip
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/ibator-src.zip?rev=725464&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/ibator-src.zip
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/ibator.jar
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/ibator.jar?rev=725464&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.core/ibator.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/.classpath
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/.classpath?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/.classpath (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/.classpath Wed Dec 10 14:16:50 2008
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/.project
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/.project?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/.project (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/.project Wed Dec 10 14:16:50 2008
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.apache.ibatis.ibator.eclipse.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/.settings/org.eclipse.jdt.core.prefs?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/.settings/org.eclipse.jdt.core.prefs (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/.settings/org.eclipse.jdt.core.prefs Wed Dec 10 14:16:50 2008
@@ -0,0 +1,7 @@
+#Wed Dec 10 14:06:22 CST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/META-INF/MANIFEST.MF?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/META-INF/MANIFEST.MF (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/META-INF/MANIFEST.MF Wed Dec 10 14:16:50 2008
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Apache iBATIS Ibator Eclipse Core Support Plug-in
+Bundle-SymbolicName: org.apache.ibatis.ibator.eclipse.core
+Bundle-Version: 1.2.0
+Bundle-Vendor: ibatis.apache.org
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.apache.ibatis.ibator.eclipse.core.callback,
+ org.apache.ibatis.ibator.eclipse.core.merge
+Require-Bundle: org.eclipse.jdt.core;bundle-version="3.4.2",
+ org.eclipse.jface.text;bundle-version="3.4.1",
+ org.eclipse.core.resources;bundle-version="3.4.1",
+ org.eclipse.core.runtime;bundle-version="3.4.0",
+ org.apache.ibatis.ibator.core;bundle-version="1.2.0"
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/build.properties
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/build.properties?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/build.properties (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/build.properties Wed Dec 10 14:16:50 2008
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/callback/EclipseProgressCallback.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/callback/EclipseProgressCallback.java?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/callback/EclipseProgressCallback.java (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/callback/EclipseProgressCallback.java Wed Dec 10 14:16:50 2008
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2008 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ibatis.ibator.eclipse.core.callback;
+
+import org.apache.ibatis.ibator.api.ProgressCallback;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubMonitor;
+
+/**
+ * @author Jeff Butler
+ */
+public class EclipseProgressCallback implements ProgressCallback {
+ private static final int INTROSPECTION_FACTOR = 2000;
+ private static final int GENERATION_FACTOR = 4000;
+ private static final int SAVE_FACTOR = 4000;
+
+ private SubMonitor parentProgress;
+ private SubMonitor currentChildProgress;
+ private int currentTick;
+
+ /**
+ *
+ */
+ public EclipseProgressCallback(IProgressMonitor progressMonitor) {
+ super();
+ parentProgress = SubMonitor.convert(progressMonitor,
+ INTROSPECTION_FACTOR + GENERATION_FACTOR + SAVE_FACTOR);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.ibatis.ibator.core.api.ProgressCallback#checkCancel()
+ */
+ public void checkCancel() throws InterruptedException {
+ if (currentChildProgress.isCanceled()) {
+ throw new InterruptedException();
+ }
+ }
+
+ public void generationStarted(int totalTasks) {
+ currentChildProgress = parentProgress.newChild(GENERATION_FACTOR);
+ currentTick = GENERATION_FACTOR / totalTasks;
+ if (currentTick == 0) {
+ currentTick = 1;
+ }
+
+ currentChildProgress.beginTask("Generating Files", GENERATION_FACTOR);
+ }
+
+ public void introspectionStarted(int totalTasks) {
+ currentChildProgress = parentProgress.newChild(INTROSPECTION_FACTOR);
+ currentTick = INTROSPECTION_FACTOR / totalTasks;
+ if (currentTick == 0) {
+ currentTick = 1;
+ }
+
+ currentChildProgress.beginTask("Introspecting Tables", INTROSPECTION_FACTOR);
+ }
+
+ public void saveStarted(int totalTasks) {
+ currentChildProgress = parentProgress.newChild(SAVE_FACTOR);
+ currentTick = SAVE_FACTOR / totalTasks;
+ if (currentTick == 0) {
+ currentTick = 1;
+ }
+
+ currentChildProgress.beginTask("Saving Generated Files", SAVE_FACTOR);
+ }
+
+ public void startTask(String taskName) {
+ currentChildProgress.subTask(taskName);
+ currentChildProgress.worked(currentTick);
+ }
+
+ public void done() {
+ // ignore - don't call done on SubMonitors - leave that to the calling method
+ ;
+ }
+}
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/callback/EclipseShellCallback.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/callback/EclipseShellCallback.java?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/callback/EclipseShellCallback.java (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/callback/EclipseShellCallback.java Wed Dec 10 14:16:50 2008
@@ -0,0 +1,279 @@
+/*
+ * Copyright 2008 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ibatis.ibator.eclipse.core.callback;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.ibatis.ibator.api.ShellCallback;
+import org.apache.ibatis.ibator.eclipse.core.merge.JavaFileMerger;
+import org.apache.ibatis.ibator.exception.ShellException;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaCore;
+
+/**
+ * @author Jeff Butler
+ */
+public class EclipseShellCallback implements ShellCallback {
+ private Map<String, IJavaProject> projects;
+
+ private Map<String, IFolder> folders;
+
+ private Map<String, IPackageFragmentRoot> sourceFolders;
+
+ /**
+ *
+ */
+ public EclipseShellCallback() {
+ super();
+ projects = new HashMap<String, IJavaProject>();
+ folders = new HashMap<String, IFolder>();
+ sourceFolders = new HashMap<String, IPackageFragmentRoot>();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.ibatis.ibator.api.ShellCallback#getDirectory(java.lang.String, java.lang.String)
+ */
+ public File getDirectory(String targetProject, String targetPackage) throws ShellException {
+ if (targetProject.startsWith("/") || targetProject.startsWith("\\")) {
+ StringBuffer sb = new StringBuffer();
+ sb.append("targetProject ");
+ sb.append(targetProject);
+ sb.append(" is invalid - it cannot start with / or \\");
+
+ throw new ShellException(sb.toString());
+ }
+
+ IFolder folder = getFolder(targetProject, targetPackage);
+
+ return folder.getRawLocation().toFile();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.ibatis.ibator.core.api.ShellCallback#refreshProject(java.lang.String)
+ */
+ public void refreshProject(String project) {
+ try {
+ IPackageFragmentRoot root = getSourceFolder(project);
+ root.getCorrespondingResource().refreshLocal(
+ IResource.DEPTH_INFINITE, null);
+ } catch (Exception e) {
+ // ignore
+ ;
+ }
+ }
+
+ private IJavaProject getJavaProject(String javaProjectName)
+ throws ShellException {
+ IJavaProject javaProject = projects.get(javaProjectName);
+ if (javaProject == null) {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IProject project = root.getProject(javaProjectName);
+
+ if (project.exists()) {
+ boolean isJavaProject;
+ try {
+ isJavaProject = project.hasNature(JavaCore.NATURE_ID);
+ } catch (CoreException e) {
+ throw new ShellException(e.getStatus().getMessage(), e);
+ }
+ if (isJavaProject) {
+ javaProject = JavaCore.create(project);
+ } else {
+ StringBuffer sb = new StringBuffer();
+ sb.append("Project ");
+ sb.append(javaProjectName);
+ sb.append(" is not a Java project");
+
+ throw new ShellException(sb.toString());
+ }
+ } else {
+ StringBuffer sb = new StringBuffer();
+ sb.append("Project ");
+ sb.append(javaProjectName);
+ sb.append(" does not exist");
+
+ throw new ShellException(sb.toString());
+ }
+
+ projects.put(javaProjectName, javaProject);
+ }
+
+ return javaProject;
+ }
+
+ private IFolder getFolder(String targetProject, String targetPackage)
+ throws ShellException {
+ String key = targetProject + targetPackage;
+ IFolder folder = folders.get(key);
+ if (folder == null) {
+ IPackageFragmentRoot root = getSourceFolder(targetProject);
+ IPackageFragment packageFragment = getPackage(root, targetPackage);
+
+ try {
+ folder = (IFolder) packageFragment.getCorrespondingResource();
+
+ folders.put(key, folder);
+ } catch (CoreException e) {
+ throw new ShellException(e.getStatus().getMessage(), e);
+ }
+ }
+
+ return folder;
+ }
+
+ /**
+ * This method returns the first modifiable package fragment root in the
+ * java project
+ *
+ * @param javaProject
+ * @return
+ */
+ private IPackageFragmentRoot getFirstSourceFolder(IJavaProject javaProject)
+ throws ShellException {
+
+ // find the first non-JAR package fragment root
+ IPackageFragmentRoot[] roots;
+ try {
+ roots = javaProject.getPackageFragmentRoots();
+ } catch (CoreException e) {
+ throw new ShellException(e.getStatus().getMessage(), e);
+ }
+
+ IPackageFragmentRoot srcFolder = null;
+ for (int i = 0; i < roots.length; i++) {
+ if (roots[i].isArchive() || roots[i].isReadOnly()
+ || roots[i].isExternal()) {
+ continue;
+ } else {
+ srcFolder = roots[i];
+ break;
+ }
+ }
+
+ if (srcFolder == null) {
+ StringBuffer sb = new StringBuffer();
+ sb.append("Cannot find source folder for project ");
+ sb.append(javaProject.getElementName());
+
+ throw new ShellException(sb.toString());
+ }
+
+ return srcFolder;
+ }
+
+ private IPackageFragmentRoot getSpecificSourceFolder(
+ IJavaProject javaProject, String targetProject)
+ throws ShellException {
+
+ try {
+ Path path = new Path("/" + targetProject);
+ IPackageFragmentRoot pfr = javaProject
+ .findPackageFragmentRoot(path);
+ if (pfr == null) {
+ StringBuffer sb = new StringBuffer();
+ sb.append("Cannot find source folder ");
+ sb.append(targetProject);
+
+ throw new ShellException(sb.toString());
+ }
+
+ return pfr;
+ } catch (CoreException e) {
+ throw new ShellException(e.getStatus().getMessage(), e);
+ }
+ }
+
+ private IPackageFragment getPackage(IPackageFragmentRoot srcFolder,
+ String packageName) throws ShellException {
+
+ IPackageFragment fragment = srcFolder.getPackageFragment(packageName);
+
+ try {
+ if (!fragment.exists()) {
+ fragment = srcFolder.createPackageFragment(packageName, true,
+ null);
+ }
+
+ fragment.getCorrespondingResource().refreshLocal(
+ IResource.DEPTH_ONE, null);
+ } catch (CoreException e) {
+ throw new ShellException(e.getStatus().getMessage(), e);
+ }
+
+ return fragment;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.ibatis.ibator.api.ShellCallback#mergeSupported()
+ */
+ public boolean isMergeSupported() {
+ return true;
+ }
+
+ private IPackageFragmentRoot getSourceFolder(String targetProject)
+ throws ShellException {
+ IPackageFragmentRoot answer = sourceFolders.get(targetProject);
+ if (answer == null) {
+ // first parse the targetProject into project and source folder
+ // values
+ int index = targetProject.indexOf('/');
+ if (index == -1) {
+ index = targetProject.indexOf('\\');
+ }
+
+ if (index == -1) {
+ // no source folder specified
+ IJavaProject javaProject = getJavaProject(targetProject);
+ answer = getFirstSourceFolder(javaProject);
+ } else {
+ IJavaProject javaProject = getJavaProject(targetProject
+ .substring(0, index));
+ answer = getSpecificSourceFolder(javaProject, targetProject);
+ }
+
+ sourceFolders.put(targetProject, answer);
+ }
+
+ return answer;
+ }
+
+ public boolean isOverwriteEnabled() {
+ return false;
+ }
+
+ public String mergeJavaFile(String newFileSource,
+ String existingFileFullPath, String[] javadocTags)
+ throws ShellException {
+ JavaFileMerger merger = new JavaFileMerger(newFileSource, existingFileFullPath, javadocTags);
+ return merger.getMergedSource();
+ }
+}
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/merge/ExistingJavaFileVisitor.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/merge/ExistingJavaFileVisitor.java?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/merge/ExistingJavaFileVisitor.java (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/merge/ExistingJavaFileVisitor.java Wed Dec 10 14:16:50 2008
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2008 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ibatis.ibator.eclipse.core.merge;
+
+import java.util.List;
+
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ASTVisitor;
+import org.eclipse.jdt.core.dom.BodyDeclaration;
+import org.eclipse.jdt.core.dom.FieldDeclaration;
+import org.eclipse.jdt.core.dom.Javadoc;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.TagElement;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+
+/**
+ * @author Jeff Butler
+ *
+ */
+public class ExistingJavaFileVisitor extends ASTVisitor {
+ private TypeDeclaration typeDeclaration;
+ private String[] javadocTags;
+
+ /**
+ *
+ */
+ public ExistingJavaFileVisitor(String[] javadocTags) {
+ super();
+ this.javadocTags = javadocTags;
+ }
+
+ /**
+ * Find the ibator generated fields and delete them
+ */
+ @Override
+ public boolean visit(FieldDeclaration node) {
+ if (isIbatorGenerated(node)) {
+ node.delete();
+ }
+
+ return false;
+ }
+
+ /**
+ * Find the ibator generated methods and delete them
+ */
+ @Override
+ public boolean visit(MethodDeclaration node) {
+ if (isIbatorGenerated(node)) {
+ node.delete();
+ }
+
+ return false;
+ }
+
+ /**
+ * Find any ibator generated inner types and delete them
+ */
+ @Override
+ public boolean visit(TypeDeclaration node) {
+ // make sure we only pick up the top level type
+ if (node.getParent().getNodeType() == ASTNode.COMPILATION_UNIT) {
+ typeDeclaration = node;
+ return true;
+ } else {
+ // is this an iBATOR generated inner class? If so, then delete
+ if (isIbatorGenerated(node)) {
+ node.delete();
+ }
+
+ return false;
+ }
+ }
+
+ public TypeDeclaration getTypeDeclaration() {
+ return typeDeclaration;
+ }
+
+ @SuppressWarnings("unchecked")
+ private boolean isIbatorGenerated(BodyDeclaration node) {
+ boolean rc = false;
+ Javadoc jd = node.getJavadoc();
+ if (jd != null) {
+ List<TagElement> tags = jd.tags();
+ for (TagElement tag : tags) {
+ String tagName = tag.getTagName();
+ if (tagName == null) {
+ continue;
+ }
+ for (String javadocTag : javadocTags) {
+ if (tagName.equals(javadocTag)) {
+ rc = true;
+ break;
+ }
+ }
+ }
+ }
+
+ return rc;
+ }
+}
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/merge/JavaFileMerger.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/merge/JavaFileMerger.java?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/merge/JavaFileMerger.java (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/merge/JavaFileMerger.java Wed Dec 10 14:16:50 2008
@@ -0,0 +1,295 @@
+/*
+ * Copyright 2005, 2006, 2008 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ibatis.ibator.eclipse.core.merge;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.ibatis.ibator.exception.ShellException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.ImportDeclaration;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.Name;
+import org.eclipse.jdt.core.dom.SimpleType;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ListRewrite;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.text.edits.TextEdit;
+
+/**
+ * This class handles the task of merging changes into an existing Java file.
+ *
+ * This class makes several assumptions about the structure of the new and
+ * existing files, including:
+ *
+ * <ul>
+ * <li>The imports of both files are fully qualified (no wildcard imports)</li>
+ * <li>The super interfaces of both files are NOT fully qualified</li>
+ * <li>The super classes of both files are NOT fully qualified</li>
+ * </ul>
+ *
+ * @author Jeff Butler
+ */
+public class JavaFileMerger {
+
+ private String newJavaSource;
+ private String existingFilePath;
+ private String[] javaDocTags;
+
+ public JavaFileMerger(String newJavaSource, String existingFilePath,
+ String[] javaDocTags) {
+ super();
+ this.newJavaSource = newJavaSource;
+ this.existingFilePath = existingFilePath;
+ this.javaDocTags = javaDocTags;
+ }
+
+ @SuppressWarnings("unchecked")
+ public String getMergedSource() throws ShellException {
+ ASTParser astParser = ASTParser.newParser(AST.JLS3);
+ NewJavaFileVisitor newJavaFileVisitor = visitNewJavaFile(astParser);
+
+ IFile existingFile = getFile();
+
+ ICompilationUnit icu = JavaCore.createCompilationUnitFrom(existingFile);
+ IDocument document;
+ try {
+ document = new Document(icu.getSource());
+ } catch (CoreException e) {
+ throw new ShellException(e.getStatus().getMessage(), e);
+ }
+
+ // delete ibator generated stuff, and collect imports
+ ExistingJavaFileVisitor visitor = new ExistingJavaFileVisitor(javaDocTags);
+
+ astParser.setSource(icu);
+ CompilationUnit cu = (CompilationUnit) astParser.createAST(null);
+ AST ast = cu.getAST();
+ cu.recordModifications();
+ cu.accept(visitor);
+
+ TypeDeclaration typeDeclaration = visitor.getTypeDeclaration();
+ if (typeDeclaration == null) {
+ StringBuffer sb = new StringBuffer();
+ sb.append("No types defined in the file ");
+ sb.append(existingFile.getName());
+
+ throw new ShellException(sb.toString());
+ }
+
+ // reconcile the superinterfaces
+ List<Type> newSuperInterfaces = getNewSuperInterfaces(typeDeclaration
+ .superInterfaceTypes(), newJavaFileVisitor);
+ for (Type newSuperInterface : newSuperInterfaces) {
+ if (newSuperInterface.isSimpleType()) {
+ SimpleType st = (SimpleType) newSuperInterface;
+ Name name = ast.newName(st.getName().getFullyQualifiedName());
+ SimpleType newSt = ast.newSimpleType(name);
+ typeDeclaration.superInterfaceTypes().add(newSt);
+ } else {
+ // this shouldn't happen - ibator only generates simple names
+ throw new ShellException("The Java file merger only supports simple types as super interfaces");
+ }
+ }
+
+ // set the superclass
+ if (newJavaFileVisitor.getSuperclass() != null) {
+ if (newJavaFileVisitor.getSuperclass().isSimpleType()) {
+ SimpleType st = (SimpleType) newJavaFileVisitor.getSuperclass();
+ Name name = ast.newName(st.getName().getFullyQualifiedName());
+ SimpleType newSt = ast.newSimpleType(name);
+ typeDeclaration.setSuperclassType(newSt);
+ } else {
+ // this shouldn't happen - ibator only generates simple names
+ throw new ShellException("The Java file merger only supports simple types as super classes");
+ }
+ } else {
+ typeDeclaration.setSuperclassType(null);
+ }
+
+ // interface or class?
+ if (newJavaFileVisitor.isInterface()) {
+ typeDeclaration.setInterface(true);
+ } else {
+ typeDeclaration.setInterface(false);
+ }
+
+ // reconcile the imports
+ List<ImportDeclaration> newImports = getNewImports(cu.imports(), newJavaFileVisitor);
+ for (ImportDeclaration newImport : newImports) {
+ Name name = ast.newName(newImport.getName().getFullyQualifiedName());
+ ImportDeclaration newId = ast.newImportDeclaration();
+ newId.setName(name);
+ cu.imports().add(newId);
+ }
+
+ TextEdit textEdit = cu.rewrite(document, null);
+ try {
+ textEdit.apply(document);
+ } catch (BadLocationException e) {
+ throw new ShellException(
+ "BadLocationException removing prior fields and methods");
+ }
+
+ // regenerate the CompilationUnit to reflect all the deletes and changes
+ astParser.setSource(document.get().toCharArray());
+ CompilationUnit strippedCu = (CompilationUnit) astParser.createAST(null);
+
+ // find the top level public type declaration
+ TypeDeclaration topLevelType = null;
+ Iterator iter = strippedCu.types().iterator();
+ while (iter.hasNext()) {
+ TypeDeclaration td = (TypeDeclaration) iter.next();
+ if (td.getParent().equals(strippedCu)
+ && (td.getModifiers() & Modifier.PUBLIC) > 0) {
+ topLevelType = td;
+ break;
+ }
+ }
+
+ // now add all the new methods and fields to the existing
+ // CompilationUnit with a ListRewrite
+ ASTRewrite rewrite = ASTRewrite.create(topLevelType.getRoot().getAST());
+ ListRewrite listRewrite = rewrite.getListRewrite(topLevelType,
+ TypeDeclaration.BODY_DECLARATIONS_PROPERTY);
+
+ Iterator<ASTNode> astIter = newJavaFileVisitor.getNewNodes().iterator();
+ int i = 0;
+ while (astIter.hasNext()) {
+ listRewrite.insertAt(astIter.next(), i++, null);
+ }
+
+ textEdit = rewrite.rewriteAST(document, JavaCore.getOptions());
+ try {
+ textEdit.apply(document);
+ } catch (BadLocationException e) {
+ throw new ShellException(
+ "BadLocationException adding new fields and methods");
+ }
+
+ String newSource = document.get();
+ return newSource;
+ }
+
+ private List<Type> getNewSuperInterfaces(List<Type> existingSuperInterfaces,
+ NewJavaFileVisitor newJavaFileVisitor) {
+
+ List<Type> answer = new ArrayList<Type>();
+
+ for (Type newSuperInterface : newJavaFileVisitor.getSuperInterfaceTypes()) {
+ if (newSuperInterface.isSimpleType()) {
+ SimpleType newSimpleType = (SimpleType) newSuperInterface;
+ String newName = newSimpleType.getName().getFullyQualifiedName();
+
+ boolean found = false;
+ for (Type existingSuperInterface : existingSuperInterfaces) {
+ if (existingSuperInterface.isSimpleType()) {
+ SimpleType existingSimpleType = (SimpleType) existingSuperInterface;
+
+ String existingName = existingSimpleType.getName().getFullyQualifiedName();
+
+ if (newName.equals(existingName)) {
+ found = true;
+ break;
+ }
+ }
+ }
+
+ if (!found) {
+ answer.add(newSuperInterface);
+ }
+ }
+ }
+
+ return answer;
+ }
+
+ private List<ImportDeclaration> getNewImports(List<ImportDeclaration> existingImports,
+ NewJavaFileVisitor newJavaFileVisitor) {
+ List<ImportDeclaration> answer = new ArrayList<ImportDeclaration>();
+
+ for (ImportDeclaration newImport : newJavaFileVisitor.getImports()) {
+ String newName = newImport.getName().getFullyQualifiedName();
+ boolean found = false;
+ for (ImportDeclaration existingImport : existingImports) {
+ String existingName = existingImport.getName().getFullyQualifiedName();
+
+ if (newName.equals(existingName)) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ answer.add(newImport);
+ }
+ }
+
+ return answer;
+ }
+
+ /**
+ * This method parses the new Java file and returns a
+ * filled out NewJavaFileVisitor. The returned visitor can
+ * be used to determine characteristics of the new file, and
+ * a lost of new nodes that need to be incorporated into the
+ * existing file.
+ *
+ * @param astParser
+ * @return
+ */
+ private NewJavaFileVisitor visitNewJavaFile(ASTParser astParser) {
+ astParser.setSource(newJavaSource.toCharArray());
+ CompilationUnit cu = (CompilationUnit) astParser.createAST(null);
+ NewJavaFileVisitor newVisitor = new NewJavaFileVisitor();
+ cu.accept(newVisitor);
+
+ return newVisitor;
+ }
+
+ private IFile getFile() throws ShellException {
+ IPath path = new Path(existingFilePath);
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IFile file = root.getFileForLocation(path);
+ if (file != null && file.exists()) {
+ return file;
+ } else {
+ // this should not happen because ibator only returns the path
+ // calculated by the eclipse callback
+ StringBuilder sb = new StringBuilder();
+ sb.append("The file ");
+ sb.append(existingFilePath);
+ sb.append(" does not exist in this workspace");
+ throw new ShellException(sb.toString());
+ }
+ }
+}
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/merge/NewJavaFileVisitor.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/merge/NewJavaFileVisitor.java?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/merge/NewJavaFileVisitor.java (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.core/src/org/apache/ibatis/ibator/eclipse/core/merge/NewJavaFileVisitor.java Wed Dec 10 14:16:50 2008
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2008 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ibatis.ibator.eclipse.core.merge;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ASTVisitor;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.FieldDeclaration;
+import org.eclipse.jdt.core.dom.ImportDeclaration;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+
+/**
+ * @author Jeff Butler
+ *
+ */
+public class NewJavaFileVisitor extends ASTVisitor {
+ private List<ASTNode> newNodes;
+ private List<ImportDeclaration> imports;
+ private Type superclass;
+ private boolean isInterface;
+ private List<Type> superInterfaceTypes;
+
+ /**
+ *
+ */
+ public NewJavaFileVisitor() {
+ super();
+ newNodes = new ArrayList<ASTNode>();
+ }
+
+ public boolean visit(FieldDeclaration node) {
+ newNodes.add(node);
+
+ return false;
+ }
+
+ public boolean visit(MethodDeclaration node) {
+ newNodes.add(node);
+
+ return false;
+ }
+
+ @SuppressWarnings("unchecked")
+ public boolean visit(TypeDeclaration node) {
+ // make sure we don't pick up the top level class
+ if (node.getParent().getNodeType() == ASTNode.COMPILATION_UNIT) {
+ isInterface = node.isInterface();
+
+ superclass = node.getSuperclassType();
+
+ superInterfaceTypes = node.superInterfaceTypes();
+
+ return true;
+ } else {
+ newNodes.add(node);
+ return false;
+ }
+ }
+
+ public List<ASTNode> getNewNodes() {
+ return newNodes;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public boolean visit(CompilationUnit node) {
+ imports = node.imports();
+
+ return true;
+ }
+
+ public List<ImportDeclaration> getImports() {
+ return imports;
+ }
+
+ public Type getSuperclass() {
+ return superclass;
+ }
+
+ public boolean isInterface() {
+ return isInterface;
+ }
+
+ public List<Type> getSuperInterfaceTypes() {
+ return superInterfaceTypes;
+ }
+}
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/.project
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/.project?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/.project (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/.project Wed Dec 10 14:16:50 2008
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.apache.ibatis.ibator.eclipse.doc</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/META-INF/MANIFEST.MF?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/META-INF/MANIFEST.MF (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/META-INF/MANIFEST.MF Wed Dec 10 14:16:50 2008
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Apache iBATIS Ibator Documentation Plug-in
+Bundle-SymbolicName: org.apache.ibatis.ibator.eclipse.doc; singleton:=true
+Bundle-Version: 1.2.0
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/build.properties
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/build.properties?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/build.properties (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/build.properties Wed Dec 10 14:16:50 2008
@@ -0,0 +1,7 @@
+bin.includes = plugin.xml,\
+ META-INF/,\
+ html/,\
+ toc.xml,\
+ toc_eclipseui.xml,\
+ toc_ibatordoc.xml,\
+ toc_javadoc.xml
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/buildDoc.xml
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/buildDoc.xml?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/buildDoc.xml (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/buildDoc.xml Wed Dec 10 14:16:50 2008
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project default="refresh">
+ <path id="org.abache.ibatis.ibator.doc.javadocclasspath">
+ <pathelement location="../org.apache.ibatis.ibator.eclipse.ui/bin"/>
+ <pathelement location="../org.apache.ibatis.ibator.core/ibator.jar"/>
+ </path>
+
+ <target name="clean">
+ <delete dir="html" />
+ </target>
+
+ <target name="javadoc" depends="clean">
+ <javadoc
+ access="protected"
+ author="true"
+ destdir="html/javadoc"
+ doctitle="Apache iBATIS Ibator"
+ nodeprecated="false"
+ nodeprecatedlist="false"
+ noindex="false"
+ nonavbar="false"
+ notree="false"
+ source="1.5"
+ splitindex="true"
+ use="true"
+ version="true"
+ classpathref="org.abache.ibatis.ibator.doc.javadocclasspath">
+ <packageset dir="../../core/src" />
+ <packageset dir="../org.apache.ibatis.ibator.eclipse.ui/src" />
+ <packageset dir="../org.apache.ibatis.ibator.eclipse.ui/antsrc" />
+ </javadoc>
+
+ <copy todir="html/ibatordoc">
+ <fileset dir="../../core/htmldoc">
+ <exclude name="ibator.css"/>
+ </fileset>
+ <fileset dir="html-src/ibatordoc">
+ <include name="ibator.css"/>
+ </fileset>
+ </copy>
+
+ <copy todir="html/eclipseui">
+ <fileset dir="html-src/eclipseui" />
+ </copy>
+</target>
+
+ <target name="refresh" depends="javadoc" if="eclipse.running">
+ <echo message="Refreshing the Eclipse Project..."/>
+ <eclipse.refreshLocal resource="org.apache.ibatis.ibator.eclipse.doc"/>
+ </target>
+
+</project>
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/buildingFromSVN.html
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/buildingFromSVN.html?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/buildingFromSVN.html (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/buildingFromSVN.html Wed Dec 10 14:16:50 2008
@@ -0,0 +1,167 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Ibator Feature Debug Reference</title>
+ <link type="text/css" rel="stylesheet" href="../ibatordoc/ibator.css"/>
+</head>
+<body>
+<h1>Ibator Feature Debug Reference</h1>
+<p>This page contains reference information about how to build and debug the Ibator
+feature from source.</p>
+
+<h2>Feature Structure</h2>
+<p>The Ibator feature is structured as five different Eclipse projects - a feature project and
+four plugin projects. The feature project groups the four plugins together for easy
+installation. The Ibator feature project is <code>org.apache.ibatis.ibator</code>.
+This project references the four plugin projects. The plugin projects are structured as
+follows:</p>
+<table cellspacing="0" cellpadding="5" border="1">
+ <tr>
+ <th>Plug-in Project</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>org.apache.ibatis.ibator.core</code></td>
+ <td>This plugin is an Eclipse library plugin for the standard Ibator JAR file.
+ The purpose of this plug-in is to package the standard JAR and make it available to the
+ other plugins. There is a build file in this plug-in (buildIbator.xml) that
+ will compile the core Ibator JAR file and update the wrapped JAR files. This makes
+ it easy to keep the plugin up to date as the core functionality is developed.</td>
+ </tr>
+ <tr>
+ <td><code>org.apache.ibatis.ibator.eclipse.core</code></td>
+ <td>This plugin holds Java support classes for the other plugins. This plugin does not contribute
+ to the Eclipse user interface. Currently, this plugin includes classes for Java file
+ merging, and Eclipse implementations of the Ibator callback interfaces.</td>
+ </tr>
+ <tr>
+ <td><code>org.apache.ibatis.ibator.eclipse.doc</code></td>
+ <td>This plug-in holds the documentation for Ibator. There is a build file in this
+ plug-in (buildDoc.xml) that will build the documentation and package it for inclusion
+ into the Eclipse help system.</td>
+ </tr>
+ <tr>
+ <td><code>org.apache.ibatis.ibator.eclipse.ui</code></td>
+ <td>This plug-in holds the Java code for the Eclipse user interface for Ibator. If you
+ are experiencing trouble with the plugin specific features (like the integrated Ant task), then
+ the code for those features will be found in this plugin.
+ </td>
+ </tr>
+</table>
+
+
+<h2>Building the Feature and Plug-ins from Source</h2>
+<p>The following instructions show how to build the Ibator feature and plug-ins from the
+latest source
+in the Subversion repository. We assume that you are somewhat familiar with Subversion
+and the Eclipse plug-in development environment (PDE). These instructions also assume
+you are using Eclipse version 3.4.1. The plug-in
+code is not supported in versions of Eclipse prior to version 3.4.1.</p>
+<ol>
+ <li>Checkout the latest source code from Subversion
+ <ol type="a">
+ <li>Create a local directory where the source will be stored (for example
+ /Ibator/source)</li>
+ <li>Check out the source tree from the Subversion repository at
+ <a href="http://svn.apache.org/repos/asf/ibatis/trunk/java/tools/ibator/">
+ http://svn.apache.org/repos/asf/ibatis/trunk/java/tools/ibator/</a></li>
+ <b>Note:</b> this will also checkout the source for the Ibator core JAR.
+ </ol>
+ </li>
+ <li>Create a new Eclipse workspace directory (for example /EclipseWorkspaces/Ibator)</li>
+ <li>Start Eclipse and point it to the new workspace directory</li>
+ <li>Import the plug-in projects into the workspace
+ <ol type="a">
+ <li>Start the Eclipse project import wizard
+ (File>Import>General>Existing Projects into Workspace)
+ </li>
+ <li>Set the root directory to the "eclipse" sub-directory of the directory where
+ you did the SVN checkout (for example, /Ibator/source/eclipse)</li>
+ <li>Select the five projects under the directory, do not copy the projects into
+ your workspace. The filled out wizard looks like this: <br />
+ <p><img src="importWizard.gif" alt="Eclipse Project Import Wizard"/></p>
+ </li>
+ <li>Press "Finish", wait for the workspace to build.</li>
+ </ol>
+ </li>
+</ol>
+
+<h2>Debugging</h2>
+<p>At this point the projects should be successfully compiled in Eclipse. If you want to
+ debug something in the plug-in, you will need to start another instance of Eclipse
+ in debug mode. The following instructions explain how to do this.</p>
+
+<ol>
+ <li>Set a breakpoint in the code you would like to debug.</li>
+ <li>Double click on the "plugin.xml" file in the "org.apache.ibatis.ibator.eclipse.ui"
+ project. This should open the plug-in manifest editor. If some other editor
+ opens, then close the editor, right click on "plugin.xml" and select the
+ "Open With>Plug-in Manifest Editor" option.</li>
+ <li>Select the "Overview" editor tab</li>
+ <li>Take the option to "Launch an Eclipse Application in Debug mode". This will
+ start a new instance of Eclipse in debug mode with the Ibator plug-ins installed.</li>
+</ol>
+
+<p>Once you have the other instance of Eclipse started you should create a new Java project
+ in the new workspace, create and fill out an Ibator configuration file, and then run Ibator.
+ Ibator should eventually hit your breakpoint, and then you step through the code.</p>
+<p>The following classes will likely be of the most interest in debugging:</p>
+<table cellspacing="0" cellpadding="5" border="1">
+ <tr>
+ <th>Class</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>org.apache.ibatis.ibator.eclipse.ui.actions.RunIbatorThread</code></td>
+ <td>This class is a thread that runs Ibator on the selected configuration file.
+ You can set a breakpoint in the <code>run</code> method of this class to follow
+ the Ibator code generation process from the beginning.
+ </td>
+ </tr>
+ <tr>
+ <td><code>org.apache.ibatis.ibator.eclipse.core.merge.JavaFileMerger</code></td>
+ <td>This class implements the Java file merge function. You can set a breakpoint
+ in the <code>getMergedSource</code> method to follow the merging process.
+ </td>
+ </tr>
+</table>
+
+<h2>Building the Documentation</h2>
+<p>The documentation for Ibator is integrated into the Eclipse help system.
+The documentation is partially generated (Javadocs), partially copied in from the
+core Ibator source tree, and partially maintained in the plugin itself.
+This full documentation set is not in Subversion because it is partially generated. If you would
+like to rebuild the documentation, simply execute the <code>buildDoc.xml</code> file
+in the <code>org.apache.ibatis.ibator.eclipse.doc</code> project (an Ant build file).</p>
+
+<h2>Building the Ibator Core JAR in Eclipse</h2>
+<p>The core Ibator JAR file has it's source code attached in the plugin, so you
+should be able to step into core Ibator methods for debug. If you have found a bug
+in Ibator, or would like to test an enhancement, you should modify the Ibator source code,
+and then rebuild the JAR for inclusion in the plugin.</p>
+<p>If you would like to modify/enhance the Ibator core JAR, then you can create a
+Java project for the core JAR by following these steps:</p>
+<ol>
+ <li>Start the Eclipse new project wizard
+ (File>New>Project...)
+ </li>
+ <li>Select the "Java Project from Existing Ant Buildfile" wizard, press "Next"</li>
+ <li>Browse to the "build.xml" file in the checked out project (for example
+ /Ibator/source/core/build/build.xml). Select the javac task found in target "build.compile".
+ The other javac tasks are used during the normal Ibator build to compile tests
+ and test support classes.
+ Accept the default for the other fields and press "Finish".</li>
+ <li>Wait for the workspace to build.</li>
+</ol>
+
+<p>Note that Ibator is compiled with JDK 5.0 for distribution.</p>
+
+<p>If you make a change in the Ibator core files, you can use the <code>buildIbator.xml</code>
+Ant build file in the <code>org.apache.ibatis.ibator.core</code> project to update the
+JAR in the plug-in. Note that this build file does not run the entire Ibator build (i.e. it
+does not run the tests).</p>
+
+</body>
+</html>
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/eclipseui.html
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/eclipseui.html?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/eclipseui.html (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/eclipseui.html Wed Dec 10 14:16:50 2008
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Using the Eclipse User Interface for Ibator</title>
+ <link type="text/css" rel="stylesheet" href="../ibatordoc/ibator.css"/>
+</head>
+<body>
+<h1>Using the Eclipse User Interface for Ibator</h1>
+<p>See the <a href="quickstart.html">Quickstart Guide</a> for a quick start!</p>
+<p>The Ibator user interface consists of these elements</p>
+<ul>
+ <li>A new file wizard for creating configuration files</li>
+ <li>An popup menu action to run Ibator</li>
+ <li>An integrated Ant Task</li>
+</ul>
+
+<h2>New Configuration File Wizard</h2>
+<p>The new configuration file wizard will create a new XML file with a basic outline
+of a configuration file for Ibator. You do not need to use this wizard, but it is useful
+for setting up a new configuration file.</p>
+
+<p>You can access the wizard from the menu: "File>New>Other..., and then selecting
+"Apache iBATIS Ibator Configuration File" from the "Apache iBATIS Ibator" category.</p>
+
+<h2>Run Ibator Action</h2>
+<p>The run Ibator action is the heart of the Eclipse user interface. The plug-in will
+ add a popup menu option called "Generate iBATIS Artifacts" to any XML file that has the
+ root element of "ibatorConfiguration". To run Ibator, right click on an Ibator
+ configuration file in any view and select the menu option.</p>
+
+<h2>Integrated Ant Task</h2>
+<p>See the page <a href="usingAnt.html">Using the Integrated Ant Task</a> for more
+information about using the integrated Ant task.</p>
+
+</body>
+</html>
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/importWizard.gif
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/importWizard.gif?rev=725464&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/importWizard.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/quickstart.html
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/quickstart.html?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/quickstart.html (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/quickstart.html Wed Dec 10 14:16:50 2008
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Apache iBATIS Ibator for Eclipse Quick Start Guide</title>
+ <link type="text/css" rel="stylesheet" href="../ibatordoc/ibator.css"/>
+</head>
+<body>
+<h1>Apache iBATIS Ibator for Eclipse Quick Start Guide</h1>
+<p>To get up and running quickly with Ibator in the Eclipse environment, follow these steps:</p>
+<ol>
+ <li>Create an Ibator configuration file:
+ <ol type="a">
+ <li>File>New>Other...</li>
+ <li>Select "Apache iBATIS Ibator Configuration File" from the "Apache iBATIS Ibator"
+ category, then press "Next"</li>
+ <li>Specify the location of the file, and the name of the file (defaults to ibatorConfig.xml)</li>
+ <li>Finish the wizard</li>
+ </ol>
+ </li>
+ <li>Fill out the configuration file appropriately. At a minimum, you must specify:
+ <ol type="a">
+ <li>jdbcConnection information to specify how to connect to the target database</li>
+ <li>A target package, and target project for the javaModelGenerator</li>
+ <li>A target package, and target project for the sqlMapGenerator</li>
+ <li>A target package, target project, and type for the daoGenerator (or you can remove the
+ daoGenerator element if you don't wish to generate DAOs)</li>
+ <li>At least one database table</li>
+ </ol>
+ </li>
+ <li>Save the file</li>
+ <li>Right click on the configuration file in Eclipse's navigator, or package explorer, view and take the
+ menu option to "Generate iBATIS Artifacts"</li>
+</ol>
+<p><b>Important Note:</b>
+ Ibator will not overwrite any custom changes you make to the objects it generates. You can
+ run it over and over again without fear of losing custom changes.</p>
+</body>
+</html>
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/releasenotes.html
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/releasenotes.html?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/releasenotes.html (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/releasenotes.html Wed Dec 10 14:16:50 2008
@@ -0,0 +1,67 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Ibator Eclipse Feature Release Notes</title>
+ <link type="text/css" rel="stylesheet" href="../ibatordoc/ibator.css"/>
+</head>
+<body>
+<h1>Ibator Eclipse Feature Release Notes</h1>
+<h2>Version 1.2.0</h2>
+<ul>
+ <li>As of version 1.2.0, Abator is renamed to Ibator</li>
+ <li>Upgraded to Ibator Version 1.2.0</li>
+ <li>Upgraded to Eclipse version 3.4.1</li>
+ <li>Removed the integrated editor as far better XML editors are available for
+ free</li>
+ <li>Removed the classpath variable for Ibator - use the Ibator JAR instead</li>
+ <li>Restructured the plugins to separate UI from core function</li>
+</ul>
+
+<h2>Version 1.1.0</h2>
+<ul>
+ <li>Upgraded to Abator Version 1.1.0</li>
+ <li>Upgraded to Eclipse Version 3.2</li>
+ <li>The Java merge function will now use the code formatter options
+ from the workspace</li>
+ <li>The integrated Ant task accepts additional properties to
+ match the Ant task in base Abator. See the
+ <a href="usingAnt.html">Using the Integrated Ant Task</a> page for more
+ information.</li>
+ <li>The integrated editor is now associated with any Abator configuration
+ file regardless of the filename.</li>
+</ul>
+
+<h2>Version 1.0.0</h2>
+<ul>
+ <li>Upgraded to Abator Version 1.0.0</li>
+ <li>Upgraded to Eclipse Version 3.1</li>
+ <li>The Java file merger now fully supports JSE 5.0</li>
+ <li>Fixed bug where multi-segment source paths failed</li>
+ <li>Use an adaptable type to associate Abator configuration files with the
+ popup menu items instead of content type. This should resolve conflicts
+ with other plug-ins like oXygen</li>
+ <li>The built-in Ant task now accepts a nested Ant <propertyset>
+ to allow passing properties into an Abatorf configuration file.</li>
+</ul>
+
+<h2>Version 0.6.5</h2>
+<ul>
+ <li>Upgraded to Abator Version 0.6.5</li>
+ <li>Changed EclipseShellCallback so that different source folders can be specified</li>
+</ul>
+
+<h2>Version 0.6.2</h2>
+<ul>
+ <li>Made our content type high priority to avoid conflicts with other XML
+ enabled plug-ins</li>
+</ul>
+
+<h2>Version 0.6.1</h2>
+<ul>
+ <li>Upgraded to Abator Version 0.6.1</li>
+ <li>Added an Eclipse enabled Ant task</li>
+</ul>
+</body>
+</html>
Added: ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/usingAnt.html
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/usingAnt.html?rev=725464&view=auto
==============================================================================
--- ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/usingAnt.html (added)
+++ ibatis/trunk/java/tools/ibator/eclipse/org.apache.ibatis.ibator.eclipse.doc/html-src/eclipseui/usingAnt.html Wed Dec 10 14:16:50 2008
@@ -0,0 +1,93 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Using the Integrated Ant Task</title>
+ <link type="text/css" rel="stylesheet" href="../ibatordoc/ibator.css"/>
+</head>
+<body>
+<h1>Using the Integrated Ant Task</h1>
+<p>The Ibator plugin includes an integrated Ant task for running Ibator. This
+Ant task is different from the Ant task included in the basic Ibator distribution
+in that it supports Java file merging, and is integrated with the eclipse user
+interface, logging system, and progress notification system.</p>
+<p>It is useful to use the integrated Ant task in the following situations:</p>
+<ul>
+ <li>When you want to automate an Ibator run, and support merging Java files.
+ In this case, you should setup an Ant build as demonstrated below, then
+ use an Eclipse headless Ant build to run Ibator automatically.
+ The standard eclipse help includes directions for running a headless
+ Ant build. Search in the Eclipse help for the word "headless".</li>
+ <li>When you want to provide a custom implementation of one of the
+ core Ibator interfaces. For example, if you want to provide a custom implementation
+ of the JavaTypeResolver interface. When running Ibator from the simple menu option,
+ you have no control over the classpath of the Ibator run. When you run from
+ Ant, you have much more control over the runtime classpath./li>
+</ul>
+
+<h2>Integrated Ant Task Detail</h2>
+<p>The Ibator plug-in declares an Ant task for use within the Eclipse JRE. The
+ task is called "ibator.generate". Here is en example Ant build file:</p>
+
+<pre>
+<project default="runIbator">
+ <target name="runIbator">
+ <eclipse.convertPath resourcepath="IbatorTest/src/config/ibatorConfig.xml"
+ property="thePath"/>
+ <ibator.generate configfile="${thePath}" />
+ </target>
+</project>
+</pre>
+<p>This file uses the Eclipse supplied "eclipse.convertPath" task to calculate the
+ actual path of the configuration file. Then we use the
+ "ibator.generate" task to run Ibator. When running
+ this from Eclipse interactively,
+ the Ant launch must be setup to run in the same JRE as the workspace.
+ This setting is a standard configuration setting for running Ant in Eclipse.
+</p>
+<p>The task supports an optional nested <code><propertyset></code> element which
+ is the standard Ant property set type. This can be used to pass parameters into
+ a configuration file.</p>
+
+<p>The integrated Ant task supports the following attributes:</p>
+<table border="1" cellspacing="0" cellpadding="5">
+ <tr>
+ <th>Attribute</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td valign="top">configfile</td>
+ <td>This is the Ibator configuration file to use. Use the "eclipse.convertPath"
+ task to convert a workspace path to an absolute path before setting this
+ attribute (as shown above)
+ <p>This attribute is required.</p></td>
+ </tr>
+ <tr>
+ <td valign="top">contextIds</td>
+ <td>If specified, then this is a comma delimited list of contexts to use in
+ the current run of Ibator. Any id specified in the list must exactly
+ match the value of the <code>id</code> attribute of an
+ <ibatorContext> configuration element. Only ids specified
+ in this list will be active for this run of Ibator. If this attribute
+ is not specified, then all contexts will be active.</td>
+ </tr>
+<tr>
+ <td valign="top">fullyQualifiedTableNames</td>
+ <td>If specified, then this is a comma delimited list of tables to use in
+ the current run of Ibator. Any table specified in the list must exactly
+ match the fully qualified table name specified in a
+ <table> configuration element. Only tables specified
+ in this list will be active for this run of Ibator. If this attribute
+ is not specified, then all tables will be active.
+ Specify table names as: <br/><br/>
+ <code>table</code><br/>
+ <code>schema.table</code><br/>
+ <code>catalog..table</code><br/>
+ etc.</td>
+</tr>
+</table>
+
+
+</body>
+</html>