cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ksen...@apache.org
Subject svn commit: r1163980 [1/2] - in /cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc: ./ .settings/ META-INF/ icons/ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/cayenne/ src/main/java/org/apache/c...
Date Thu, 01 Sep 2011 10:07:42 GMT
Author: kseniak
Date: Thu Sep  1 10:07:41 2011
New Revision: 1163980

URL: http://svn.apache.org/viewvc?rev=1163980&view=rev
Log:
CAY-1554. Applying the latest final results gsoc evaluation(Created the plugin which opens Cayenne Modeler)

Added:
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.classpath
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.project
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.settings/
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.settings/org.eclipse.jdt.core.prefs
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.settings/org.maven.ide.eclipse.prefs
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/META-INF/
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/META-INF/MANIFEST.MF
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/README
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/build.properties
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/icons/
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/icons/cayenne.png
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/plugin.xml
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/pom.xml
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/Activator.java
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginActionManager.java
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginApplication.java
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginMain.java
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginModelerController.java
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginModelerFrame.java
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginProjectController.java
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginProjectWatchdog.java
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/action/
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/action/PluginExitAction.java
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/action/PluginProjectAction.java
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/bindings/
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/bindings/PluginModelerModule.java
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/launcher/
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/launcher/EditorLauncher.java
    cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/launcher/InternalEditorLauncher.java

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.classpath
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.classpath?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.classpath (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.classpath Thu Sep  1 10:07:41 2011
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+	<classpathentry excluding="**" kind="src" output="target/classes" path="icons"/>
+	<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.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.project
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.project?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.project (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.project Thu Sep  1 10:07:41 2011
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>cayenne-modeler-eclipse-plugin</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>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.settings/org.eclipse.jdt.core.prefs?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.settings/org.eclipse.jdt.core.prefs (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.settings/org.eclipse.jdt.core.prefs Thu Sep  1 10:07:41 2011
@@ -0,0 +1,9 @@
+#Thu Jul 14 09:23:02 IST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.5

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.settings/org.maven.ide.eclipse.prefs
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.settings/org.maven.ide.eclipse.prefs?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.settings/org.maven.ide.eclipse.prefs (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/.settings/org.maven.ide.eclipse.prefs Thu Sep  1 10:07:41 2011
@@ -0,0 +1,8 @@
+#Thu May 12 09:59:56 EEST 2011
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/META-INF/MANIFEST.MF?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/META-INF/MANIFEST.MF (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/META-INF/MANIFEST.MF Thu Sep  1 10:07:41 2011
@@ -0,0 +1,90 @@
+Manifest-Version: 1.0
+Export-Package: org.apache.cayenne.launcher
+Embed-Directory: target/dependency
+Ignore-Package: sun.security.action,EDU.oswego.cs.dl.util.concurrent,j
+ avax.jms,org.eclipse.swt.ole.win32,com.werken.xpath,org.eclipse.osgi.
+ service.systembundle,com.sun.java.swing.plaf.windows,org.apache.avalo
+ n.framework.logger,net.sf.ehcache,org.jivesoftware.smackx.debugger,bs
+ h,javax.microedition.io
+Bundle-ClassPath: .,target/dependency/vpp-2.2.1.jar,target/dependency/
+ editors-3.5.0.v20090527-2000.jar,target/dependency/hsqldb-1.8.0.7.jar
+ ,target/dependency/jgroups-all-2.2.7.jar,target/dependency/oscache-2.
+ 3.2.jar,target/dependency/ide-3.6.2.M20101201-0800.jar,target/depende
+ ncy/filesystem-1.3.1.R36x_v20100727-0745.jar,target/dependency/osgi_R
+ 4_core-1.0.jar,target/dependency/ognl-2.6.7.jar,target/dependency/cay
+ enne-di-unpublished-3.1-SNAPSHOT.jar,target/dependency/jedit-syntax-2
+ .2.2.jar,target/dependency/inflector-0.7.0.jar,target/dependency/scop
+ emvc-1.0.1.jar,target/dependency/cayenne-jdk1.5-unpublished-3.1-SNAPS
+ HOT.jar,target/dependency/commons-collections-3.1.jar,target/dependen
+ cy/forms-1.0.5.jar,target/dependency/workbench-3.6.1.M20100826-1330.j
+ ar,target/dependency/osgi-3.6.1.R36x_v20100806.jar,target/dependency/
+ cayenne-wocompat-unpublished-3.1-SNAPSHOT.jar,target/dependency/commo
+ ns-pool-1.2.jar,target/dependency/resin-hessian-3.1.6.jar,target/depe
+ ndency/cayenne-modeler-3.1-SNAPSHOT.jar,target/dependency/jface-3.5.2
+ .M20100120-0800.jar,target/dependency/commons-logging-1.1.jar,target/
+ dependency/looks-1.3.1.jar,target/dependency/cayenne-tools-3.1-SNAPSH
+ OT.jar,target/dependency/resources-3.6.0.R36x_v20100825-0600.jar,targ
+ et/dependency/runtime-3.0.1.jar,target/dependency/cayenne-project-3.1
+ -SNAPSHOT.jar,target/dependency/smackx-2.2.1.jar,target/dependency/co
+ mmons-dbcp-1.2.1.jar,target/dependency/jgraph-5.13.0.0.jar,target/dep
+ endency/osgi_R4_compendium-1.0.jar,target/dependency/smack-2.2.1.jar
+Built-By: ksenia
+Tool: Bnd-1.15.0
+Bundle-Name: Cayenne Modeler Plugin for Eclipse
+Created-By: Apache Maven Bundle Plugin
+Require-Bundle: org.eclipse.core.runtime,org.eclipse.core.resources,or
+ g.eclipse.ui,org.eclipse.jface
+Bundle-Vendor: Apache Cayenne
+Build-Jdk: 1.6.0_22
+Bundle-Version: 3.1.0.SNAPSHOT
+Bnd-LastModified: 1314871393560
+Bundle-Activator: org.apache.cayenne.Activator
+Bundle-ManifestVersion: 2
+Bundle-Description: Apache Cayenne is a powerful, full-featured, and o
+ pen source		Java framework, plus developer tools, that provides Objec
+ t		Relational Mapping (ORM) and remoting services for persistence.		T
+ he software is licensed under the Apache License.
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Embed-Dependency: *;scope=compile|runtime|provided;inline=false;
+Bundle-DocURL: http://cayenne.apache.org/
+Import-Package: com.ibm.icu.text,com.ibm.icu.util,javax.accessibility,
+ javax.crypto,javax.crypto.spec,javax.imageio,javax.management,javax.n
+ aming,javax.naming.directory,javax.naming.spi,javax.net,javax.net.ssl
+ ,javax.security.auth.x500,javax.security.cert,javax.servlet,javax.ser
+ vlet.http,javax.servlet.jsp,javax.servlet.jsp.tagext,javax.sql,javax.
+ swing,javax.swing.border,javax.swing.event,javax.swing.filechooser,ja
+ vax.swing.plaf,javax.swing.plaf.basic,javax.swing.plaf.metal,javax.sw
+ ing.table,javax.swing.text,javax.swing.text.rtf,javax.swing.tree,java
+ x.swing.undo,javax.xml.parsers,javax.xml.transform,javax.xml.transfor
+ m.dom,javax.xml.transform.sax,javax.xml.transform.stream,junit.framew
+ ork,junit.swingui,junit.textui,org.apache.bcel.classfile,org.apache.b
+ cel.generic,org.apache.log4j,org.apache.log4j.net,org.apache.tools.an
+ t,org.apache.tools.ant.filters,org.apache.tools.ant.taskdefs,org.apac
+ he.tools.ant.types,org.apache.tools.ant.types.selectors,org.apache.to
+ ols.ant.util,org.eclipse.core.commands,org.eclipse.core.commands.comm
+ on,org.eclipse.core.commands.contexts,org.eclipse.core.commands.opera
+ tions,org.eclipse.core.commands.util,org.eclipse.core.databinding.obs
+ ervable,org.eclipse.core.databinding.observable.list,org.eclipse.core
+ .databinding.observable.value,org.eclipse.core.databinding.property,o
+ rg.eclipse.core.databinding.property.list,org.eclipse.core.databindin
+ g.property.value,org.eclipse.core.expressions,org.eclipse.core.filebu
+ ffers,org.eclipse.core.filebuffers.manipulation,org.eclipse.core.runt
+ ime.dynamichelpers,org.eclipse.equinox.p2.engine,org.eclipse.equinox.
+ p2.metadata,org.eclipse.equinox.p2.query,org.eclipse.help,org.eclipse
+ .jface.databinding.swt,org.eclipse.jface.internal.text.html,org.eclip
+ se.jface.text,org.eclipse.jface.text.hyperlink,org.eclipse.jface.text
+ .information,org.eclipse.jface.text.quickassist,org.eclipse.jface.tex
+ t.reconciler,org.eclipse.jface.text.revisions,org.eclipse.jface.text.
+ source,org.eclipse.jface.text.templates,org.eclipse.jface.text.templa
+ tes.persistence,org.eclipse.swt,org.eclipse.swt.accessibility,org.ecl
+ ipse.swt.browser,org.eclipse.swt.custom,org.eclipse.swt.dnd,org.eclip
+ se.swt.events,org.eclipse.swt.graphics,org.eclipse.swt.layout,org.ecl
+ ipse.swt.program,org.eclipse.swt.widgets,org.eclipse.ui.forms.events,
+ org.eclipse.ui.forms.widgets,org.eclipse.ui.texteditor.quickdiff,org.
+ eclipse.ui.texteditor.rulers,org.eclipse.ui.texteditor.spelling,org.j
+ dom,org.jdom.input,org.jdom.output,org.w3c.dom,org.xml.sax,org.xml.sa
+ x.ext,org.xml.sax.helpers
+Embed-StripGroup: true
+Bundle-SymbolicName: cayenne-modeler-eclipse-plugin-gsoc;singleton:=tr
+ ue
+

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/README
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/README?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/README (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/README Thu Sep  1 10:07:41 2011
@@ -0,0 +1,31 @@
+***************************************************************************************
+***********************CAYENNE MODELER ECLIPSE INTEGRATION*****************************
+***************************************************************************************
+
+This is project is for Cayenne modeler Eclipse integration.
+=============
+Environment --
+=============
+	* JDK 1.6 
+	* Apache Maven 2 or later
+	
+=============
+Installation --
+=============
+	1). Run mvn clean install 
+	2). Copy the cayenne-modeler-eclipse-plugin-3.1-SNAPSHOT.jar file from the target folder 
+		and paste it to your Eclipse-Installation-Directory/Plugins folder.
+	
+	Now the Plugin has been successfully installed.
+	Note : To generate java docs run : mvn javadoc:javadoc
+		   Before running mvn clean install, make sure, that META-INF/MANIFEST.MF is empty as it is supposed to be regenerated
+
+==========================
+The usage of the Plugin --
+==========================	 
+	1). Import or create the java project which has the cayenne configuration xml files.
+	2). You can see the cayenne configuration xml files with the cayenne icon.
+	3). To launch the Cayenne modeler double click on such a file or open it with "cayenne modeler 
+		eclipse plugin" editor.
+	4). Then you can perform any modifications in opened Modeler and once you have done with the modifications, 
+		click on save button and it will update the java classes and in the Eclipse workspace.
\ No newline at end of file

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/build.properties
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/build.properties?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/build.properties (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/build.properties Thu Sep  1 10:07:41 2011
@@ -0,0 +1,9 @@
+source.. = src/main/java/,\
+
+output.. = target/classes/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               target/dependency/
+
+eshan

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/icons/cayenne.png
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/icons/cayenne.png?rev=1163980&view=auto
==============================================================================
Files cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/icons/cayenne.png (added) and cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/icons/cayenne.png Thu Sep  1 10:07:41 2011 differ

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/plugin.xml
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/plugin.xml?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/plugin.xml (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/plugin.xml Thu Sep  1 10:07:41 2011
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+    <extension point="org.eclipse.core.contenttype.contentTypes">
+        <content-type base-type="org.eclipse.core.runtime.xml"
+                      file-extensions="xml"
+                      id="org.apache.cayenne.extentions.modeler.projectFile"
+                      name="Project File"
+                      priority="normal">
+            <describer class="org.eclipse.core.runtime.content.XMLRootElementContentDescriber">
+                <parameter name="element" value="domain"></parameter>
+            </describer>
+        </content-type>
+         <!-- Load other xml files -->
+        <content-type base-type="org.eclipse.core.runtime.xml"
+                      file-extensions="xml"
+                      id="internal.editor"
+                      name="internal.editor"
+                      priority="normal">
+            <describer class="org.eclipse.core.runtime.content.XMLRootElementContentDescriber">
+                <parameter name="element" value="data-map"></parameter>
+            </describer>
+        </content-type>
+    </extension>  
+    
+
+    <extension point="org.eclipse.ui.editors">
+        <editor name="Cayenne Modeler Eclipse Plugin" icon="icons/cayenne.png"
+                launcher="org.apache.cayenne.launcher.EditorLauncher"
+                id="org.apache.cayenne.launcher.EditorLauncher">           
+            <contentTypeBinding contentTypeId="org.apache.cayenne.extentions.modeler.projectFile">
+            </contentTypeBinding>
+        </editor>
+         <!-- -Load other cayenne files-->   
+      <editor name="Cayenne XML files" icon="icons/cayenne.png"
+       			launcher = "org.apache.cayenne.launcher.InternalEditorLauncher"
+                id="org.apache.cayenne.launcher.InternalEditorLauncher">                  
+            <contentTypeBinding contentTypeId="internal.editor">
+            </contentTypeBinding>
+        </editor> 
+    </extension> 
+</plugin>
\ No newline at end of file

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/pom.xml
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/pom.xml?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/pom.xml (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/pom.xml Thu Sep  1 10:07:41 2011
@@ -0,0 +1,353 @@
+<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">
+	<repositories>
+		<repository>
+			<id>repository</id>
+			<name>Repository</name>
+			<url>file://${project.basedir}/repository</url>
+		</repository>
+		<repository>
+			<id>cayenne-deps</id>
+			<url>http://maven.objectstyle.org/nexus/content/groups/cayenne-deps/</url>
+		</repository>
+	</repositories>
+	<properties>
+		<bundle.symbolicName>cayenne-modeler-eclipse-plugin-gsoc</bundle.symbolicName>
+		<bundle.namespace>org.apache.cayenne</bundle.namespace>
+	</properties>
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.cayenne</groupId>
+		<artifactId>cayenne-parent</artifactId>
+		<version>3.1-SNAPSHOT</version>
+	</parent>
+	<artifactId>cayenne-modeler-eclipse-plugin</artifactId>
+	<name>Cayenne Modeler Plugin for Eclipse</name>
+	<packaging>bundle</packaging>
+	<build>
+		<resources>
+			<resource>
+				<targetPath>icons</targetPath>
+				<directory>icons</directory>
+
+			</resource>
+			<resource>
+				<directory>.</directory>
+				<includes>
+					<include>plugin.xml</include>
+				</includes>
+			</resource>
+		</resources>
+		<plugins>
+			<plugin>
+				<artifactId>maven-eclipse-plugin</artifactId>
+				<version>2.8</version>
+				<configuration>
+					<configuration>
+						<skip>false</skip>
+						<pde>true</pde>
+						<buildcommands>
+							<buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
+							<buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
+							<buildcommand>org.eclipse.pde.SchemaBuilder</buildcommand>
+						</buildcommands>
+						<projectnatures>
+							<projectnature>org.eclipse.jem.workbench.JavaEMFNature</projectnature>
+							<projectnature>org.eclipse.pde.PluginNature</projectnature>
+							<projectnature>org.eclipse.jdt.core.javanature</projectnature>
+							<projectnature>org.eclipse.jem.beaninfo.BeanInfoNature</projectnature>
+						</projectnatures>
+						<classpathContainers>
+							<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
+							<classpathContainer>org.eclipse.pde.core.requiredPlugins</classpathContainer>
+						</classpathContainers>
+					</configuration>
+
+				</configuration>
+			</plugin>
+
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<version>2.3.1</version>
+				<configuration>
+					<archive>
+						<manifestFile>META-INF/MANIFEST.MF</manifestFile>
+						<addMavenDescriptor>false</addMavenDescriptor>
+					</archive>
+				</configuration>
+			</plugin>
+
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<version>2.3.4</version>
+				<extensions>true</extensions>
+				<configuration>
+					<manifestLocation>META-INF</manifestLocation>
+					<instructions>
+						<Include-Resource>target/classes</Include-Resource>
+						<Bundle-SymbolicName>${bundle.symbolicName};singleton:=true
+                        </Bundle-SymbolicName>
+						<!-- <Bundle-Localization>plugin</Bundle-Localization> <Eclipse-LazyStart>true</Eclipse-LazyStart> -->
+						<Bundle-Version>${project.version}</Bundle-Version>
+
+						<Require-Bundle>
+							org.eclipse.core.runtime,
+							org.eclipse.core.resources,
+							org.eclipse.ui,
+							org.eclipse.jface
+						</Require-Bundle>
+
+						<Import-Package>
+							!EDU.oswego.cs.dl.util.concurrent,
+							!bsh,
+							!org.apache.avalon.framework.logger,
+							!org.eclipse.osgi.service.systembundle,
+							!org.eclipse.swt.ole.win32,
+							!com.sun.java.swing.plaf.windows,
+							!com.werken.xpath,
+							!javax.jms,
+							!org.jivesoftware.smackx.debugger,
+							!sun.security.action,
+							!net.sf.ehcache,
+							!javax.microedition.io,
+							*
+						</Import-Package>
+						<Export-Package>org.apache.cayenne.launcher</Export-Package>
+						<Bundle-Activator>${bundle.namespace}.Activator
+                        </Bundle-Activator>
+						<Embed-Dependency>
+							*;scope=compile|runtime|provided;inline=false;
+                        </Embed-Dependency>
+
+						<Embed-Directory>target/dependency
+                        </Embed-Directory>
+						<Embed-StripGroup>true</Embed-StripGroup>
+					</instructions>
+				</configuration>
+			</plugin>
+			<plugin>
+				<artifactId>maven-dependency-plugin
+                </artifactId>
+				<executions>
+					<execution>
+						<id>copy-dependencies</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy-dependencies</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<configuration>
+					<source>1.5</source>
+					<target>1.5</target>
+				</configuration>
+			</plugin>
+
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-javadoc-plugin</artifactId>
+				<version>2.8</version>
+				<configuration>
+					<stylesheetfile>${basedir}/src/main/javadoc/stylesheet.css</stylesheetfile>
+					<show>public</show>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+	<dependencies>
+		<!-- Eclipse dependencies -->
+		<dependency>
+			<groupId>org.eclipse.ui</groupId>
+			<artifactId>workbench</artifactId>
+			<version>3.6.1.M20100826-1330</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.ui</groupId>
+			<artifactId>editors</artifactId>
+			<version>3.5.0.v20090527-2000</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.core</groupId>
+			<artifactId>resources</artifactId>
+			<version>3.6.0.R36x_v20100825-0600</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.eclipse.core</groupId>
+			<artifactId>runtime</artifactId>
+			<version>3.0.1</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse</groupId>
+			<artifactId>osgi</artifactId>
+			<version>3.6.1.R36x_v20100806</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse</groupId>
+			<artifactId>jface</artifactId>
+			<version>3.5.2.M20100120-0800</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.core</groupId>
+			<artifactId>filesystem</artifactId>
+			<version>1.3.1.R36x_v20100727-0745</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.ui</groupId>
+			<artifactId>ide</artifactId>
+			<version>3.6.2.M20101201-0800</version>
+		</dependency>
+
+
+		<!-- Cayenne dependencies -->
+		<dependency>
+			<groupId>org.apache.cayenne</groupId>
+			<artifactId>cayenne-modeler</artifactId>
+			<version>${project.version}</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.cayenne.unpublished</groupId>
+			<artifactId>cayenne-jdk1.5-unpublished</artifactId>
+			<version>${project.version}</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.cayenne</groupId>
+			<artifactId>cayenne-project</artifactId>
+			<version>${project.version}</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.cayenne</groupId>
+			<artifactId>cayenne-tools</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.cayenne.unpublished</groupId>
+			<artifactId>cayenne-wocompat-unpublished</artifactId>
+			<version>${project.version}</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.cayenne.unpublished</groupId>
+			<artifactId>cayenne-di-unpublished</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+
+		<!-- Third-party dependencies -->
+
+		<dependency>
+			<groupId>com.caucho</groupId>
+			<artifactId>resin-hessian</artifactId>
+			<version>3.1.6</version>
+		</dependency>
+		<dependency>
+			<groupId>opensymphony</groupId>
+			<artifactId>oscache</artifactId>
+			<version>2.3.2</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>jgroups</groupId>
+			<artifactId>jgroups-all</artifactId>
+			<version>2.2.7</version>
+		</dependency>
+		<dependency>
+			<groupId>jgoodies</groupId>
+			<artifactId>looks</artifactId>
+			<version>1.3.1</version>
+		</dependency>
+		<dependency>
+			<groupId>jgoodies</groupId>
+			<artifactId>forms</artifactId>
+			<version>1.0.5</version>
+		</dependency>
+		<dependency>
+			<groupId>jivesoftware</groupId>
+			<artifactId>smack</artifactId>
+			<version>2.2.1</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>jivesoftware</groupId>
+			<artifactId>smackx</artifactId>
+			<version>2.2.1</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>ognl</groupId>
+			<artifactId>ognl</artifactId>
+			<version>2.6.7</version>
+		</dependency>
+		<dependency>
+			<groupId>org.scopemvc</groupId>
+			<artifactId>scopemvc</artifactId>
+			<version>1.0.1</version>
+		</dependency>
+		<dependency>
+			<groupId>hsqldb</groupId>
+			<artifactId>hsqldb</artifactId>
+			<version>1.8.0.7</version>
+		</dependency>
+		<dependency>
+			<groupId>jgraph</groupId>
+			<artifactId>jgraph</artifactId>
+			<version>5.13.0.0</version>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.jedit-syntax</groupId>
+			<artifactId>jedit-syntax</artifactId>
+			<version>2.2.2</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-dbcp</groupId>
+			<artifactId>commons-dbcp</artifactId>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>commons-pool</groupId>
+			<artifactId>commons-pool</artifactId>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>commons-logging</groupId>
+			<artifactId>commons-logging</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>commons-collections</groupId>
+			<artifactId>commons-collections</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>foundrylogic.vpp</groupId>
+			<artifactId>vpp</artifactId>
+			<version>2.2.1</version>
+		</dependency>
+		<dependency>
+			<groupId>net.java.dev.inflector</groupId>
+			<artifactId>inflector</artifactId>
+			<version>0.7.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.osgi</groupId>
+			<artifactId>osgi_R4_core</artifactId>
+			<version>1.0</version>
+			<scope>provided</scope>
+			<optional>true</optional>
+		</dependency>
+		<dependency>
+			<groupId>org.osgi</groupId>
+			<artifactId>osgi_R4_compendium</artifactId>
+			<version>1.0</version>
+			<scope>provided</scope>
+			<optional>true</optional>
+		</dependency>
+	</dependencies>
+</project>
\ No newline at end of file

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/Activator.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/Activator.java?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/Activator.java (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/Activator.java Thu Sep  1 10:07:41 2011
@@ -0,0 +1,90 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.cayenne;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.osgi.framework.BundleContext;
+
+public class Activator extends AbstractUIPlugin {
+
+	/**
+	 * The shared instance.
+	 */
+	private static Activator plugin;
+	public static final String PLUGIN_ID = "org.apache.cayenne.extentions";
+
+	/**
+	 * The constructor.
+	 */
+	public Activator() {
+		super();
+		plugin = this;
+
+	}
+
+	/**
+	 * Returns the shared instance of the plug-in.
+	 */
+	public static Activator getDefault() {
+		return plugin == null ? new Activator() : plugin;
+	}
+
+	public void updateWorkspace(IPath path) {
+
+		try {
+			IWorkspace workspace = ResourcesPlugin.getWorkspace();
+			IWorkspaceRoot root = workspace.getRoot();
+			IProject project = root.getFileForLocation(path).getProject();
+			project.refreshLocal(IResource.DEPTH_INFINITE, null);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns an image descriptor for the image file at the given plug-in
+	 * relative path
+	 * 
+	 * @param path
+	 *            the path
+	 * @return the image descriptor
+	 */
+	public static ImageDescriptor getImageDescriptor(String path) {
+		return imageDescriptorFromPlugin(PLUGIN_ID, path);
+	}
+
+}
\ No newline at end of file

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginActionManager.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginActionManager.java?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginActionManager.java (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginActionManager.java Thu Sep  1 10:07:41 2011
@@ -0,0 +1,66 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.cayenne.extentions.modeler;
+
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.extentions.modeler.action.PluginExitAction;
+import org.apache.cayenne.extentions.modeler.action.PluginProjectAction;
+
+import org.apache.cayenne.modeler.Application;
+
+import org.apache.cayenne.modeler.action.DefaultActionManager;
+
+/**
+ * A <code>PluginActionManager</code> is a subclass of
+ * <code>DefaultActionManager</code> which is more specific for the
+ * <code>CayenneModeler</code> Eclipse PluginActionManager class responsible for
+ * registering and removing actions which is required by the Eclipse Integration
+ * plugin.
+ */
+public class PluginActionManager extends DefaultActionManager {
+
+	/**
+	 * Constructor of <code>PluginActionManager</code>
+	 * 
+	 * @param application
+	 *            Application Instance which is running in the form of
+	 *            PluginApplication.
+	 */
+	public PluginActionManager(@Inject Application application) {
+		super(application);
+		configureActions(application);
+	}
+
+	/**
+	 * Configurations of the DefaultActionManager class's Action Collections is
+	 * done here.
+	 * 
+	 * @param application
+	 *            Application Instance which is running in the form
+	 */
+
+	private void configureActions(Application application) {
+
+		addProjectAction(PluginProjectAction.class.getName());
+		registerAction(new PluginProjectAction(application));
+		registerAction(new PluginExitAction(application)).setAlwaysOn(true);
+
+	}
+}
\ No newline at end of file

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginApplication.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginApplication.java?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginApplication.java (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginApplication.java Thu Sep  1 10:07:41 2011
@@ -0,0 +1,182 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.cayenne.extentions.modeler;
+
+import java.awt.Dialog;
+import java.awt.Frame;
+import java.awt.Window;
+
+import javax.swing.JFrame;
+import javax.swing.JRootPane;
+
+import org.apache.cayenne.extentions.modeler.PluginActionManager;
+import org.apache.cayenne.modeler.Application;
+import org.apache.cayenne.modeler.CayenneModelerController;
+import org.apache.cayenne.modeler.dialog.LogConsole;
+import org.apache.cayenne.modeler.undo.CayenneUndoManager;
+import org.apache.cayenne.modeler.util.AdapterMapping;
+import org.apache.cayenne.modeler.util.CayenneDialog;
+import org.apache.cayenne.swing.BindingFactory;
+
+import org.scopemvc.controller.basic.ViewContext;
+import org.scopemvc.controller.swing.SwingContext;
+import org.scopemvc.core.View;
+import org.scopemvc.util.UIStrings;
+import org.scopemvc.view.swing.SwingView;
+
+/**
+ * A <code>PluginApplication</code> is a subclass of <code>Application</code>
+ * which is more specific for the <code>CayenneModeler</code> Eclipse
+ * Integration.
+ */
+
+public class PluginApplication extends Application {
+
+	/**
+	 * <code>CayenneModelerController</code> of the main application frame. In
+	 * this we are referring Eclipse Integration specific implementation of
+	 * <code>CayenneModelerController</code> which is
+	 * <code>PluginModelerController</code>
+	 */
+
+	/**
+	 * Constructor
+	 */
+	public PluginApplication() {
+	}
+
+	/**
+	 * Returns Action Manager of PlugingApplication object in the form of
+	 * <code>ActionManager</code>
+	 * 
+	 * @return a <code>ActionManager</code> object that indicates the Action
+	 *         Manager of this component
+	 * @see Application#getInjector
+	 */
+	@Override
+	public PluginActionManager getActionManager() {
+		return injector.getInstance(PluginActionManager.class);
+
+	}
+
+	/**
+	 * Returns CayenneModelerController of PlugingApplication object in the form
+	 * of <code>PluginModelerController</code>
+	 * 
+	 * @return a <code>PluginModelerController</code> object that indicates the
+	 *         CayenneModelerController of this component
+	 */
+	@Override
+	public CayenneModelerController getFrameController() {
+		return frameController;
+	}
+
+	/**
+	 * Specific Implementation of startup method of <code>Application</code> for
+	 * Cayenne Eclipse Integration. Starts the PlugingApplication for
+	 * CayanneModeler.
+	 */
+	@Override
+	public void startup() {
+		initPreferences();
+		initClassLoader();
+		this.bindingFactory = new BindingFactory();
+		this.adapterMapping = new AdapterMapping();
+		UIStrings.setPropertiesName(DEFAULT_MESSAGE_BUNDLE);
+		ViewContext.clearThreadContext();
+
+		this.undoManager = new CayenneUndoManager(this);
+		// Assign Eclipse plugin specific implementation
+		this.frameController = new PluginModelerController(this);
+		Application ap = new Application();
+		ViewContext.setGlobalContext(new ModelerContext(frameController
+				.getFrame()));
+		// open up
+		frameController.startupAction();
+		LogConsole.getInstance().showConsoleIfNeeded();
+		getFrame().setVisible(true);
+	}
+
+	final class ModelerContext extends SwingContext {
+
+		JFrame frame;
+
+		public ModelerContext(JFrame frame) {
+			this.frame = frame;
+		}
+
+		@Override
+		protected void showViewInPrimaryWindow(SwingView view) {
+		}
+
+		/**
+		 * Creates closeable dialogs.
+		 */
+		@Override
+		protected void showViewInDialog(SwingView inView) {
+			Window parentWindow = getDefaultParentWindow();
+
+			final CayenneDialog dialog;
+			if (parentWindow instanceof Dialog) {
+				dialog = new CayenneDialog((Dialog) parentWindow);
+			} else {
+				dialog = new CayenneDialog((Frame) parentWindow);
+			}
+
+			if (inView.getTitle() != null) {
+				dialog.setTitle(inView.getTitle());
+			}
+			if (inView.getDisplayMode() == SwingView.MODAL_DIALOG) {
+				dialog.setModal(true);
+			} else {
+				dialog.setModal(false);
+			}
+			dialog.setResizable(inView.isResizable());
+
+			setupWindow(dialog.getRootPane(), inView, true);
+			dialog.toFront();
+		}
+
+		/**
+		 * Overrides super implementation to allow using Scope together with
+		 * normal Swing code that CayenneModeler already has.
+		 */
+		@Override
+		public JRootPane findRootPaneFor(View view) {
+			JRootPane pane = super.findRootPaneFor(view);
+
+			if (pane != null) {
+				return pane;
+			}
+
+			if (((SwingView) view).getDisplayMode() != SwingView.PRIMARY_WINDOW) {
+				return pane;
+			}
+
+			return frame.getRootPane();
+		}
+
+		@Override
+		protected Window getDefaultParentWindow() {
+			return frame;
+		}
+	}
+
+}
\ No newline at end of file

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginMain.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginMain.java?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginMain.java (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginMain.java Thu Sep  1 10:07:41 2011
@@ -0,0 +1,124 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.cayenne.extentions.modeler;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.swing.SwingUtilities;
+
+import org.apache.cayenne.di.DIBootstrap;
+import org.apache.cayenne.di.Injector;
+import org.apache.cayenne.di.Module;
+import org.apache.cayenne.modeler.Application;
+import org.apache.cayenne.modeler.Main;
+import org.apache.cayenne.modeler.action.OpenProjectAction;
+import org.apache.cayenne.modeler.init.platform.PlatformInitializer;
+import org.apache.cayenne.project.CayenneProjectModule;
+import org.apache.cayenne.configuration.server.ServerModule;
+import org.apache.cayenne.extentions.modeler.bindings.PluginModelerModule;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * A <code>PluginMain</code> is a subclass of <code>Main</code> which is more
+ * specific for the <code>CayenneModeler</code> Eclipse Integration.PluginMain
+ * class responsible for starting CayenneModeler.
+ */
+public class PluginMain extends Main {
+
+	private static Log logger = LogFactory.getLog(PluginMain.class);
+
+	/**
+	 * Constructor of <code>PluginMain</code>
+	 * 
+	 * @param args
+	 *            FIle location of Cayenne Project file.
+	 * @see Main#main
+	 */
+	public PluginMain(String[] args) {
+		super(args);
+	}
+
+	/**
+	 * Main method that starts the CayenneModeler.
+	 */
+	public static void main(String[] args) {
+		try {
+			new PluginMain(args).launch();
+		} catch (Exception e) {
+			e.printStackTrace();
+			System.exit(1);
+		}
+	}
+
+	/**
+	 * launch method that starts the CayenneModeler.
+	 */
+	@Override
+	protected void launch() {
+		final Injector injector = DIBootstrap
+				.createInjector(appendModules(new ArrayList<Module>()));
+		logger.info("Starting CayenneModeler.");
+		logger.info("JRE v." + System.getProperty("java.version") + " at "
+				+ System.getProperty("java.home"));
+
+		// init look and feel before starting any Swing classes...
+		injector.getInstance(PlatformInitializer.class).initLookAndFeel();
+
+		SwingUtilities.invokeLater(new Runnable() {
+
+			public void run() {
+				PluginApplication application = (PluginApplication) injector
+						.getInstance(Application.class);
+				PluginApplication.setInstance(application);
+				application.startup();
+
+				// start initial project AFTER the app startup, as we need
+				// Application
+				// preferences to be bootstrapped.
+
+				File project = initialProjectFromArgs();
+				if (project == null) {
+					project = initialProjectFromPreferences();
+				}
+
+				if (project != null) {
+					new OpenProjectAction(application).openProject(project);
+				}
+			}
+		});
+
+	}
+
+	/**
+	 * PlugingModlerModule is added to bind Cayanne modeler Eclipse Integration
+	 * implementations.
+	 */
+	@Override
+	protected Collection<Module> appendModules(Collection<Module> modules) {
+		modules.add(new ServerModule("CayenneModeler"));
+		modules.add(new CayenneProjectModule());
+		modules.add(new PluginModelerModule());
+
+		return modules;
+	}
+}
\ No newline at end of file

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginModelerController.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginModelerController.java?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginModelerController.java (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginModelerController.java Thu Sep  1 10:07:41 2011
@@ -0,0 +1,235 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.cayenne.extentions.modeler;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.dnd.DropTarget;
+import java.awt.dnd.DropTargetAdapter;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.event.ActionEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.swing.JOptionPane;
+import javax.swing.WindowConstants;
+import javax.swing.filechooser.FileFilter;
+
+import org.apache.cayenne.Activator;
+import org.apache.cayenne.extentions.modeler.action.PluginExitAction;
+import org.apache.cayenne.gen.ClassGenerationAction;
+import org.apache.cayenne.modeler.Application;
+import org.apache.cayenne.modeler.CayenneModelerController;
+
+import org.apache.cayenne.modeler.ModelerConstants;
+import org.apache.cayenne.modeler.action.OpenProjectAction;
+import org.apache.cayenne.modeler.dialog.codegen.CodeGeneratorController;
+import org.apache.cayenne.modeler.dialog.codegen.GeneratorTabController;
+import org.apache.cayenne.modeler.dialog.validator.ValidatorDialog;
+import org.apache.cayenne.modeler.editor.EditorView;
+import org.apache.cayenne.modeler.init.platform.PlatformInitializer;
+import org.apache.cayenne.modeler.pref.ComponentGeometry;
+import org.apache.cayenne.modeler.util.FileFilters;
+import org.apache.cayenne.map.DataMap;
+import org.apache.cayenne.project.Project;
+import org.apache.cayenne.project.validation.ProjectValidator;
+import org.apache.cayenne.validation.ValidationFailure;
+import org.apache.cayenne.validation.ValidationResult;
+import org.eclipse.core.runtime.Path;
+
+/**
+ * A <code>PluginModelerController</code> is a subclass of
+ * <code>CayenneModelerController</code> which is more specific for the
+ * <code>CayenneModeler</code> Eclipse Integration.PluginMain class responsible
+ * for starting CayenneModeler. This as the Controller of the main application
+ * frame.
+ */
+public class PluginModelerController extends CayenneModelerController {
+
+	/**
+	 * Constructor of <code>PluginModelerController</code>
+	 * 
+	 * @param application
+	 *            PluginApplication object relevant to the controller.
+	 */
+	public PluginModelerController(PluginApplication application) {
+		// since super class constructor is setting application we need to set
+		// it here
+		this.application = application;
+		this.frame = new PluginModelerFrame(application.getActionManager());
+
+		application.getInjector().getInstance(PlatformInitializer.class)
+				.setupMenus(frame);
+		this.projectController = new PluginProjectController(this);
+
+	}
+
+	public void setFrame(PluginModelerFrame frame) {
+		this.frame = frame;
+	}
+
+	/**
+	 * In case of saving a Cayenne project from Cayenne modeler this method
+	 * execute java class Generation and Update Eclipse working space.
+	 */
+	@Override
+	public void projectSavedAction() {
+
+		DataMap dataMap = application.getFrameController()
+				.getProjectController().getCurrentDataMap();
+		if (dataMap != null) {
+
+			CodeGeneratorController codeGenerateController = new CodeGeneratorController(
+					getApplication().getFrameController(), dataMap);
+			GeneratorTabController generatorSelector = new GeneratorTabController(
+					codeGenerateController);
+
+			ClassGenerationAction generator = generatorSelector.getGenerator();
+			generator.addEmbeddables(dataMap.getEmbeddables());
+			generator.addEntities(dataMap.getObjEntities());
+
+			if (generator != null) {
+				try {
+					generator.execute();
+					JOptionPane.showMessageDialog(this.getView(),
+							"Java Classes are Sucessfuly Updated ");
+				} catch (Exception e) {
+					JOptionPane.showMessageDialog(this.getView(),
+							"Error generating classes - " + e.getMessage());
+				}
+			}
+		}
+		// Update Eclipse workspace
+		Activator.getDefault().updateWorkspace(
+				new Path(projectController.getProject()
+						.getConfigurationResource().getURL().getPath()));
+		super.projectSavedAction();
+
+	}
+
+	@Override
+	protected void initBindings() {
+
+		frame.addWindowListener(new WindowAdapter() {
+			// PluginExit Action is set for project exit.
+			public void windowClosing(WindowEvent e) {
+				getApplication().getActionManager()
+						.getAction(PluginExitAction.class).exit();
+			}
+		});
+
+		new DropTarget(frame, new DropTargetAdapter() {
+
+			public void drop(DropTargetDropEvent dtde) {
+				dtde.acceptDrop(dtde.getDropAction());
+				Transferable transferable = dtde.getTransferable();
+				dtde.dropComplete(processDropAction(transferable));
+			}
+		});
+
+		ComponentGeometry geometry = new ComponentGeometry(frame.getClass(),
+				null);
+		geometry.bind(frame, 650, 550, 0);
+
+		frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+
+	}
+
+	@SuppressWarnings({ "unchecked", "rawtypes" })
+	private boolean processDropAction(Transferable transferable) {
+		List<File> fileList;
+		try {
+			fileList = (List) transferable
+					.getTransferData(DataFlavor.javaFileListFlavor);
+		} catch (Exception e) {
+			return false;
+		}
+
+		File transferFile = fileList.get(0);
+
+		if (transferFile.isFile()) {
+
+			FileFilter filter = FileFilters.getApplicationFilter();
+
+			if (filter.accept(transferFile)) {
+				ActionEvent e = new ActionEvent(transferFile,
+						ActionEvent.ACTION_PERFORMED, "OpenProject");
+				Application.getInstance().getActionManager()
+						.getAction(OpenProjectAction.class).actionPerformed(e);
+				return true;
+			}
+		}
+
+		return false;
+	}
+
+	@Override
+	public void projectOpenedAction(Project project) {
+		projectController.setProject(project);
+		frame.setView(new EditorView(projectController));
+		projectController.projectOpened();
+		application.getActionManager().projectOpened();
+
+		// do status update AFTER the project is actually opened...
+		if (project.getConfigurationResource() == null) {
+			updateStatus("New project created...");
+			frame.setTitle(ModelerConstants.TITLE + "- [New]");
+		} else {
+			updateStatus("Project opened...");
+			frame.setTitle(ModelerConstants.TITLE + " - "
+					+ project.getConfigurationResource().getURL().getPath());
+		}
+
+		// update preferences
+		if (project.getConfigurationResource() != null) {
+			getLastDirectory().setDirectory(
+					new File(project.getConfigurationResource().getURL()
+							.getPath()));
+			frame.fireRecentFileListChanged();
+		}
+
+		// for validation purposes combine load failures with post-load
+		// validation (not
+		// sure if that'll cause duplicate messages?).
+		List<ValidationFailure> allFailures = new ArrayList<ValidationFailure>();
+		Collection<ValidationFailure> loadFailures = project
+				.getConfigurationTree().getLoadFailures();
+
+		if (!loadFailures.isEmpty()) {
+			// mark project as unsaved
+			project.setModified(true);
+			projectController.setDirty(true);
+			allFailures.addAll(loadFailures);
+		}
+
+		ProjectValidator projectValidator = getApplication().getInjector()
+				.getInstance(ProjectValidator.class);
+		ValidationResult validationResult = projectValidator.validate(project
+				.getRootNode());
+		allFailures.addAll(validationResult.getFailures());
+		if (!allFailures.isEmpty()) {
+			ValidatorDialog.showDialog(frame, validationResult.getFailures());
+		}
+	}
+}
\ No newline at end of file

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginModelerFrame.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginModelerFrame.java?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginModelerFrame.java (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginModelerFrame.java Thu Sep  1 10:07:41 2011
@@ -0,0 +1,248 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.cayenne.extentions.modeler;
+
+import java.awt.BorderLayout;
+import java.awt.event.KeyEvent;
+import java.awt.event.WindowEvent;
+
+import javax.swing.Action;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+
+import org.apache.cayenne.extentions.modeler.action.PluginExitAction;
+import org.apache.cayenne.extentions.modeler.action.PluginProjectAction;
+
+import org.apache.cayenne.modeler.action.ActionManager;
+import org.apache.cayenne.modeler.CayenneModelerFrame;
+import org.apache.cayenne.modeler.action.AboutAction;
+import org.apache.cayenne.modeler.action.ConfigurePreferencesAction;
+import org.apache.cayenne.modeler.action.CopyAction;
+import org.apache.cayenne.modeler.action.CreateDataMapAction;
+import org.apache.cayenne.modeler.action.CreateDbEntityAction;
+import org.apache.cayenne.modeler.action.CreateEmbeddableAction;
+import org.apache.cayenne.modeler.action.CreateNodeAction;
+import org.apache.cayenne.modeler.action.CreateObjEntityAction;
+import org.apache.cayenne.modeler.action.CreateProcedureAction;
+import org.apache.cayenne.modeler.action.CreateQueryAction;
+import org.apache.cayenne.modeler.action.CutAction;
+import org.apache.cayenne.modeler.action.DocumentationAction;
+import org.apache.cayenne.modeler.action.GenerateCodeAction;
+import org.apache.cayenne.modeler.action.GenerateDBAction;
+import org.apache.cayenne.modeler.action.ImportDBAction;
+import org.apache.cayenne.modeler.action.ImportDataMapAction;
+import org.apache.cayenne.modeler.action.ImportEOModelAction;
+import org.apache.cayenne.modeler.action.InferRelationshipsAction;
+import org.apache.cayenne.modeler.action.MigrateAction;
+import org.apache.cayenne.modeler.action.NewProjectAction;
+import org.apache.cayenne.modeler.action.ObjEntitySyncAction;
+import org.apache.cayenne.modeler.action.OpenProjectAction;
+import org.apache.cayenne.modeler.action.PasteAction;
+import org.apache.cayenne.modeler.action.ProjectAction;
+import org.apache.cayenne.modeler.action.RedoAction;
+import org.apache.cayenne.modeler.action.RemoveAction;
+import org.apache.cayenne.modeler.action.RevertAction;
+import org.apache.cayenne.modeler.action.SaveAction;
+import org.apache.cayenne.modeler.action.SaveAsAction;
+import org.apache.cayenne.modeler.action.ShowLogConsoleAction;
+import org.apache.cayenne.modeler.action.UndoAction;
+import org.apache.cayenne.modeler.action.ValidateAction;
+import org.apache.cayenne.modeler.dialog.LogConsole;
+import org.apache.cayenne.modeler.util.RecentFileMenu;
+
+/**
+ * A <code>PluginModelerFrame</code> is a subclass of
+ * <code>CayenneModelerFrame</code> which is more specific for the
+ * <code>CayenneModeler</code> Eclipse Integration.
+ */
+public class PluginModelerFrame extends CayenneModelerFrame {
+
+	/**
+	 * Constructor of <code>PluginModelerFrame</code>
+	 * 
+	 * @param actionManager
+	 *            ActionManager which Stores a map of modeler actions, and deals
+	 *            with those actions
+	 */
+	public PluginModelerFrame(ActionManager actionManager) {
+		super(actionManager);
+	}
+
+	/**
+	 * Menu creation Specific to the Eclipse integration project.
+	 */
+	@Override
+	protected void initMenus() {
+		getContentPane().setLayout(new BorderLayout());
+
+		JMenu fileMenu = new JMenu("File");
+		JMenu editMenu = new JMenu("Edit");
+		JMenu projectMenu = new JMenu("Project");
+		JMenu toolMenu = new JMenu("Tools");
+		JMenu helpMenu = new JMenu("Help");
+
+		fileMenu.setMnemonic(KeyEvent.VK_F);
+		editMenu.setMnemonic(KeyEvent.VK_E);
+		projectMenu.setMnemonic(KeyEvent.VK_P);
+		toolMenu.setMnemonic(KeyEvent.VK_T);
+		helpMenu.setMnemonic(KeyEvent.VK_H);
+
+		fileMenu.add(getAction(NewProjectAction.class).buildMenu());
+		fileMenu.add(getAction(OpenProjectAction.class).buildMenu());
+		// Set PluginProjectAction to file menu
+		fileMenu.add(getAction(PluginProjectAction.class).buildMenu());
+		fileMenu.add(getAction(ImportDataMapAction.class).buildMenu());
+		fileMenu.addSeparator();
+		fileMenu.add(getAction(SaveAction.class).buildMenu());
+		fileMenu.add(getAction(SaveAsAction.class).buildMenu());
+		fileMenu.add(getAction(RevertAction.class).buildMenu());
+		fileMenu.addSeparator();
+
+		// Disable Unwanted Actions for Eclipse Plugin project
+		disableUnwantedMenuItems(fileMenu);
+
+		editMenu.add(getAction(UndoAction.class).buildMenu());
+		editMenu.add(getAction(RedoAction.class).buildMenu());
+		editMenu.add(getAction(CutAction.class).buildMenu());
+		editMenu.add(getAction(CopyAction.class).buildMenu());
+		editMenu.add(getAction(PasteAction.class).buildMenu());
+
+		recentFileMenu = new RecentFileMenu("Recent Projects");
+		// addRecentFileListListener(recentFileMenu);
+		fileMenu.add(recentFileMenu);
+
+		fileMenu.addSeparator();
+		fileMenu.add(getAction(PluginExitAction.class).buildMenu());
+
+		projectMenu.add(getAction(ValidateAction.class).buildMenu());
+		projectMenu.addSeparator();
+		projectMenu.add(getAction(CreateNodeAction.class).buildMenu());
+		projectMenu.add(getAction(CreateDataMapAction.class).buildMenu());
+
+		projectMenu.add(getAction(CreateObjEntityAction.class).buildMenu());
+		projectMenu.add(getAction(CreateEmbeddableAction.class).buildMenu());
+		projectMenu.add(getAction(CreateDbEntityAction.class).buildMenu());
+
+		projectMenu.add(getAction(CreateProcedureAction.class).buildMenu());
+		projectMenu.add(getAction(CreateQueryAction.class).buildMenu());
+
+		projectMenu.addSeparator();
+		projectMenu.add(getAction(ObjEntitySyncAction.class).buildMenu());
+		projectMenu.addSeparator();
+		projectMenu.add(getAction(RemoveAction.class).buildMenu());
+
+		toolMenu.add(getAction(ImportDBAction.class).buildMenu());
+		toolMenu.add(getAction(InferRelationshipsAction.class).buildMenu());
+		toolMenu.add(getAction(ImportEOModelAction.class).buildMenu());
+		toolMenu.addSeparator();
+		toolMenu.add(getAction(GenerateCodeAction.class).buildMenu());
+		toolMenu.add(getAction(GenerateDBAction.class).buildMenu());
+		toolMenu.add(getAction(MigrateAction.class).buildMenu());
+
+		/**
+		 * Menu for opening Log console
+		 */
+		toolMenu.addSeparator();
+
+		logMenu = getAction(ShowLogConsoleAction.class).buildCheckBoxMenu();
+
+		if (!LogConsole.getInstance().getConsoleProperty(
+				LogConsole.DOCKED_PROPERTY)
+				&& LogConsole.getInstance().getConsoleProperty(
+						LogConsole.SHOW_CONSOLE_PROPERTY)) {
+			LogConsole.getInstance().setConsoleProperty(
+					LogConsole.SHOW_CONSOLE_PROPERTY, false);
+		}
+
+		updateLogConsoleMenu();
+		toolMenu.add(logMenu);
+
+		toolMenu.addSeparator();
+		toolMenu.add(getAction(ConfigurePreferencesAction.class).buildMenu());
+
+		helpMenu.add(getAction(AboutAction.class).buildMenu());
+		helpMenu.add(getAction(DocumentationAction.class).buildMenu());
+
+		JMenuBar menuBar = new JMenuBar();
+
+		menuBar.add(fileMenu);
+		menuBar.add(editMenu);
+		menuBar.add(projectMenu);
+		menuBar.add(toolMenu);
+		menuBar.add(helpMenu);
+
+		setJMenuBar(menuBar);
+
+	}
+
+	private <T extends Action> T getAction(Class<T> type) {
+
+		return actionManager.getAction(type);
+
+	}
+
+	/**
+	 * Override JFrame method such that it doesnot execute System.exit(0). So
+	 * When we close Cayenne modeler Eclipse is not shut down.
+	 */
+	@Override
+	protected void processWindowEvent(WindowEvent e) {
+		super.processWindowEvent(e);
+
+		if (e.getID() == WindowEvent.WINDOW_CLOSING) {
+			switch (HIDE_ON_CLOSE) {
+			case HIDE_ON_CLOSE:
+				setVisible(false);
+				break;
+			case DISPOSE_ON_CLOSE:
+				dispose();
+				break;
+			case DO_NOTHING_ON_CLOSE:
+			default:
+				break;
+			case EXIT_ON_CLOSE:
+
+				/**
+				 * Since this is commented Eclipse instance will not shut down
+				 * whn we close cayenne modeler
+				 */
+				// System.exit(0);
+				break;
+			}
+		}
+	}
+
+	private void disableUnwantedMenuItems(JMenu fileMenu) {
+
+		for (int i = 0; i < fileMenu.getItemCount(); i++) {
+			JMenuItem item = fileMenu.getItem(i);
+			if (item != null) {
+				String name = item.getText();
+				if (NewProjectAction.getActionName().equals(name)
+						|| OpenProjectAction.getActionName().equals(name)
+						|| ProjectAction.getActionName().equals(name)
+						|| "Recent Projects".equals(name)) {
+					item.setEnabled(false);
+				}
+			}
+		}
+	}
+}
\ No newline at end of file

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginProjectController.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginProjectController.java?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginProjectController.java (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginProjectController.java Thu Sep  1 10:07:41 2011
@@ -0,0 +1,110 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.cayenne.extentions.modeler;
+
+import java.util.Collection;
+
+import org.apache.cayenne.configuration.DataChannelDescriptor;
+import org.apache.cayenne.map.DataMap;
+import org.apache.cayenne.map.EntityResolver;
+import org.apache.cayenne.modeler.CayenneModelerController;
+import org.apache.cayenne.modeler.ProjectController;
+import org.apache.cayenne.modeler.ProjectWatchdog;
+import org.apache.cayenne.project.Project;
+
+/**
+ * A <code>PluginProjectController</code> is a subclass of
+ * <code>ProjectController</code> which is more specific for the
+ * <code>CayenneModeler</code> Eclipse Integration.
+ */
+public class PluginProjectController extends ProjectController {
+
+	private EntityResolver entityResolver;
+	private PluginProjectWatchdog watchdog;
+
+	/**
+	 * Constructor of <code>PluginProjectController</code>
+	 * 
+	 * @param parent
+	 *            controller for the plugin application frame.
+	 */
+	public PluginProjectController(CayenneModelerController parent) {
+		super(parent);
+	}
+
+	public EntityResolver getEntityResolver() {
+		return entityResolver;
+	}
+
+	/**
+	 * returns instance of PluginProjectWatchdog class is responsible for
+	 * tracking changes in cayenne.xml and other Cayenne project files
+	 */
+	public ProjectWatchdog getProjectWatcher() {
+		return watchdog;
+	}
+
+	/**
+	 * Start PluginProjectWatchdog which is checking the changes in Cayenne
+	 * project when we modify the Cayenne related XML file from Eclipse IDE
+	 */
+	@Override
+	public void setProject(Project currentProject) {
+		if (this.project != currentProject) {
+
+			this.project = currentProject;
+			this.projectControllerPreferences = null;
+
+			if (project == null) {
+				this.entityResolver = null;
+
+				if (watchdog != null) {
+					watchdog.interrupt();
+					watchdog = null;
+				}
+			} else {
+				if (watchdog == null) {
+					watchdog = new PluginProjectWatchdog(this);
+					watchdog.start();
+				}
+
+				watchdog.reconfigure();
+
+				entityResolver = new EntityResolver(
+						((DataChannelDescriptor) currentProject.getRootNode())
+								.getDataMaps());
+
+				updateEntityResolver();
+			}
+		}
+	}
+
+	public void updateEntityResolver() {
+
+		Collection<DataMap> dataMaps = ((DataChannelDescriptor) project
+				.getRootNode()).getDataMaps();
+
+		entityResolver.setDataMaps(dataMaps);
+
+		for (DataMap dataMap : dataMaps) {
+			dataMap.setNamespace(entityResolver);
+		}
+	}
+}

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginProjectWatchdog.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginProjectWatchdog.java?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginProjectWatchdog.java (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/PluginProjectWatchdog.java Thu Sep  1 10:07:41 2011
@@ -0,0 +1,204 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.cayenne.extentions.modeler;
+
+import java.util.List;
+import java.awt.Frame;
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.swing.JOptionPane;
+
+import org.apache.cayenne.Activator;
+import org.apache.cayenne.configuration.ConfigurationTree;
+import org.apache.cayenne.configuration.DataChannelDescriptor;
+import org.apache.cayenne.configuration.DataChannelDescriptorLoader;
+import org.apache.cayenne.configuration.XMLDataChannelDescriptorLoader;
+import org.apache.cayenne.configuration.XMLDataMapLoader;
+import org.apache.cayenne.gen.ClassGenerationAction;
+import org.apache.cayenne.map.DataMap;
+import org.apache.cayenne.modeler.Application;
+import org.apache.cayenne.modeler.CayenneModelerController;
+import org.apache.cayenne.modeler.ProjectController;
+import org.apache.cayenne.modeler.ProjectWatchdog;
+import org.apache.cayenne.modeler.action.OpenProjectAction;
+import org.apache.cayenne.modeler.dialog.ErrorDebugDialog;
+import org.apache.cayenne.modeler.dialog.codegen.CodeGeneratorController;
+import org.apache.cayenne.modeler.dialog.codegen.GeneratorTabController;
+import org.apache.cayenne.project.Project;
+import org.apache.cayenne.project.ProjectLoader;
+import org.apache.cayenne.project.validation.ProjectValidator;
+import org.apache.cayenne.resource.Resource;
+import org.apache.cayenne.resource.URLResource;
+import org.apache.cayenne.validation.ValidationFailure;
+import org.apache.cayenne.validation.ValidationResult;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.eclipse.core.runtime.Path;
+
+/**
+ * A <code>PluginProjectWatchdog</code> is a subclass of
+ * <code>ProjectWatchdog</code> which is more specific for the
+ * <code>CayenneModeler</code> Eclipse Integration. ProjectWatchdog class is
+ * responsible for tracking changes in cayenne.xml and other Cayenne project
+ * files.
+ */
+public class PluginProjectWatchdog extends ProjectWatchdog {
+
+	private static Log logger = LogFactory.getLog(PluginProjectWatchdog.class);
+
+	public PluginProjectWatchdog(ProjectController mediator) {
+		super(mediator);
+	}
+
+	/**
+	 * When a external change occurs this method is executed. For eclipse plugin
+	 * we do not show confirmation window and just update the project in cayenne
+	 * modeler
+	 */
+	@Override
+	protected void doOnChange(FileInfo fileInfo) {
+		// Currently we are reloading all project on a change
+		if (mediator.getProject() != null) {
+
+			File fileDirectory = new File(mediator.getProject()
+					.getConfigurationResource().getURL().getPath());
+			Application.getInstance().getActionManager()
+					.getAction(OpenProjectAction.class)
+					.openProject(fileDirectory);
+			if (isValidExternalModifications(fileDirectory)) {
+				generateJavaClasses(fileDirectory);
+			}
+		}
+
+	}
+
+	/**
+	 * If the external modifications (from Eclipse IDE) are valid returns true
+	 * otherwise returns false.
+	 * 
+	 * @param file
+	 *            XML files related to the cayenne project.
+	 */
+	private boolean isValidExternalModifications(File file) {
+
+		try {
+			CayenneModelerController controller = Application.getInstance()
+					.getFrameController();
+			controller.addToLastProjListAction(file.getAbsolutePath());
+
+			URL url = file.toURL();
+			Resource rootSource = new URLResource(url);
+
+			Project project = Application.getInstance().getInjector()
+					.getInstance(ProjectLoader.class).loadProject(rootSource);
+
+			mediator.setProject(project);
+			List<ValidationFailure> allFailures = new ArrayList<ValidationFailure>();
+			Collection<ValidationFailure> loadFailures = project
+					.getConfigurationTree().getLoadFailures();
+
+			if (!loadFailures.isEmpty()) {
+				allFailures.addAll(loadFailures);
+			}
+
+			ProjectValidator projectValidator = Application.getInstance()
+					.getInjector().getInstance(ProjectValidator.class);
+			ValidationResult validationResult = projectValidator
+					.validate(project.getRootNode());
+			allFailures.addAll(validationResult.getFailures());
+
+			if (!allFailures.isEmpty()) {
+				logger.error("Exernal Modification of Cayenne Project are invalid.");
+				return false;
+			} else {
+				logger.info("Re Generated the java classes acoording to the modifications.");
+				return true;
+			}
+
+		} catch (Exception e) {
+			logger.warn("Error loading project file.", e);
+			ErrorDebugDialog.guiWarning(e, "Error loading project");
+			return false;
+		}
+
+	}
+
+	/**
+	 * Re generate the java classes according to the changes in XML
+	 * files.(Modification are done through the Eclipse IDE). If the
+	 * modifications are invalid we are not re generating java classes and shows
+	 * a proper error window.
+	 */
+	private void generateJavaClasses(File file) {
+
+		XMLDataMapLoader datamapLoader = new XMLDataMapLoader();
+		Resource rootSource;
+		DataMap dataMap = null;
+		try {
+			URL url = file.toURL();
+			rootSource = new URLResource(url);
+			dataMap = datamapLoader.load(mediator.getProject()
+					.getConfigurationResource());
+
+			DataChannelDescriptorLoader loader = new XMLDataChannelDescriptorLoader();
+			ConfigurationTree<DataChannelDescriptor> tree = loader
+					.load(new URLResource(file.toURL()));
+			Project p = new Project(tree);
+
+			JOptionPane.showMessageDialog(new Frame(), "THIS IS FOR TESTING..."
+					+ dataMap.getLocation());
+
+		} catch (Exception e) {
+			logger.warn("Error loading project file.", e);
+		}
+
+		if (dataMap != null) {
+
+			CodeGeneratorController codeGenerateController = new CodeGeneratorController(
+					Application.getInstance().getFrameController(), dataMap);
+			GeneratorTabController generatorSelector = new GeneratorTabController(
+					codeGenerateController);
+
+			ClassGenerationAction generator = generatorSelector.getGenerator();
+			generator.addEmbeddables(dataMap.getEmbeddables());
+			generator.addEntities(dataMap.getObjEntities());
+
+			if (generator != null) {
+				try {
+					generator.execute();
+					JOptionPane.showMessageDialog(Application.getInstance()
+							.getFrameController().getView(),
+							"Java Classes are Sucessfuly Updated ");
+				} catch (Exception e) {
+					JOptionPane.showMessageDialog(Application.getInstance()
+							.getFrameController().getView(),
+							"Error generating classes - " + e.getMessage());
+				}
+			}
+		}
+		// Update Eclipse workspace
+		Activator.getDefault().updateWorkspace(
+				new Path(mediator.getProject().getConfigurationResource()
+						.getURL().getPath()));
+	}
+}

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/action/PluginExitAction.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/action/PluginExitAction.java?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/action/PluginExitAction.java (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/action/PluginExitAction.java Thu Sep  1 10:07:41 2011
@@ -0,0 +1,73 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.cayenne.extentions.modeler.action;
+
+import java.awt.event.ActionEvent;
+
+import org.apache.cayenne.modeler.Application;
+import org.apache.cayenne.modeler.action.ExitAction;
+import org.apache.cayenne.modeler.dialog.LogConsole;
+import org.apache.cayenne.pref.RenamedPreferences;
+
+/**
+ * A <code>PluginExitAction</code> is a subclass of <code>ExitAction</code>
+ * which is more specific for the <code>CayenneModeler</code> Eclipse
+ * Integration.
+ */
+public class PluginExitAction extends ExitAction {
+
+	/**
+	 * Constructor for PluginExitAction.
+	 * 
+	 * @param application
+	 *            PluginApplication object which is running relevant to the
+	 *            PluginExitAction
+	 */
+	public PluginExitAction(Application application) {
+		super(application);
+
+	}
+
+	@Override
+	public void performAction(ActionEvent e) {
+		this.exit();
+	}
+
+	/**
+	 * This method is executed when we close a project.
+	 */
+	@Override
+	public void exit() {
+		System.out.println("Shuting Down Cayenne Modeler");
+
+		if (!checkSaveOnClose()) {
+			return;
+		}
+
+		LogConsole.getInstance().stopLogging();
+		RenamedPreferences.removeNewPreferences();
+
+		// Since Eclipse Project should not shutdown we can not exit
+		// System.exit(0);
+
+		application.getFrameController().getView().setVisible(false);
+		closeProject(false);
+	}
+}
\ No newline at end of file

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/action/PluginProjectAction.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/action/PluginProjectAction.java?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/action/PluginProjectAction.java (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/action/PluginProjectAction.java Thu Sep  1 10:07:41 2011
@@ -0,0 +1,49 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.cayenne.extentions.modeler.action;
+
+import java.awt.event.ActionEvent;
+import org.apache.cayenne.modeler.Application;
+import org.apache.cayenne.modeler.action.ProjectAction;
+
+/**
+ * A <code>PluginProjectAction</code> is a subclass of
+ * <code>ProjectAction</code> which is more specific for the
+ * <code>CayenneModeler</code> Eclipse Integration.
+ */
+public class PluginProjectAction extends ProjectAction {
+
+	/**
+	 * Constructor for PluginExitAction.
+	 * 
+	 * @param application
+	 *            PluginApplication object which is running relevant to the
+	 *            PluginProjectAction
+	 */
+	public PluginProjectAction(Application application) {
+		super(application);
+	}
+
+	@Override
+	public void performAction(ActionEvent e) {
+		super.performAction(e);
+		Application.getInstance().getFrameController().getWindow().dispose();
+	}
+
+}
\ No newline at end of file

Added: cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/bindings/PluginModelerModule.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/bindings/PluginModelerModule.java?rev=1163980&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/bindings/PluginModelerModule.java (added)
+++ cayenne/sandbox/cayenne-modeler-eclipse-plugin-gsoc/src/main/java/org/apache/cayenne/extentions/modeler/bindings/PluginModelerModule.java Thu Sep  1 10:07:41 2011
@@ -0,0 +1,53 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.cayenne.extentions.modeler.bindings;
+
+import org.apache.cayenne.di.Binder;
+import org.apache.cayenne.extentions.modeler.PluginActionManager;
+import org.apache.cayenne.extentions.modeler.PluginApplication;
+import org.apache.cayenne.modeler.Application;
+import org.apache.cayenne.modeler.action.ActionManager;
+import org.apache.cayenne.modeler.init.CayenneModelerModule;
+import org.apache.cayenne.modeler.init.platform.GenericPlatformInitializer;
+import org.apache.cayenne.modeler.init.platform.PlatformInitializer;
+import org.apache.cayenne.modeler.util.DefaultWidgetFactory;
+import org.apache.cayenne.modeler.util.WidgetFactory;
+import org.apache.cayenne.project.validation.DefaultProjectValidator;
+import org.apache.cayenne.project.validation.ProjectValidator;
+
+/**
+ * A DI module for bootstrapping CayenneModeler services.
+ */
+public class PluginModelerModule extends CayenneModelerModule {
+
+	/**
+	 * Bind plugin specific Classes. So Those instances can be obtained from the
+	 * Injector.
+	 */
+	public void configure(Binder binder) {
+		binder.bind(PluginActionManager.class).to(PluginActionManager.class);
+		binder.bind(ActionManager.class).to(PluginActionManager.class);
+		binder.bind(Application.class).to(PluginApplication.class);
+		binder.bind(PlatformInitializer.class).to(
+				GenericPlatformInitializer.class);
+		binder.bind(WidgetFactory.class).to(DefaultWidgetFactory.class);
+		binder.bind(ProjectValidator.class).to(DefaultProjectValidator.class);
+	}
+}



Mime
View raw message