You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2006/06/18 14:49:50 UTC
svn commit: r415128 [1/2] - in
/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser: ./ META-INF/ cayenne/
dist/ icons/ lib/ lib/server/ src/ src/org/ src/org/apache/
src/org/apache/cayenne/ src/org/apache/cayenne/ropbrowser/
src/org/apache/cayenne/rop...
Author: aadamchik
Date: Sun Jun 18 05:49:47 2006
New Revision: 415128
URL: http://svn.apache.org/viewvc?rev=415128&view=rev
Log:
CAY-569 - initial import of cayenne-rop code
Added:
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/.classpath (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/.project (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/META-INF/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/META-INF/MANIFEST.MF (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/build.properties (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/cayenne.xml (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/ropbrowserMap.map.xml (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/ropbrowserNode.driver.xml (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/build.properties (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/build.xml (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/log4j.properties (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/web.xml (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/icons/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/icons/sample.gif (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/cayenne-client-nodeps-1.2RC1.jar (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/commons-collections-3.1.jar (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/commons-lang-2.1.jar (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/commons-logging.jar (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/hessian-3.0.13.jar (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/server/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/server/cayenne-1.2RC1.jar (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/server/hessian-3.0.13.jar (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/server/postgresql-8.1-405.jdbc2ee.jar (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/plugin.xml (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ConnectionManager.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ModelTest.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditor.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditorContextMenuProvider.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditorInput.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ROPBrowserPlugin.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/commands/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/commands/ObjectSetConstraintCommand.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/CollectionFigure.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/CompartmentFigure.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/NullFigure.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/AbstractObject.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Artist.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/CollectionModelElement.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Connection.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Gallery.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/IObject.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/ModelElement.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/NullModelElement.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/ObjectDiagram.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Painting.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/auto/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/auto/_Artist.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/auto/_Gallery.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/auto/_Painting.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/parts/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/parts/CollectionEditPart.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/parts/ConnectionEditPart.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/parts/ElementEditPart.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/parts/NullEditPart.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/parts/ObjectDiagramEditPart.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/parts/ObjectEditPartFactory.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/policies/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/policies/CollectionDirectEditPolicy.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/policies/CollectionSelectionPolicy.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/server/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/server/Artist.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/server/Gallery.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/server/Painting.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/server/auto/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/server/auto/_Artist.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/server/auto/_Gallery.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/server/auto/_Painting.java (with props)
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/views/
incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/views/ControlPanelView.java (with props)
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/.classpath
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/.classpath?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/.classpath (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/.classpath Sun Jun 18 05:49:47 2006
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry excluding="org/apache/cayenne/ropbrowser/Artist.java|org/apache/cayenne/ropbrowser/Gallery.java|org/apache/cayenne/ropbrowser/Painting.java|org/apache/cayenne/ropbrowser/auto/|org/apache/cayenne/ropbrowser/server/|org/apache/cayenne/ropbrowser/ModelTest.java" kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="cayenne"/>
+ <classpathentry kind="lib" path="lib/commons-collections-3.1.jar"/>
+ <classpathentry kind="lib" path="lib/commons-lang-2.1.jar"/>
+ <classpathentry kind="lib" path="lib/commons-logging.jar"/>
+ <classpathentry kind="lib" path="lib/hessian-3.0.13.jar"/>
+ <classpathentry kind="lib" path="lib/cayenne-client-nodeps-1.2RC1.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/.classpath
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/.project
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/.project?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/.project (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/.project Sun Jun 18 05:49:47 2006
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>rop-browser</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>
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/.project
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/META-INF/MANIFEST.MF?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/META-INF/MANIFEST.MF (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/META-INF/MANIFEST.MF Sun Jun 18 05:49:47 2006
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: RopBrowser Plug-in
+Bundle-SymbolicName: ropbrowser; singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.apache.cayenne.ropbrowser.ROPBrowserPlugin
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.ui.forms,
+ org.eclipse.ui.views,
+ org.eclipse.gef
+Eclipse-AutoStart: true
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/META-INF/MANIFEST.MF
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/build.properties
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/build.properties?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/build.properties (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/build.properties Sun Jun 18 05:49:47 2006
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/build.properties
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/cayenne.xml
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/cayenne.xml?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/cayenne.xml (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/cayenne.xml Sun Jun 18 05:49:47 2006
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<domains project-version="1.1">
+<domain name="ropbrowser">
+ <map name="ropbrowserMap" location="ropbrowserMap.map.xml"/>
+
+ <node name="ropbrowserNode"
+ datasource="ropbrowserNode.driver.xml"
+ factory="org.objectstyle.cayenne.conf.DriverDataSourceFactory">
+ <map-ref name="ropbrowserMap"/>
+ </node>
+</domain>
+</domains>
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/cayenne.xml
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/ropbrowserMap.map.xml
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/ropbrowserMap.map.xml?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/ropbrowserMap.map.xml (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/ropbrowserMap.map.xml Sun Jun 18 05:49:47 2006
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<data-map project-version="1.1">
+ <property name="defaultPackage" value="org.apache.cayenne.ropbrowser.server"/>
+ <property name="defaultSchema" value="public"/>
+ <property name="clientSupported" value="true"/>
+ <property name="defaultClientPackage" value="org.apache.cayenne.ropbrowser.model"/>
+ <db-entity name="Artist" schema="public">
+ <db-attribute name="ALIVE" type="BOOLEAN" isMandatory="true"/>
+ <db-attribute name="ARTIST_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+ <db-attribute name="ARTIST_NAME" type="VARCHAR" isMandatory="true" length="64"/>
+ <db-attribute name="DATE_OF_BIRTH" type="DATE"/>
+ </db-entity>
+ <db-entity name="Gallery" schema="public">
+ <db-attribute name="GALLERY_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+ <db-attribute name="GALLERY_NAME" type="VARCHAR" isMandatory="true" length="64"/>
+ </db-entity>
+ <db-entity name="Painting" schema="public">
+ <db-attribute name="ARTIST_ID" type="INTEGER" isMandatory="true"/>
+ <db-attribute name="ESTIMATED_PRICE" type="FLOAT" precision="2"/>
+ <db-attribute name="GALLERY_ID" type="INTEGER" isMandatory="true"/>
+ <db-attribute name="PAINTING_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+ <db-attribute name="PAINTING_NAME" type="VARCHAR" isMandatory="true" length="64"/>
+ </db-entity>
+ <obj-entity name="Artist" className="org.apache.cayenne.ropbrowser.server.Artist" clientClassName="org.apache.cayenne.ropbrowser.model.Artist" dbEntityName="Artist" clientSuperClassName="org.apache.cayenne.ropbrowser.model.AbstractObject">
+ <obj-attribute name="alive" type="java.lang.Boolean" db-attribute-path="ALIVE"/>
+ <obj-attribute name="artistName" type="java.lang.String" db-attribute-path="ARTIST_NAME"/>
+ <obj-attribute name="dateOfBirth" type="java.util.Date" db-attribute-path="DATE_OF_BIRTH"/>
+ </obj-entity>
+ <obj-entity name="Gallery" className="org.apache.cayenne.ropbrowser.server.Gallery" clientClassName="org.apache.cayenne.ropbrowser.model.Gallery" dbEntityName="Gallery" clientSuperClassName="org.apache.cayenne.ropbrowser.model.AbstractObject">
+ <obj-attribute name="galleryName" type="java.lang.String" db-attribute-path="GALLERY_NAME"/>
+ </obj-entity>
+ <obj-entity name="Painting" className="org.apache.cayenne.ropbrowser.server.Painting" clientClassName="org.apache.cayenne.ropbrowser.model.Painting" dbEntityName="Painting" clientSuperClassName="org.apache.cayenne.ropbrowser.model.AbstractObject">
+ <obj-attribute name="estimatedPrice" type="java.lang.Float" db-attribute-path="ESTIMATED_PRICE"/>
+ <obj-attribute name="paintingName" type="java.lang.String" db-attribute-path="PAINTING_NAME"/>
+ </obj-entity>
+ <db-relationship name="ARTIST_PAINTING" source="Artist" target="Painting" toMany="true">
+ <db-attribute-pair source="ARTIST_ID" target="ARTIST_ID"/>
+ </db-relationship>
+ <db-relationship name="GALLERY_PAINTING" source="Gallery" target="Painting" toMany="true">
+ <db-attribute-pair source="GALLERY_ID" target="GALLERY_ID"/>
+ </db-relationship>
+ <db-relationship name="PAINTING_ARTIST" source="Painting" target="Artist" toMany="false">
+ <db-attribute-pair source="ARTIST_ID" target="ARTIST_ID"/>
+ </db-relationship>
+ <db-relationship name="PAINTING_GALLERY" source="Painting" target="Gallery" toMany="false">
+ <db-attribute-pair source="GALLERY_ID" target="GALLERY_ID"/>
+ </db-relationship>
+ <obj-relationship name="artistPainting" source="Artist" target="Painting" db-relationship-path="ARTIST_PAINTING"/>
+ <obj-relationship name="galleryPainting" source="Gallery" target="Painting" db-relationship-path="GALLERY_PAINTING"/>
+ <obj-relationship name="paintingArtist" source="Painting" target="Artist" db-relationship-path="PAINTING_ARTIST"/>
+ <obj-relationship name="paintingGallery" source="Painting" target="Gallery" db-relationship-path="PAINTING_GALLERY"/>
+ <query name="ArtistQuery" factory="org.objectstyle.cayenne.map.SelectQueryBuilder" root="obj-entity" root-name="Artist">
+ </query>
+ <query name="GalleryQuery" factory="org.objectstyle.cayenne.map.SelectQueryBuilder" root="obj-entity" root-name="Gallery">
+ </query>
+</data-map>
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/ropbrowserMap.map.xml
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/ropbrowserNode.driver.xml
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/ropbrowserNode.driver.xml?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/ropbrowserNode.driver.xml (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/ropbrowserNode.driver.xml Sun Jun 18 05:49:47 2006
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<driver project-version="1.1" class="org.postgresql.Driver">
+ <url value="jdbc:postgresql://localhost:5432/ropbrowser"/>
+ <connectionPool min="1" max="1" />
+ <login userName="ropbrowser" password="ropbrowser"/>
+</driver>
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/cayenne/ropbrowserNode.driver.xml
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/build.properties
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/build.properties?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/build.properties (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/build.properties Sun Jun 18 05:49:47 2006
@@ -0,0 +1,15 @@
+# This can be overriden from command line to point to Eclipse location
+eclipse.home = g:/eclipse
+
+server.src = ../src/org/apache/cayenne/ropbrowser/server
+client.src = ../src/org/apache/cayenne/ropbrowser/model
+webxml = web.xml
+cayenne.xml = ../cayenne/${_cayenne.xml}
+cayenneMap.xml = ../cayenne/${_cayenneMap.xml}
+cayenneNode.xml = ../cayenne/${_cayenneNode.xml}
+build.cayenne.xml = classes/${_cayenne.xml}
+build.cayenneMap.xml = classes/${_cayenneMap.xml}
+build.cayenneNode.xml = classes/${_cayenneNode.xml}
+_cayenne.xml = cayenne.xml
+_cayenneMap.xml = ropbrowserMap.map.xml
+_cayenneNode.xml = ropbrowserNode.driver.xml
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/build.properties
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/build.xml
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/build.xml?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/build.xml (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/build.xml Sun Jun 18 05:49:47 2006
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+
+<!-- ================================================= -->
+<!-- Provides a class generator for the client classes. -->
+<!-- ================================================= -->
+<project name="cws" default="package">
+
+ <property file="build.properties"/>
+
+ <path id="classpath">
+ <fileset dir="${eclipse.home}/plugins" includes="org.eclipse.ui.views_*.jar,org.eclipse.draw2d_*.jar"/>
+ <fileset dir="../lib" includes="**/*.jar"/>
+ </path>
+
+ <target name="compile"
+ depends="compile-client,compile-server"/>
+
+ <target name="package" depends="compile,war"/>
+
+ <target name="compile-client" description="compile the client classes">
+ <mkdir dir="build/client"/>
+ <javac srcdir="${client.src}" destdir="build/client"
+ classpathref="classpath"/>
+ </target>
+
+ <target name="compile-server" description="compile the server classes">
+ <mkdir dir="build/server"/>
+ <javac srcdir="${server.src}" destdir="build/server" classpathref="classpath" />
+ </target>
+
+ <target name="war" description="create the war file">
+ <copy file="${cayenne.xml}" todir="classes"/>
+ <copy file="${cayenneMap.xml}" todir="classes"/>
+ <copy file="${cayenneNode.xml}" todir="classes"/>
+ <war destfile="build/cayenne.war" webxml="${webxml}">
+ <lib dir="../lib/server"/>
+ <lib dir="${eclipse.home}/plugins" includes="org.eclipse.ui.views_*.jar"/>
+ <classes dir="build/client/"/>
+ <classes dir="build/server/"/>
+ <classes dir="classes"/>
+ <webinf file="log4j.properties"/>
+ </war>
+ </target>
+
+ <target name="clean" description="clean up" >
+ <delete includeemptydirs="true">
+ <fileset dir="build"/>
+ <fileset dir="classes"/>
+ </delete>
+ </target>
+</project>
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/build.xml
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/log4j.properties?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/log4j.properties (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/log4j.properties Sun Jun 18 05:49:47 2006
@@ -0,0 +1,22 @@
+# Log4J configuration for Cayenne Service
+
+# Common stuff...
+log4j.rootLogger=WARN, A1
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=/3t-example %-5p [%t %d{MM-dd HH:mm:ss}]: %m%n
+
+# Cayenne loggers...
+
+# remote stuff
+log4j.logger.org.objectstyle.cayenne.remote = DEBUG
+
+# Cayenne SQL Query logging
+log4j.logger.org.objectstyle.cayenne.access.QueryLogger = INFO
+
+# Cayenne Startup Logging
+# (change to DEBUG to see the progress of Cayenne XML files loading)
+log4j.logger.org.objectstyle.cayenne.conf = INFO
+
+# Custom Loggers....
+log4j.logger.cayenne3t = DEBUG
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/log4j.properties
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/web.xml
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/web.xml?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/web.xml (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/web.xml Sun Jun 18 05:49:47 2006
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <!-- tracks client sesssions .. used for session debugging -->
+ <listener>
+ <listener-class>cayenne3t.example.util.SessionTracker</listener-class>
+ </listener>
+
+ <!-- on session timeout server-side DataContext will be deallocated
+ shared DataChannels will be deallocated when no sessions are using them
+ -->
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+
+ <!-- Deploying Cayenne distributed service using Hessian OPP transport -->
+ <servlet>
+ <servlet-name>cayenne</servlet-name>
+ <servlet-class>org.objectstyle.cayenne.remote.hessian.service.HessianServlet</servlet-class>
+
+ <!-- client-server events setup -->
+ <!--
+ <init-param>
+ <param-name>cayenne.RemoteService.EventBridge.factory</param-name>
+ <param-value>org.objectstyle.cayenne.event.XMPPBridgeFactory</param-value>
+ </init-param>
+ <init-param>
+ <param-name>cayenne.XMPPBridge.xmppHost</param-name>
+ <param-value>localhost</param-value>
+ </init-param>
+ <init-param>
+ <param-name>cayenne.XMPPBridge.xmppPort</param-name>
+ <param-value>5222</param-value>
+ </init-param>
+ <init-param>
+ <param-name>cayenne.XMPPBridge.xmppChatService</param-name>
+ <param-value>conference</param-value>
+ </init-param> -->
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>cayenne</servlet-name>
+ <url-pattern>/cayenne</url-pattern>
+ </servlet-mapping>
+
+ <!-- helper filter that sets up logging and debugs requests. This is optional -->
+ <filter>
+ <filter-name>cayenne-web-service-filter</filter-name>
+ <filter-class>cayenne3t.example.util.RequestFilter</filter-class>
+ <init-param>
+ <param-name>log4j-config</param-name>
+ <param-value>/WEB-INF/log4j.properties</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>cayenne-web-service-filter</filter-name>
+ <servlet-name>cayenne</servlet-name>
+ </filter-mapping>
+</web-app>
\ No newline at end of file
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/dist/web.xml
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/icons/sample.gif
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/icons/sample.gif?rev=415128&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/icons/sample.gif
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/icons/sample.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/cayenne-client-nodeps-1.2RC1.jar
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/cayenne-client-nodeps-1.2RC1.jar?rev=415128&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/cayenne-client-nodeps-1.2RC1.jar
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/cayenne-client-nodeps-1.2RC1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/commons-collections-3.1.jar
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/commons-collections-3.1.jar?rev=415128&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/commons-collections-3.1.jar
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/commons-collections-3.1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/commons-lang-2.1.jar
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/commons-lang-2.1.jar?rev=415128&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/commons-lang-2.1.jar
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/commons-lang-2.1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/commons-logging.jar
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/commons-logging.jar?rev=415128&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/commons-logging.jar
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/commons-logging.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/hessian-3.0.13.jar
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/hessian-3.0.13.jar?rev=415128&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/hessian-3.0.13.jar
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/hessian-3.0.13.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/server/cayenne-1.2RC1.jar
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/server/cayenne-1.2RC1.jar?rev=415128&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/server/cayenne-1.2RC1.jar
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/server/cayenne-1.2RC1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/server/hessian-3.0.13.jar
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/server/hessian-3.0.13.jar?rev=415128&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/server/hessian-3.0.13.jar
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/server/hessian-3.0.13.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/server/postgresql-8.1-405.jdbc2ee.jar
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/server/postgresql-8.1-405.jdbc2ee.jar?rev=415128&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/server/postgresql-8.1-405.jdbc2ee.jar
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/lib/server/postgresql-8.1-405.jdbc2ee.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/plugin.xml
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/plugin.xml?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/plugin.xml (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/plugin.xml Sun Jun 18 05:49:47 2006
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.views">
+ <category
+ id="org.apache.cayenne.ropbrowser.views.ROPBrowserCategory"
+ name="ROP Browser"/>
+ <view
+ allowMultiple="false"
+ category="org.apache.cayenne.ropbrowser.views.ROPBrowserCategory"
+ class="org.apache.cayenne.ropbrowser.views.ControlPanelView"
+ id="org.apache.cayenne.ropbrowser.views.ControlPanelView"
+ name="Control Panel"/>
+ </extension>
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ class="org.apache.cayenne.ropbrowser.ObjectEditor"
+ default="false"
+ icon="icons/sample.gif"
+ id="org.apache.cayenne.ropbrowser.ObjectEditor"
+ name="Object Editor"/>
+ </extension>
+
+</plugin>
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/plugin.xml
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ConnectionManager.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ConnectionManager.java?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ConnectionManager.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ConnectionManager.java Sun Jun 18 05:49:47 2006
@@ -0,0 +1,55 @@
+/*
+ * Created on 1/06/2006
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.apache.cayenne.ropbrowser;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import org.eclipse.ui.views.properties.ComboBoxPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.objectstyle.cayenne.CayenneContext;
+import org.objectstyle.cayenne.DataChannel;
+import org.objectstyle.cayenne.ObjectContext;
+import org.objectstyle.cayenne.map.EntityResolver;
+import org.objectstyle.cayenne.map.ObjAttribute;
+import org.objectstyle.cayenne.map.ObjEntity;
+import org.objectstyle.cayenne.query.Query;
+import org.objectstyle.cayenne.remote.ClientChannel;
+import org.objectstyle.cayenne.remote.ClientConnection;
+import org.objectstyle.cayenne.remote.hessian.HessianConnection;
+
+public class ConnectionManager {
+
+ private static ConnectionManager _ref;
+ private Hashtable<String, ObjectContext> connections;
+
+ private ConnectionManager() {
+ connections = new Hashtable<String, ObjectContext>();
+ }
+
+ public static ConnectionManager getInstance() {
+ if (_ref == null) {
+ _ref = new ConnectionManager();
+ }
+ return _ref;
+ }
+
+ public ObjectContext connect(String address) {
+
+ ClientConnection connection = new HessianConnection(address);
+ DataChannel channel = new ClientChannel(connection);
+ ObjectContext context = new CayenneContext(channel);
+
+ connections.put(address, context);
+
+ return context;
+ }
+}
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ConnectionManager.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ModelTest.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ModelTest.java?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ModelTest.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ModelTest.java Sun Jun 18 05:49:47 2006
@@ -0,0 +1,61 @@
+/*
+ * Created on 6/06/2006
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.apache.cayenne.ropbrowser;
+
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.cayenne.ropbrowser.ConnectionManager;
+import org.apache.cayenne.ropbrowser.model.Artist;
+import org.apache.cayenne.ropbrowser.model.Painting;
+import org.apache.cayenne.ropbrowser.model.Gallery;
+import org.objectstyle.cayenne.CayenneContext;
+import org.objectstyle.cayenne.query.NamedQuery;
+import org.objectstyle.cayenne.query.SelectQuery;
+
+public class ModelTest {
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ CayenneContext context = ConnectionManager.getInstance().getContext("http://localhost:8080/cayenne/cayenne");
+
+ /*
+ Artist newArtist = (Artist) context.newObject(Artist.class);
+ newArtist.setArtistName("Jackson Pollock");
+ newArtist.setDateOfBirth(new Date());
+
+ Gallery gallery = (Gallery) context.newObject(Gallery.class);
+ gallery.setGalleryName("National Gallery of Australia");
+ painting.setPaintingArtist(newArtist);
+ painting.setPaintingGallery(gallery);
+
+ context.commitChanges();
+ */
+
+ NamedQuery select = new NamedQuery("ArtistQuery");
+ List matches = context.performQuery(select);
+ Iterator i = matches.iterator();
+
+ while (i.hasNext()) {
+ Artist artist = (Artist) i.next();
+ System.out.println(artist.getArtistName() + ':' + artist.getDateOfBirth());
+ List l = artist.getArtistPainting();
+ if (l != null) {
+ Iterator it = l.iterator();
+ if (it.hasNext()) {
+ Painting p = (Painting) it.next();
+ System.out.println(p.getPaintingName());
+ System.out.println(p.getPaintingGallery().getGalleryName());
+ }
+ }
+ }
+ }
+
+}
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ModelTest.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditor.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditor.java?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditor.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditor.java Sun Jun 18 05:49:47 2006
@@ -0,0 +1,89 @@
+/*
+ * Created on 8/06/2006
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.apache.cayenne.ropbrowser;
+
+import java.util.EventObject;
+
+import org.apache.cayenne.ropbrowser.model.ObjectDiagram;
+import org.apache.cayenne.ropbrowser.parts.ObjectEditPartFactory;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gef.ContextMenuProvider;
+import org.eclipse.gef.DefaultEditDomain;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gef.editparts.ScalableFreeformRootEditPart;
+import org.eclipse.gef.ui.parts.GraphicalEditor;
+import org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.objectstyle.cayenne.ObjectContext;
+
+public class ObjectEditor extends GraphicalEditor {
+
+ public static final String ID = "org.apache.cayenne.ropbrowser.ObjectEditor";
+ private ObjectDiagram objectDiagram;
+ private ObjectContext context;
+
+ public ObjectEditor() {
+ setEditDomain(new DefaultEditDomain(this));
+ }
+
+ @Override
+ protected void initializeGraphicalViewer() {
+ GraphicalViewer viewer = getGraphicalViewer();
+ viewer.setContents(objectDiagram);
+ }
+
+ /**
+ * Configure the graphical viewer before it receives contents.
+ * <p>This is the place to choose an appropriate RootEditPart and EditPartFactory
+ * for your editor. The RootEditPart determines the behavior of the editor's "work-area".
+ * For example, GEF includes zoomable and scrollable root edit parts. The EditPartFactory
+ * maps model elements to edit parts (controllers).</p>
+ * @see org.eclipse.gef.ui.parts.GraphicalEditor#configureGraphicalViewer()
+ */
+ protected void configureGraphicalViewer() {
+ super.configureGraphicalViewer();
+
+ GraphicalViewer viewer = getGraphicalViewer();
+ viewer.setEditPartFactory(new ObjectEditPartFactory());
+ viewer.setRootEditPart(new ScalableFreeformRootEditPart());
+ viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer));
+
+ // configure the context menu provider
+ ContextMenuProvider cmProvider = new ObjectEditorContextMenuProvider(viewer, getActionRegistry());
+ viewer.setContextMenu(cmProvider);
+ getSite().registerContextMenu(cmProvider, viewer);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.gef.ui.parts.GraphicalEditor#commandStackChanged(java.util.EventObject)
+ */
+ public void commandStackChanged(EventObject event) {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ super.commandStackChanged(event);
+ }
+
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ context.commitChanges();
+ }
+
+ @Override
+ public void doSaveAs() {
+ }
+
+ @Override
+ public boolean isSaveAsAllowed() {
+ return false;
+ }
+
+ protected void setInput(IEditorInput input) {
+ super.setInput(input);
+ this.context = ((ObjectEditorInput) input).getContext();
+ objectDiagram = new ObjectDiagram(this.context, ((ObjectEditorInput) input).getQuery());
+ }
+}
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditor.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditorContextMenuProvider.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditorContextMenuProvider.java?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditorContextMenuProvider.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditorContextMenuProvider.java Sun Jun 18 05:49:47 2006
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 Elias Volanakis and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Elias Volanakis - initial API and implementation
+ *******************************************************************************/
+package org.apache.cayenne.ropbrowser;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.ui.actions.ActionFactory;
+
+import org.eclipse.gef.ContextMenuProvider;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.ui.actions.ActionRegistry;
+import org.eclipse.gef.ui.actions.GEFActionConstants;
+
+
+/**
+ * Provides context menu actions for the ShapesEditor.
+ * @author Elias Volanakis
+ */
+class ObjectEditorContextMenuProvider extends ContextMenuProvider {
+
+ /** The editor's action registry. */
+ private ActionRegistry actionRegistry;
+
+ /**
+ * Instantiate a new menu context provider for the specified EditPartViewer
+ * and ActionRegistry.
+ * @param viewer the editor's graphical viewer
+ * @param registry the editor's action registry
+ * @throws IllegalArgumentException if registry is <tt>null</tt>.
+ */
+ public ObjectEditorContextMenuProvider(EditPartViewer viewer, ActionRegistry registry) {
+ super(viewer);
+ if (registry == null) {
+ throw new IllegalArgumentException();
+ }
+ actionRegistry = registry;
+ }
+
+ /**
+ * Called when the context menu is about to show. Actions,
+ * whose state is enabled, will appear in the context menu.
+ * @see org.eclipse.gef.ContextMenuProvider#buildContextMenu(org.eclipse.jface.action.IMenuManager)
+ */
+ public void buildContextMenu(IMenuManager menu) {
+ // Add standard action groups to the menu
+ GEFActionConstants.addStandardActionGroups(menu);
+
+ // Add actions to the menu
+ menu.appendToGroup(
+ GEFActionConstants.GROUP_UNDO, // target group id
+ getAction(ActionFactory.UNDO.getId())); // action to add
+ menu.appendToGroup(
+ GEFActionConstants.GROUP_UNDO,
+ getAction(ActionFactory.REDO.getId()));
+ menu.appendToGroup(
+ GEFActionConstants.GROUP_EDIT,
+ getAction(ActionFactory.DELETE.getId()));
+ }
+
+ private IAction getAction(String actionId) {
+ return actionRegistry.getAction(actionId);
+ }
+
+}
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditorContextMenuProvider.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditorInput.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditorInput.java?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditorInput.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditorInput.java Sun Jun 18 05:49:47 2006
@@ -0,0 +1,63 @@
+/*
+ * Created on 8/06/2006
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.apache.cayenne.ropbrowser;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.objectstyle.cayenne.ObjectContext;
+
+public class ObjectEditorInput implements IEditorInput {
+
+ protected String query;
+ protected ObjectContext context;
+
+ public ObjectEditorInput(ObjectContext context, String query) {
+ this.context = context;
+ this.query = query;
+ }
+
+ public boolean exists() {
+ return true;
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return ImageDescriptor.getMissingImageDescriptor();
+ }
+
+ public String getName() {
+ return query;
+ }
+
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ public String getToolTipText() {
+ return query;
+ }
+
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ public String getQuery() {
+ return query;
+ }
+
+ public ObjectContext getContext() {
+ return context;
+ }
+
+ public boolean equals(Object o) {
+ if (o instanceof ObjectEditorInput) {
+ ObjectEditorInput input = (ObjectEditorInput) o;
+ return (input.getContext() == getContext() && input.getQuery().equals(getQuery()));
+ }
+ return false;
+ }
+}
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ObjectEditorInput.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ROPBrowserPlugin.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ROPBrowserPlugin.java?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ROPBrowserPlugin.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ROPBrowserPlugin.java Sun Jun 18 05:49:47 2006
@@ -0,0 +1,54 @@
+package org.apache.cayenne.ropbrowser;
+
+import org.eclipse.ui.plugin.*;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class ROPBrowserPlugin extends AbstractUIPlugin {
+
+ //The shared instance.
+ private static ROPBrowserPlugin plugin;
+
+ /**
+ * The constructor.
+ */
+ public ROPBrowserPlugin() {
+ plugin = this;
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static ROPBrowserPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * 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 AbstractUIPlugin.imageDescriptorFromPlugin("ropbrowser", path);
+ }
+}
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/ROPBrowserPlugin.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/commands/ObjectSetConstraintCommand.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/commands/ObjectSetConstraintCommand.java?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/commands/ObjectSetConstraintCommand.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/commands/ObjectSetConstraintCommand.java Sun Jun 18 05:49:47 2006
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 Elias Volanakis and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Elias Volanakis - initial API and implementation
+ *******************************************************************************/
+package org.apache.cayenne.ropbrowser.commands;
+
+import org.apache.cayenne.ropbrowser.model.ModelElement;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+
+/**
+ * A command to resize and/or move a shape.
+ * The command can be undone or redone.
+ * @author Elias Volanakis
+ */
+public class ObjectSetConstraintCommand extends Command {
+
+ /** Stores the new size and location. */
+ private final Rectangle newBounds;
+ /** Stores the old size and location. */
+ private Rectangle oldBounds;
+ /** A request to move/resize an edit part. */
+ private final ChangeBoundsRequest request;
+
+ /** Shape to manipulate. */
+ private final ModelElement object;
+
+ /**
+ * Create a command that can resize and/or move a shape.
+ * @param shape the shape to manipulate
+ * @param req the move and resize request
+ * @param newBounds the new size and location
+ * @throws IllegalArgumentException if any of the parameters is null
+ */
+ public ObjectSetConstraintCommand(ModelElement object, ChangeBoundsRequest req,
+ Rectangle newBounds) {
+ if (object == null || req == null || newBounds == null) {
+ throw new IllegalArgumentException();
+ }
+ this.object = object;
+ this.request = req;
+ this.newBounds = newBounds.getCopy();
+ setLabel("move / resize");
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.gef.commands.Command#canExecute()
+ */
+ public boolean canExecute() {
+ Object type = request.getType();
+ // make sure the Request is of a type we support:
+ return (RequestConstants.REQ_MOVE.equals(type)
+ || RequestConstants.REQ_MOVE_CHILDREN.equals(type)
+ || RequestConstants.REQ_RESIZE.equals(type)
+ || RequestConstants.REQ_RESIZE_CHILDREN.equals(type));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.gef.commands.Command#execute()
+ */
+ public void execute() {
+ oldBounds = new Rectangle(object.getX(), object.getY(), object.getWidth(), object.getHeight());
+ redo();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.gef.commands.Command#redo()
+ */
+ public void redo() {
+ object.setSize(newBounds.getSize().width, newBounds.getSize().height);
+ object.setLocation(newBounds.getLocation().x, newBounds.getLocation().y);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.gef.commands.Command#undo()
+ */
+ public void undo() {
+ object.setSize(oldBounds.getSize().width, oldBounds.getSize().height);
+ object.setLocation(oldBounds.getLocation().x, oldBounds.getLocation().y);
+ }
+}
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/commands/ObjectSetConstraintCommand.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/CollectionFigure.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/CollectionFigure.java?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/CollectionFigure.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/CollectionFigure.java Sun Jun 18 05:49:47 2006
@@ -0,0 +1,73 @@
+/*
+ * Created on 14/06/2006
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.apache.cayenne.ropbrowser.figures;
+
+import java.util.Iterator;
+
+import org.apache.cayenne.ropbrowser.model.AbstractObject;
+import org.apache.cayenne.ropbrowser.model.CollectionModelElement;
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.LineBorder;
+import org.eclipse.draw2d.ToolbarLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.swt.graphics.Color;
+import org.objectstyle.cayenne.map.Attribute;
+import org.objectstyle.cayenne.map.Relationship;
+
+public class CollectionFigure extends Figure {
+
+ public static Color classColor = new Color(null,255,255,100);
+ private CompartmentFigure attributeFigure = new CompartmentFigure();
+ private CompartmentFigure relationshipFigure = new CompartmentFigure();
+
+ public CollectionFigure(CollectionModelElement model) {
+ ToolbarLayout layout = new ToolbarLayout();
+ setLayoutManager(layout);
+ setBorder(new LineBorder(ColorConstants.black,1));
+ setBackgroundColor(classColor);
+ setOpaque(true);
+
+ add(new Label(model.getName()));
+ add(attributeFigure);
+ setAttributes(model.getCurrent());
+ add(relationshipFigure);
+ setRelationships(model.getCurrent());
+ }
+
+ public CompartmentFigure getRelationshipCompartment() {
+ return relationshipFigure;
+ }
+
+ public CompartmentFigure getAttributeCompartment() {
+ return attributeFigure;
+ }
+
+ public void setAttributes(AbstractObject model) {
+ getAttributeCompartment().removeAll();
+
+ Iterator i = model.getAttributes().iterator();
+ while (i.hasNext()) {
+ Attribute a = (Attribute) i.next();
+ Label l = new Label(a.getName() + " : " + model.getPropertyValue(a.getName()));
+ getAttributeCompartment().add(l);
+ }
+ }
+
+ public void setRelationships(AbstractObject model) {
+ getRelationshipCompartment().removeAll();
+
+ Iterator i = model.getRelationships().iterator();
+ while (i.hasNext()) {
+ Relationship r = (Relationship) i.next();
+ String toManyString = (r.isToMany() ? "1-n" : "1-1");
+ Label l = new Label(r.getName() + " -> " + r.getTargetEntityName() + " (" + toManyString + ")");
+ getRelationshipCompartment().add(l);
+ }
+ }
+}
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/CollectionFigure.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/CompartmentFigure.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/CompartmentFigure.java?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/CompartmentFigure.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/CompartmentFigure.java Sun Jun 18 05:49:47 2006
@@ -0,0 +1,35 @@
+/*
+ * Created on 14/06/2006
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.apache.cayenne.ropbrowser.figures;
+
+import org.eclipse.draw2d.AbstractBorder;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.ToolbarLayout;
+import org.eclipse.draw2d.geometry.Insets;
+
+public class CompartmentFigure extends Figure {
+
+ public CompartmentFigure() {
+ ToolbarLayout layout = new ToolbarLayout();
+ layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
+ layout.setStretchMinorAxis(false);
+ layout.setSpacing(2);
+ setLayoutManager(layout);
+ setBorder(new CompartmentFigureBorder());
+ }
+
+ public class CompartmentFigureBorder extends AbstractBorder {
+ public Insets getInsets(IFigure figure) {
+ return new Insets(1,0,0,0);
+ }
+ public void paint(IFigure figure, Graphics graphics, Insets insets) {
+ graphics.drawLine(getPaintRectangle(figure, insets).getTopLeft(), tempRect.getTopRight());
+ }
+ }
+}
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/CompartmentFigure.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/NullFigure.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/NullFigure.java?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/NullFigure.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/NullFigure.java Sun Jun 18 05:49:47 2006
@@ -0,0 +1,31 @@
+/*
+ * Created on 14/06/2006
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.apache.cayenne.ropbrowser.figures;
+
+import org.apache.cayenne.ropbrowser.model.NullModelElement;
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.LineBorder;
+import org.eclipse.draw2d.ToolbarLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.swt.graphics.Color;
+
+public class NullFigure extends Figure {
+
+ public static Color classColor = new Color(null,100,255,255);
+
+ public NullFigure(NullModelElement model) {
+ ToolbarLayout layout = new ToolbarLayout();
+ setLayoutManager(layout);
+ setBorder(new LineBorder(ColorConstants.black,1));
+ setBackgroundColor(classColor);
+ setOpaque(true);
+
+ add(new Label(model.getName()));
+ }
+}
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/figures/NullFigure.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/AbstractObject.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/AbstractObject.java?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/AbstractObject.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/AbstractObject.java Sun Jun 18 05:49:47 2006
@@ -0,0 +1,169 @@
+/*
+ * Created on 16/06/2006
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.apache.cayenne.ropbrowser.model;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.objectstyle.cayenne.PersistentObject;
+import org.objectstyle.cayenne.map.EntityResolver;
+import org.objectstyle.cayenne.map.ObjAttribute;
+import org.objectstyle.cayenne.map.ObjEntity;
+import org.objectstyle.cayenne.map.Relationship;
+import org.objectstyle.cayenne.property.ClassDescriptor;
+
+public class AbstractObject extends PersistentObject {
+
+ protected static SimpleDateFormat dateFormatter = new SimpleDateFormat("dd/MM/yyyy");
+ /** Delegate used to implemenent property-change-support. */
+ private transient PropertyChangeSupport pcsDelegate = new PropertyChangeSupport(this);
+
+ public String getName() {
+ return this.getClass().getSimpleName();
+ }
+
+ public Collection getRelationships() {
+ return objectContext.getEntityResolver().getObjEntity(getName()).getRelationships();
+ }
+
+ public Collection getAttributes() {
+ return objectContext.getEntityResolver().getObjEntity(getName()).getAttributes();
+ }
+
+ public Object followRelationship(Relationship rel) {
+
+ // TODO when creating a new object, need to deal with foreign keys - allow
+ // the new object to be linked to another object
+
+ EntityResolver resolver = objectContext.getEntityResolver();
+ ClassDescriptor descriptor = resolver.getClassDescriptor(getName());
+
+ Object value = descriptor.getProperty(rel.getName()).readProperty(this);
+
+ return value;
+ }
+
+ public Object getPropertyValue(Object id) {
+ if(objectContext != null) {
+ objectContext.prepareForAccess(this, id.toString());
+ }
+
+ EntityResolver resolver = objectContext.getEntityResolver();
+ ClassDescriptor descriptor = resolver.getClassDescriptor(getName());
+ ObjAttribute attribute = (ObjAttribute) resolver.getObjEntity(getName()).getAttribute(id.toString());
+
+ Object value = null;
+ if (attribute.getType().equals("java.util.Date")) {
+ value = dateFormatter.format(descriptor.getProperty(id.toString()).readProperty(this));
+ }
+ else {
+ value = descriptor.getProperty(id.toString()).readProperty(this);
+ if (value == null) {
+ value = new String("");
+ }
+ else {
+ value = value.toString();
+ }
+ }
+
+ return value;
+ }
+
+ public boolean isPropertySet(Object id) {
+ return getPropertyValue(id) != null;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+
+ if(objectContext != null) {
+ objectContext.prepareForAccess(this, id.toString());
+ }
+ EntityResolver resolver = objectContext.getEntityResolver();
+ ClassDescriptor descriptor = resolver.getClassDescriptor(getName());
+ ObjAttribute attribute = (ObjAttribute) resolver.getObjEntity(getName()).getAttribute(id.toString());
+
+ Object newValue = null;
+ if (attribute.getType().equals("java.util.Date")) {
+ try {
+ newValue = dateFormatter.parse(value.toString());
+ }
+ catch(ParseException e) {
+ // TODO logging etc
+ System.out.println("Invalid date format");
+ }
+ }
+ else {
+ // try to use a constructor from a String
+ try {
+ Class newClass = Class.forName(attribute.getType());
+ newValue = newClass.getConstructor(Class.forName("java.lang.String")).newInstance(value.toString());
+ }
+ catch(Exception e) {
+ // TODO log
+ System.out.println("No String constructor available; implement a custom IPropertyDescriptor or type convertor");
+ newValue = value;
+ }
+ }
+
+ Object oldValue = descriptor.getProperty(id.toString()).readProperty(this);
+
+ descriptor.getProperty(id.toString()).writeProperty(this, oldValue, newValue);
+
+ // notify objectContext about simple property change
+ if(objectContext != null) {
+ objectContext.propertyChanged(this, id.toString(), oldValue, newValue);
+ }
+
+ firePropertyChange(id.toString(), oldValue, newValue);
+ }
+
+ /**
+ * Attach a non-null PropertyChangeListener to this object.
+ * @param l a non-null PropertyChangeListener instance
+ * @throws IllegalArgumentException if the parameter is null
+ */
+ public synchronized void addPropertyChangeListener(PropertyChangeListener l) {
+ if (l == null) {
+ throw new IllegalArgumentException();
+ }
+ pcsDelegate.addPropertyChangeListener(l);
+ }
+
+ /**
+ * Report a property change to registered listeners (for example edit parts).
+ * @param property the programmatic name of the property that changed
+ * @param oldValue the old value of this property
+ * @param newValue the new value of this property
+ */
+ protected void firePropertyChange(String property, Object oldValue, Object newValue) {
+ if (pcsDelegate.hasListeners(property)) {
+ pcsDelegate.firePropertyChange(property, oldValue, newValue);
+ }
+ }
+
+ /**
+ * Remove a PropertyChangeListener from this component.
+ * @param l a PropertyChangeListener instance
+ */
+ public synchronized void removePropertyChangeListener(PropertyChangeListener l) {
+ if (l != null) {
+ pcsDelegate.removePropertyChangeListener(l);
+ }
+ }
+}
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/AbstractObject.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Artist.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Artist.java?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Artist.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Artist.java Sun Jun 18 05:49:47 2006
@@ -0,0 +1,109 @@
+package org.apache.cayenne.ropbrowser.model;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.apache.cayenne.ropbrowser.model.auto._Artist;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+
+/**
+ * A persistent class mapped as "Artist" Cayenne entity.
+ */
+public class Artist extends _Artist {
+
+ /**
+ * A static array of property descriptors.
+ * There is one IPropertyDescriptor entry per editable property.
+ * @see #getPropertyDescriptors()
+ * @see #getPropertyValue(Object)
+ * @see #setPropertyValue(Object, Object)
+ */
+ /*
+ private static IPropertyDescriptor[] descriptors;
+
+ protected static final DateFormat dateFormatter;
+
+ static {
+ descriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(_Artist.ARTIST_NAME_PROPERTY, "Name"), // id and description pair
+ new TextPropertyDescriptor(_Artist.DATE_OF_BIRTH_PROPERTY, "DOB")
+ };
+
+ dateFormatter = new SimpleDateFormat("dd/MM/yy");
+ }
+
+ public Object getPropertyValue(Object id) {
+
+ // treat it as a String - if not a String, no property anyway
+ String propertyName = id.toString();
+
+ if (propertyName.equals(_Artist.ARTIST_NAME_PROPERTY)) {
+ return getArtistName();
+ }
+ else if (propertyName.equals(_Artist.DATE_OF_BIRTH_PROPERTY)) {
+ return dateFormatter.format(getDateOfBirth());
+ }
+
+ return null;
+ }
+
+ public void resetPropertyValue(Object id) {
+ // treat it as a String - if not a String, no property anyway
+ String propertyName = id.toString();
+
+ if (propertyName.equals(_Artist.ARTIST_NAME_PROPERTY)) {
+ setArtistName("");
+ }
+ else if (propertyName.equals(_Artist.DATE_OF_BIRTH_PROPERTY)) {
+ setDateOfBirth(null);
+ }
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ // treat it as a String - if not a String, no property anyway
+ String propertyName = id.toString();
+
+ if (propertyName.equals(_Artist.ARTIST_NAME_PROPERTY)) {
+ setArtistName(value.toString());
+ }
+ else if (propertyName.equals(_Artist.DATE_OF_BIRTH_PROPERTY)) {
+ try {
+ setDateOfBirth(dateFormatter.parse(value.toString()));
+ }
+ catch (Exception e) {
+ // TODO logging
+ System.out.println(e.getMessage());
+ }
+ }
+ }
+
+ public boolean isPropertySet(Object id) {
+ // treat it as a String - if not a String, no property anyway
+ String propertyName = id.toString();
+
+ if (propertyName.equals(_Artist.ARTIST_NAME_PROPERTY)) {
+ return this.getArtistName() != null;
+ }
+ else if (propertyName.equals(_Artist.DATE_OF_BIRTH_PROPERTY)) {
+ return this.getDateOfBirth() != null;
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns an array of IPropertyDescriptors for this shape.
+ * <p>The returned array is used to fill the property view, when the edit-part corresponding
+ * to this model element is selected.</p>
+ * @see #descriptors
+ * @see #getPropertyValue(Object)
+ * @see #setPropertyValue(Object, Object)
+ */
+ /*
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return descriptors;
+ }
+ */
+}
\ No newline at end of file
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Artist.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/CollectionModelElement.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/CollectionModelElement.java?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/CollectionModelElement.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/CollectionModelElement.java Sun Jun 18 05:49:47 2006
@@ -0,0 +1,219 @@
+/*
+ * Created on 7/06/2006
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.apache.cayenne.ropbrowser.model;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.objectstyle.cayenne.map.EntityResolver;
+import org.objectstyle.cayenne.map.ObjAttribute;
+import org.objectstyle.cayenne.map.ObjEntity;
+
+/**
+ * Class representing a collection of ObjectModelElements.
+ * Used to display a number of records as one element on the
+ * canvas with the ability to scroll through them.
+ *
+ * @author marcel
+ *
+ */
+public class CollectionModelElement extends ModelElement implements IObject, PropertyChangeListener {
+
+ public static final String PROP_RECORDS = "Collection.TotalRecords";
+ protected static IPropertyDescriptor [] descriptors;
+ protected List<AbstractObject> objects;
+ protected AbstractObject current;
+ protected int currentRecord;
+ protected AbstractObject createdFrom;
+ public static String PROP_CURRENT_RECORD = "Collection.RecordNo";
+ public static String PROP_TOTAL_RECORDS = "Collection.TotalRecords";
+
+ protected IPropertyDescriptor[] properties = null;
+
+ static {
+ descriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(PROP_CURRENT_RECORD, "Current Record"),
+ new PropertyDescriptor(PROP_TOTAL_RECORDS, "Total Records")
+ };
+ }
+
+ public CollectionModelElement(AbstractObject createdFrom) {
+ this.createdFrom = createdFrom;
+ }
+
+ public String getName() {
+ return current.getName();
+ }
+
+ public void setObjects(List<AbstractObject> list) {
+ List oldObjects = this.objects;
+ this.objects = list;
+ this.currentRecord = 0;
+ this.current = list.get(currentRecord);
+
+ for (AbstractObject object : objects) {
+ object.addPropertyChangeListener(this);
+ }
+
+ firePropertyChange(PROP_RECORDS, oldObjects, objects);
+ }
+
+ @Override
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (properties == null) {
+ EntityResolver entityResolver = getCurrent().getObjectContext().getEntityResolver();
+ ObjEntity entity = entityResolver.getObjEntity(getName());
+ Iterator attributes = entity.getAttributes().iterator();
+ properties = new IPropertyDescriptor[entity.getAttributes().size() + CollectionModelElement.descriptors.length];
+ int i = 0;
+ while (attributes.hasNext()) {
+ ObjAttribute attribute = (ObjAttribute) attributes.next();
+ properties[i++] = new TextPropertyDescriptor(attribute.getName(), attribute.getName());
+ }
+ for (int j = 0; j < CollectionModelElement.descriptors.length; i++, j++) {
+ properties[i] = CollectionModelElement.descriptors[j];
+ }
+ }
+
+ return properties;
+ }
+
+ public Collection getRelationships() {
+ return current.getRelationships();
+ }
+
+ @Override
+ public Object getPropertyValue(Object id) {
+ if (id.toString().equals(PROP_CURRENT_RECORD)) {
+ return Integer.toString(currentRecord);
+ }
+ else if (id.toString().equals(PROP_TOTAL_RECORDS)) {
+ return Integer.toString(objects.size());
+ }
+ return current.getPropertyValue(id);
+ }
+
+ @Override
+ public boolean isPropertySet(Object id) {
+ if (id.toString().equals(PROP_CURRENT_RECORD)) {
+ return true;
+ }
+ else if (id.toString().equals(PROP_TOTAL_RECORDS)) {
+ return true;
+ }
+ return current.isPropertySet(id);
+ }
+
+ @Override
+ public void resetPropertyValue(Object id) {
+ if (id.toString().equals(PROP_CURRENT_RECORD)) {
+ currentRecord = 0;
+ this.current = this.objects.get(currentRecord);
+ }
+ else {
+ current.resetPropertyValue(id);
+ }
+ }
+
+ @Override
+ public void setPropertyValue(Object id, Object value) {
+ if (id.toString().equals(PROP_CURRENT_RECORD)) {
+ int oldCurrent = currentRecord;
+ currentRecord = Integer.parseInt(value.toString());
+ this.current = this.objects.get(currentRecord);
+ firePropertyChange(id.toString(), new Integer(oldCurrent), new Integer(currentRecord));
+ }
+ else {
+ current.setPropertyValue(id, value);
+ }
+ }
+
+ public void next() {
+ int oldCurrent = currentRecord;
+
+ if (currentRecord == objects.size() - 1) {
+ currentRecord = 0;
+ }
+ else {
+ currentRecord++;
+ }
+ current = objects.get(currentRecord);
+ firePropertyChange(PROP_CURRENT_RECORD, new Integer(oldCurrent), new Integer(currentRecord));
+ }
+
+ public AbstractObject getCurrent() {
+ return current;
+ }
+
+ public Collection getAttributes() {
+ return current.getObjectContext().getEntityResolver().getObjEntity(current.getName()).getAttributes();
+ }
+
+ public void previous() {
+ int oldCurrent = currentRecord;
+
+ if (currentRecord == 0) {
+ currentRecord = objects.size() - 1;
+ }
+ else {
+ currentRecord--;
+ }
+ current = objects.get(currentRecord);
+ firePropertyChange(PROP_CURRENT_RECORD, new Integer(oldCurrent), new Integer(currentRecord));
+ }
+
+ public boolean equals(Object o) {
+ if (o instanceof CollectionModelElement) {
+ if (objects.equals(((CollectionModelElement) o).getObjects())
+ && createdFrom == ((CollectionModelElement) o).getCreatedFrom()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public AbstractObject getCreatedFrom() {
+ return createdFrom;
+ }
+
+ public List<AbstractObject> getObjects() {
+ return this.objects;
+ }
+
+ public void updateConnections() {
+ for (Object o : getSourceConnections()) {
+ Connection conn = (Connection) o;
+ ModelElement element = conn.getTarget();
+ if (element instanceof CollectionModelElement) {
+ CollectionModelElement collection = (CollectionModelElement) element;
+ Object object = getCurrent().followRelationship(conn.getRelationship());
+ if (object == null) {
+ // replace this node and everything coming from it with NullModelElements
+ }
+ else {
+ if (conn.getRelationship().isToMany()) {
+ collection.setObjects((List) object);
+ }
+ else {
+ collection.setObjects(Arrays.asList(new AbstractObject[] {(AbstractObject) object}));
+ }
+ }
+ }
+ element.updateConnections();
+ }
+ }
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ firePropertyChange(evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
+ }
+}
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/CollectionModelElement.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Connection.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Connection.java?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Connection.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Connection.java Sun Jun 18 05:49:47 2006
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 Elias Volanakis and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Elias Volanakis - initial API and implementation
+ *******************************************************************************/
+package org.apache.cayenne.ropbrowser.model;
+
+import org.eclipse.ui.views.properties.ComboBoxPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+
+import org.eclipse.draw2d.Graphics;
+import org.objectstyle.cayenne.map.Relationship;
+
+/**
+ * A connection between two distinct shapes.
+ * @author Elias Volanakis
+ */
+public class Connection {
+
+ /** Connection's source endpoint. */
+ private ModelElement source;
+ /** Connection's target endpoint. */
+ private ModelElement target;
+
+ private Relationship relationship;
+
+ /**
+ * Create a (solid) connection between two distinct shapes.
+ * @param source a source endpoint for this connection (non null)
+ * @param target a target endpoint for this connection (non null)
+ * @throws IllegalArgumentException if any of the parameters are null or source == target
+ * @see #setLineStyle(int)
+ */
+ public Connection(ModelElement source, ModelElement target, Relationship relationship) {
+ this.source = source;
+ this.target = target;
+ this.relationship = relationship;
+ connect();
+ }
+
+ /**
+ * Returns the lineStyle as String for the Property Sheet
+ * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
+ */
+ public Object getPropertyValue(Object id) {
+ return null;
+ }
+
+ /**
+ * Returns the source endpoint of this connection.
+ * @return a non-null Shape instance
+ */
+ public ModelElement getSource() {
+ return source;
+ }
+
+ /**
+ * Returns the target endpoint of this connection.
+ * @return a non-null Shape instance
+ */
+ public ModelElement getTarget() {
+ return target;
+ }
+
+ /**
+ * Connect this connection.
+ */
+ public void connect() {
+ source.addConnection(this);
+ target.addConnection(this);
+ }
+
+ public Relationship getRelationship() {
+ return relationship;
+ }
+}
\ No newline at end of file
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Connection.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Gallery.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Gallery.java?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Gallery.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Gallery.java Sun Jun 18 05:49:47 2006
@@ -0,0 +1,10 @@
+package org.apache.cayenne.ropbrowser.model;
+
+import org.apache.cayenne.ropbrowser.model.auto._Gallery;
+
+/**
+ * A persistent class mapped as "Gallery" Cayenne entity.
+ */
+public class Gallery extends _Gallery {
+
+}
\ No newline at end of file
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/Gallery.java
------------------------------------------------------------------------------
svn:executable = *
Added: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/IObject.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/IObject.java?rev=415128&view=auto
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/IObject.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/IObject.java Sun Jun 18 05:49:47 2006
@@ -0,0 +1,16 @@
+/*
+ * Created on 15/06/2006
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.apache.cayenne.ropbrowser.model;
+
+import java.util.Collection;
+import java.util.List;
+
+public interface IObject {
+ public Collection getRelationships();
+
+ public Collection getAttributes();
+}
Propchange: incubator/cayenne/soc/trunk/cayenne-rop/rop-browser/src/org/apache/cayenne/ropbrowser/model/IObject.java
------------------------------------------------------------------------------
svn:executable = *