JBoss Tools SVN: r10963 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-10-20 05:06:55 -0400 (Mon, 20 Oct 2008)
New Revision: 10963
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
Log:
repaired dump source
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2008-10-20 08:30:04 UTC (rev 10962)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2008-10-20 09:06:55 UTC (rev 10963)
@@ -729,6 +729,7 @@
addSelectionListener();
xulRunnerEditor.addResizerListener();
controller.reinit();
+ setDomDocument(xulRunnerEditor.getDOMDocument());
}
16 years, 2 months
JBoss Tools SVN: r10962 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-10-20 04:30:04 -0400 (Mon, 20 Oct 2008)
New Revision: 10962
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1178
Reveng filter storage moved from launch configuration to xml file.
File stored in .settings dir of the project.
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java 2008-10-20 08:29:59 UTC (rev 10961)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java 2008-10-20 08:30:04 UTC (rev 10962)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.seam.ui.wizard;
+import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -21,6 +22,7 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -317,7 +319,11 @@
wc.doSave();
if (params.containsKey(HibernateLaunchConstants.ATTR_REVENG_TABLES)){
- wc.setAttribute(HibernateLaunchConstants.ATTR_REVENG_TABLES, params.get(HibernateLaunchConstants.ATTR_REVENG_TABLES));
+ //create reveng.xml file
+ IPath revengPath = project.getLocation().append(".settings").append("gen-entities.hibernate.reveng.xml"); //$NON-NLS-1$ //$NON-NLS-2$
+ File location = revengPath.toFile();
+ org.jboss.tools.common.util.FileUtil.writeFile(location, params.get(HibernateLaunchConstants.ATTR_REVENG_TABLES));
+ wc.setAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_SETTINGS, revengPath.toString());
}
launchManager.addLaunch(wc.launch(ILaunchManager.RUN_MODE, monitor));
16 years, 2 months
JBoss Tools SVN: r10961 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-10-20 04:29:59 -0400 (Mon, 20 Oct 2008)
New Revision: 10961
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1178
Reveng filter storage moved from launch configuration to xml file.
File stored in .settings dir of the project.
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2008-10-20 08:23:31 UTC (rev 10960)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2008-10-20 08:29:59 UTC (rev 10961)
@@ -266,7 +266,6 @@
final String reverseEngineeringStrategy = attributes.getRevengStrategy();
final boolean preferBasicCompositeids = attributes.isPreferBasicCompositeIds();
final IResource revengres = PathHelper.findMember( root, attributes.getRevengSettings());
- final String revengTables = attributes.getRevengTables();
if(reveng) {
Configuration configuration = null;
@@ -291,12 +290,7 @@
OverrideRepository repository = null;
- if (revengTables != null){
- repository = new OverrideRepository();
- repository.addInputStream(new ByteArrayInputStream(revengTables.getBytes()));
- } else if(revengres!=null) {
- /*Configuration configuration = cc.buildWith(new Configuration(), false);*/
- /*Settings settings = cc.getSettings(configuration);*/
+ if(revengres!=null) {
File file = PathHelper.getLocation( revengres ).toFile();
repository = new OverrideRepository();
repository.addFile(file);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java 2008-10-20 08:23:31 UTC (rev 10960)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java 2008-10-20 08:29:59 UTC (rev 10961)
@@ -74,7 +74,6 @@
private String templatePath;
private List exporterFactories;
// if set then build reveng strategy relying on the list of tables
- private String revengTables;
private boolean autoManyToManyDetection;
private boolean autoVersioning;
@@ -110,7 +109,6 @@
}
exporterFactories = readExporterFactories(configuration);
- revengTables = configuration.getAttribute(HibernateLaunchConstants.ATTR_REVENG_TABLES, (String)null);
} catch (CoreException e) {
throw new CoreException(HibernateConsolePlugin.throwableToStatus(e, 666));
}
@@ -347,19 +345,12 @@
return exporterFactories;
}
-public boolean detectManyToMany() {
- return autoManyToManyDetection;
-}
+ public boolean detectManyToMany() {
+ return autoManyToManyDetection;
+ }
public boolean detectOptimisticLock() {
return autoVersioning;
}
- public String getRevengTables() {
- return revengTables;
- }
-
-
-
-
}
16 years, 2 months
JBoss Tools SVN: r10960 - branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-20 04:23:31 -0400 (Mon, 20 Oct 2008)
New Revision: 10960
Modified:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
Log:
JBIDE-2935
When the analyzer to parse the model , it can't understand the input data type.
Now I modify some codes to make it can know the input data type to parse that,
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-10-20 08:16:32 UTC (rev 10959)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-10-20 08:23:31 UTC (rev 10960)
@@ -40,6 +40,7 @@
import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
import org.jboss.tools.smooks.utils.UIUtils;
import org.jboss.tools.smooks.xml.model.AbstractXMLObject;
+import org.jboss.tools.smooks.xml.model.DocumentObject;
import org.jboss.tools.smooks.xml.model.TagObject;
import org.jboss.tools.smooks.xml.model.TagPropertyObject;
@@ -203,6 +204,9 @@
public MappingResourceConfigList analyzeMappingSmooksModel(
SmooksResourceListType listType, Object sourceObject,
Object targetObject) {
+ if(sourceObject instanceof DocumentObject){
+ sourceObject = ((DocumentObject)sourceObject).getRootTag();
+ }
if(targetObject instanceof List){
targetObject = (JavaBeanModel) ((List)targetObject).get(0);
}
16 years, 2 months
JBoss Tools SVN: r10959 - trunk/smooks/plugins.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-20 04:16:32 -0400 (Mon, 20 Oct 2008)
New Revision: 10959
Removed:
trunk/smooks/plugins/org.jboss.tools.smooks.graphicalInfo/
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/
trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/
Log:
JBIDE-2935
those plugins should be deleted , because they are merged into other plugins.
16 years, 2 months
JBoss Tools SVN: r10958 - branches/jbosstools-3.0.0.Beta1/smooks/plugins.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-20 04:11:49 -0400 (Mon, 20 Oct 2008)
New Revision: 10958
Removed:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.graphicalInfo/
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.java2xml/
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.xml2java/
Log:
JBIDE-2835
Those plugins have been merged into other plugins , so they are unusable now and they should be deleted.
16 years, 2 months
JBoss Tools SVN: r10957 - in trunk/smooks: plugins/org.jboss.tools.smooks.javabean and 17 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-20 04:08:29 -0400 (Mon, 20 Oct 2008)
New Revision: 10957
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/dom4j-1.6.1.jar
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/DOM2FreeMarkerTransformor.java
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/FreeMarkerContentReplacer.java
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/utils/
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/utils/XMLConstants.java
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphInformations.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalFactory.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalPackage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/MappingDataType.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Param.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Params.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphInformationsImpl.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalFactoryImpl.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalPackageImpl.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/MappingDataTypeImpl.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamImpl.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamsImpl.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalAdapterFactory.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalSwitch.java
Modified:
trunk/smooks/features/org.jboss.tools.smooks.feature/feature.xml
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/.classpath
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF/MANIFEST.MF
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/build.properties
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/plugin.xml
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
trunk/smooks/tests/org.jboss.tools.smooks.test/META-INF/MANIFEST.MF
trunk/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java2java/SmooksAnalyzerTester.java
Log:
JBIDE-2835
For resolve the beta1 bug JBIDE-2835 , and merge the alterations to the trunk
1.org.jboss.tools.smooks.graphicalInfo merge into the org.jboss.tools.smooks.ui
2.org.jboss.tools.smooks.xml2java merge into the org.jboss.tools.smooks.javabean
3.org.jboss.tools.smooks.java2xml merge into the org.jboss,tools.smooks.javabean
Now there are 5 plugins for smooks tools :
javabean
xml
ui
model
model.edit
Modified: trunk/smooks/features/org.jboss.tools.smooks.feature/feature.xml
===================================================================
--- trunk/smooks/features/org.jboss.tools.smooks.feature/feature.xml 2008-10-20 07:59:03 UTC (rev 10956)
+++ trunk/smooks/features/org.jboss.tools.smooks.feature/feature.xml 2008-10-20 08:08:29 UTC (rev 10957)
@@ -1,25 +1,25 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.jboss.tools.smooks.feature"
- label="Smooks Tools"
- version="1.0.0"
- provider-name="JBoss, a division of Red Hat">
-
- <description url="http://www.example.com/description">
- Smooks Tools
- </description>
-
- <copyright url="http://www.example.com/copyright">
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.smooks.feature"
+ label="Smooks Tools"
+ version="1.0.0"
+ provider-name="JBoss, a division of Red Hat">
+
+ <description url="http://www.example.com/description">
+ Smooks Tools
+ </description>
+
+ <copyright url="http://www.example.com/copyright">
Copyright (c) 2008 Red Hat, Inc.
Distributed under license by Red Hat, Inc. All rights reserved.
This program is 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:
-Red Hat, Inc. - initial API and implementation
- </copyright>
-
- <license url="http://www.example.com/license">
+Red Hat, Inc. - initial API and implementation
+ </copyright>
+
+ <license url="http://www.example.com/license">
Eclipse Public License - v 1.0
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS
ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
@@ -215,63 +215,42 @@
No party to this Agreement will bring a legal action under this
Agreement more than one year after the cause of action arose.
Each party waives its rights to a jury trial in any resulting
-litigation.
- </license>
-
- <plugin
- id="org.jboss.tools.smooks.graphicalInfo"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.javabean"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.model"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.model.edit"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.xml"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.xml2java"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.java2xml"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
+litigation.
+ </license>
+
+ <plugin
+ id="org.jboss.tools.smooks.javabean"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.smooks.model"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.smooks.model.edit"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.smooks.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.smooks.xml"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/.classpath
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/.classpath 2008-10-20 07:59:03 UTC (rev 10956)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/.classpath 2008-10-20 08:08:29 UTC (rev 10957)
@@ -3,5 +3,6 @@
<classpathentry 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="lib" path="libs/dom4j-1.6.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF/MANIFEST.MF
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF/MANIFEST.MF 2008-10-20 07:59:03 UTC (rev 10956)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF/MANIFEST.MF 2008-10-20 08:08:29 UTC (rev 10957)
@@ -17,11 +17,16 @@
org.jboss.tools.smooks.model,
org.jboss.tools.smooks.model.edit,
org.eclipse.ui.ide,
- org.jboss.tools.smooks.graphicalInfo
+ org.jboss.tools.smooks.xml;bundle-version="1.0.0"
Eclipse-LazyStart: true
-Export-Package: org.jboss.tools.smooks.javabean,
+Export-Package: org.jboss.tools.smooks.java2xml.analyzer,
+ org.jboss.tools.smooks.java2xml.utils,
+ org.jboss.tools.smooks.javabean,
org.jboss.tools.smooks.javabean.analyzer,
org.jboss.tools.smooks.javabean.commandprocessor,
org.jboss.tools.smooks.javabean.model,
- org.jboss.tools.smooks.javabean.ui
-Bundle-ClassPath: .
+ org.jboss.tools.smooks.javabean.ui,
+ org.jboss.tools.smooks.javabean.uitils,
+ org.jboss.tools.smooks.xml2java.analyzer
+Bundle-ClassPath: .,
+ libs/dom4j-1.6.1.jar
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/build.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/build.properties 2008-10-20 07:59:03 UTC (rev 10956)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/build.properties 2008-10-20 08:08:29 UTC (rev 10957)
@@ -2,7 +2,8 @@
bin.includes = META-INF/,\
plugin.xml,\
icons/,\
- .
+ .,\
+ libs/dom4j-1.6.1.jar
jars.compile.order = smooks-javabean.jar
output.smooks-javabean.jar = bin/
src.includes = src/,\
Added: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/dom4j-1.6.1.jar
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/dom4j-1.6.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/plugin.xml
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/plugin.xml 2008-10-20 07:59:03 UTC (rev 10956)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/plugin.xml 2008-10-20 08:08:29 UTC (rev 10957)
@@ -36,4 +36,35 @@
typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
</targetModelAnalyzer>
</extension>
+
+ <extension
+ point="org.jboss.tools.smooks.ui.analyzer">
+ <mappingAnalyzer
+ class="org.jboss.tools.smooks.java2xml.analyzer.Java2XMLAnalyzer"
+ name="Java Bean"
+ typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
+ <targetSourceType
+ id="org.jboss.tools.smooks.xml.viewerInitor.xml"
+ name="XML">
+ </targetSourceType>
+ </mappingAnalyzer>
+ </extension>
+
+ <extension
+ point="org.jboss.tools.smooks.ui.analyzer">
+ <mappingAnalyzer
+ class="org.jboss.tools.smooks.xml2java.analyzer.XML2JavaAnalyzer"
+ name="XML2Java"
+ typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
+ <targetSourceType
+ id="org.jboss.tools.smooks.ui.viewerInitor.javabean"
+ name="JavaBean">
+ </targetSourceType>
+ </mappingAnalyzer>
+ <sourceModelAnalyzer
+ class="org.jboss.tools.smooks.xml2java.analyzer.XMLSourceModelAnalyzer"
+ name="XML"
+ typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
+ </sourceModelAnalyzer>
+ </extension>
</plugin>
Added: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/DOM2FreeMarkerTransformor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/DOM2FreeMarkerTransformor.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/DOM2FreeMarkerTransformor.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.java2xml.analyzer;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.dom4j.Attribute;
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.jboss.tools.smooks.java2xml.utils.XMLConstants;
+
+/**
+ * @author Dart Peng
+ * @Date : Sep 25, 2008
+ */
+public class DOM2FreeMarkerTransformor {
+
+ public String transformDOM(Document document) {
+ Element element = document.getRootElement();
+ StringBuffer buffer = new StringBuffer();
+ transform(element, buffer);
+ return buffer.toString();
+ }
+
+ protected void transform(Element element, StringBuffer buffer) {
+ String name = element.getName();
+ if (XMLConstants.REPLACE_FREEMARKER_FOR_EXPRESS_ELEMENT_NAME
+ .equals(name)) {
+ String desc = element
+ .attributeValue(XMLConstants.REPLACE_FREEMARKER_FOR_EXPRESS_ELEMENT_ATTRIBUTE);
+ name = "#" + desc;
+ }
+ String attributesString = "";
+ if(!isFreeMarkerExpression(name)){
+ attributesString = buildAttributeString(element);
+ }
+ List children = element.elements();
+ if (children.isEmpty()) {
+ buffer.append("<" + name + " " +attributesString + "/>");
+ return;
+ } else {
+ buffer.append("<" + name + " " +attributesString + "/>");
+ for (Iterator iterator = children.iterator(); iterator.hasNext();) {
+ Element child = (Element) iterator.next();
+ transform(child, buffer);
+ }
+ if(isFreeMarkerExpression(name)){
+ name = name.trim();
+ int index = name.indexOf(" ");
+ if(index != -1){
+ name = name.substring(0,index);
+ }
+ }
+ buffer.append("</" + name + ">");
+ }
+ }
+
+ private String buildAttributeString(Element element) {
+ List list = element.attributes();
+ StringBuffer buffer = new StringBuffer("");
+ for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+ Attribute att = (Attribute) iterator.next();
+ String name = att.getName();
+ String value = att.getValue();
+ if(value == null) value = "";
+ if(name != null){
+ buffer.append(name);
+ buffer.append("=");
+ buffer.append("\"");
+ buffer.append(value);
+ buffer.append("\"");
+ buffer.append(" ");
+ }
+ }
+ return buffer.toString();
+ }
+
+ private boolean isFreeMarkerExpression(String str){
+ return str.startsWith("#");
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/DOM2FreeMarkerTransformor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/FreeMarkerContentReplacer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/FreeMarkerContentReplacer.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/FreeMarkerContentReplacer.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.java2xml.analyzer;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+
+/**
+ * @author Dart Peng
+ * @Date : Sep 25, 2008
+ */
+public class FreeMarkerContentReplacer {
+
+ public String replaceFreeMarkerTemplate(Reader reader) throws IOException {
+ StringBuffer buffer = new StringBuffer();
+// Configuration fmConfiguration = new Configuration();
+// fmConfiguration.setTagSyntax(Configuration.AUTO_DETECT_TAG_SYNTAX);
+//
+// Template template;
+// template = new Template("XML2Java_FreeMarker", reader, fmConfiguration);
+// TemplateElement root = template.getRootTreeNode();
+// visitTemplateElement(root, buffer);
+ return buffer.toString();
+ }
+
+ public String replaceFreeMarkerTemplate(String templateContents)
+ throws IOException {
+ Reader reader = new StringReader(templateContents);
+ return replaceFreeMarkerTemplate(reader);
+ }
+
+// private void visitTemplateElement(TemplateElement model, StringBuffer buffer) {
+
+// Enumeration children = ((TemplateElement) model).children();
+// if (!"MixedContent".equals(model.getNodeName())) {
+// buffer
+// .append("<"
+// + XMLConstants.REPLACE_FREEMARKER_FOR_EXPRESS_ELEMENT_NAME
+// + " "
+// + XMLConstants.REPLACE_FREEMARKER_FOR_EXPRESS_ELEMENT_ATTRIBUTE
+// + "= \"" + model.getDescription() + "\">");
+// }
+// while (children.hasMoreElements()) {
+// Object obj = children.nextElement();
+// if (!(obj instanceof TextBlock)) {
+// TemplateElement child = (TemplateElement) obj;
+// String str = child.getSource();
+// if (child.isLeaf()) {
+// if (child.getNodeName().equals("DollarVariable")) {
+// buffer.append(child.getSource());
+// } else {
+// buffer.append(child.getDescription());
+// }
+// continue;
+// }
+// visitTemplateElement(child, buffer);
+// } else {
+// buffer.append(obj);
+// }
+// }
+// if (!"MixedContent".equals(model.getNodeName())) {
+// buffer.append("</"
+// + XMLConstants.REPLACE_FREEMARKER_FOR_EXPRESS_ELEMENT_NAME
+// + ">");
+// }
+// }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/FreeMarkerContentReplacer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.java2xml.analyzer;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.smooks.analyzer.AbstractAnalyzer;
+import org.jboss.tools.smooks.analyzer.DesignTimeAnalyzeResult;
+import org.jboss.tools.smooks.analyzer.MappingResourceConfigList;
+import org.jboss.tools.smooks.analyzer.SmooksAnalyzerException;
+import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
+import org.jboss.tools.smooks.model.ParamType;
+import org.jboss.tools.smooks.model.ResourceConfigType;
+import org.jboss.tools.smooks.model.SmooksFactory;
+import org.jboss.tools.smooks.model.SmooksResourceListType;
+import org.jboss.tools.smooks.model.util.SmooksModelUtils;
+import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataModel;
+import org.jboss.tools.smooks.ui.gef.model.GraphRootModel;
+import org.jboss.tools.smooks.ui.gef.model.LineConnectionModel;
+import org.jboss.tools.smooks.ui.gef.model.SourceModel;
+import org.jboss.tools.smooks.ui.gef.model.TargetModel;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
+import org.jboss.tools.smooks.utils.UIUtils;
+import org.jboss.tools.smooks.xml.model.AbstractXMLObject;
+import org.jboss.tools.smooks.xml.model.DocumentObject;
+import org.jboss.tools.smooks.xml.model.TagObject;
+import org.jboss.tools.smooks.xml.model.TagPropertyObject;
+
+/**
+ *
+ * @author <a href="mailto:dpeng@redhat.com">Dart Peng</a>
+ * @Date 2008-9-22
+ */
+public class Java2XMLAnalyzer extends AbstractAnalyzer {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.smooks.analyzer.IMappingAnalyzer#analyzeMappingGraphModel(org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext)
+ */
+ public void analyzeMappingGraphModel(
+ SmooksConfigurationFileGenerateContext context)
+ throws SmooksAnalyzerException {
+ // TODO will modify soon
+
+ if(true){
+ Shell shell = context.getShell();
+ MessageDialog.openWarning(shell, "Warning", "The java2xml can't be generate to config file currently.");
+ return;
+ }
+
+ GraphRootModel rootModel = context.getGraphicalRootModel();
+ List<SourceModel> sourceModelList = rootModel.loadSourceModelList();
+ List<TargetModel> targetModelList = rootModel.loadTargetModelList();
+
+ // Element rootElement = DocumentHelper.createElement(name);
+ TagObject root = null;
+ for (Iterator iterator = targetModelList.iterator(); iterator.hasNext();) {
+ TargetModel targetModel = (TargetModel) iterator.next();
+ AbstractXMLObject tag = (AbstractXMLObject) targetModel
+ .getReferenceEntityModel();
+ root = findTheRootTagObject(tag);
+ break;
+ }
+
+ if (root == null)
+ throw new SmooksAnalyzerException("can't find the root element");
+ Document document = DocumentHelper.createDocument();
+ Element rootElement = generateXMLContents(rootModel, root);
+ document.setRootElement(rootElement);
+
+ String string = document.asXML();
+
+ ResourceConfigType resource = SmooksFactory.eINSTANCE
+ .createResourceConfigType();
+ ParamType param = SmooksFactory.eINSTANCE.createParamType();
+ resource.getParam().add(param);
+ SmooksModelUtils.appendTextToSmooksType(param, string);
+ context.getGeneratorResourceList().add(resource);
+ System.out.println(string);
+ }
+
+ protected Element generateXMLContents(GraphRootModel graph, TagObject tag) {
+ Element element = DocumentHelper.createElement(tag.getName());
+ AbstractStructuredDataModel dataModel = UIUtils.findGraphModel(graph,
+ tag);
+ generateElementAttribute(graph, element, tag.getProperties());
+ List children = tag.getChildren();
+ for (Iterator iterator = children.iterator(); iterator.hasNext();) {
+ TagObject child = (TagObject) iterator.next();
+ element.add(generateXMLContents(graph, child));
+ }
+
+ if (dataModel != null) {
+ LineConnectionModel connection = UIUtils
+ .getFirstTargetModelViaConnection(dataModel);
+ if (connection != null) {
+ SourceModel source = (SourceModel) connection.getSource();
+ element
+ .add(DocumentHelper
+ .createCDATA(getTheJavaBeanString((JavaBeanModel) source
+ .getReferenceEntityModel())));
+ }
+ }
+
+ return element;
+ }
+
+ protected void generateElementAttribute(GraphRootModel graph,
+ Element element, List<TagPropertyObject> properties) {
+ for (Iterator iterator = properties.iterator(); iterator.hasNext();) {
+ TagPropertyObject tagPropertyObject = (TagPropertyObject) iterator
+ .next();
+
+ AbstractStructuredDataModel dataModel = UIUtils.findGraphModel(
+ graph, tagPropertyObject);
+ LineConnectionModel connect = UIUtils
+ .getFirstTargetModelViaConnection(dataModel);
+ if (connect == null)
+ continue;
+
+ SourceModel source = (SourceModel) connect.getSource();
+
+ element.addAttribute(tagPropertyObject.getName(),
+ getTheJavaBeanString((JavaBeanModel) source
+ .getReferenceEntityModel()));
+ }
+ }
+
+ protected TagObject findTheRootTagObject(AbstractXMLObject obj) {
+ AbstractXMLObject parent = obj.getParent();
+ if (parent instanceof DocumentObject && obj instanceof TagObject)
+ return (TagObject) obj;
+ return (TagObject) findTheRootTagObject(parent);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.smooks.analyzer.IMappingAnalyzer#analyzeMappingSmooksModel(org.jboss.tools.smooks.model.SmooksResourceListType,
+ * java.lang.Object, java.lang.Object)
+ */
+ public MappingResourceConfigList analyzeMappingSmooksModel(
+ SmooksResourceListType listType, Object sourceObject,
+ Object targetObject) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ protected String getTheJavaBeanString(JavaBeanModel currentModel) {
+ String name = currentModel.getName();
+ JavaBeanModel parent = currentModel.getParent();
+ while (parent != null ) {
+ String pn = parent.getName();
+ if (pn != null) {
+ name = parent.getName() + "." + name;
+ }
+ parent = parent.getParent();
+ }
+ return "${" + name + "}";
+ }
+
+ public DesignTimeAnalyzeResult analyzeGraphModel(
+ SmooksConfigurationFileGenerateContext context) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/utils/XMLConstants.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/utils/XMLConstants.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/utils/XMLConstants.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.java2xml.utils;
+
+/**
+ * @author Dart Peng
+ * @Date : Sep 25, 2008
+ */
+public class XMLConstants {
+ public static final String REPLACE_FREEMARKER_FOR_EXPRESS_ELEMENT_NAME = "replaceElementNameForFreeMarker";
+
+ public static final String REPLACE_FREEMARKER_FOR_EXPRESS_ELEMENT_ATTRIBUTE = "desc";
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/utils/XMLConstants.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-20 07:59:03 UTC (rev 10956)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -350,6 +350,9 @@
AbstractStructuredDataModel sourceModel) {
JavaBeanModel source = (JavaBeanModel) sourceModel
.getReferenceEntityModel();
+ if(source.getBeanClass().isArray()){
+ return source.getName();
+ }
if (Collection.class.isAssignableFrom(source.getBeanClass())) {
return source.getName();
}
@@ -538,7 +541,7 @@
}
String beanClass = SmooksModelUtils.getParmaText(
"beanClass", rc);
- if (targetName.equals(beanClass)) {
+ if (targetName!=null && targetName.trim().equals(beanClass)) {
setSelectorIsUsed(sourceName);
// create the first connection
mappingModelList.add(new MappingModel(source, target));
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java 2008-10-20 07:59:03 UTC (rev 10956)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -227,6 +227,7 @@
Class beanType = beanClass.getComponentType();
setMany(true);
componentClass = beanType;
+ setGenericType(true);
}
return many;
}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,396 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.xml2java.analyzer;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.text.html.HTMLDocument.HTMLReader.TagAction;
+
+import org.eclipse.emf.ecore.xml.type.AnyType;
+import org.jboss.tools.smooks.analyzer.AbstractAnalyzer;
+import org.jboss.tools.smooks.analyzer.DesignTimeAnalyzeResult;
+import org.jboss.tools.smooks.analyzer.MappingModel;
+import org.jboss.tools.smooks.analyzer.MappingResourceConfigList;
+import org.jboss.tools.smooks.analyzer.SmooksAnalyzerException;
+import org.jboss.tools.smooks.javabean.analyzer.JavaBeanAnalyzer;
+import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
+import org.jboss.tools.smooks.model.ParamType;
+import org.jboss.tools.smooks.model.ResourceConfigType;
+import org.jboss.tools.smooks.model.ResourceType;
+import org.jboss.tools.smooks.model.SmooksFactory;
+import org.jboss.tools.smooks.model.SmooksResourceListType;
+import org.jboss.tools.smooks.model.util.SmooksModelConstants;
+import org.jboss.tools.smooks.model.util.SmooksModelUtils;
+import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataModel;
+import org.jboss.tools.smooks.ui.gef.model.GraphRootModel;
+import org.jboss.tools.smooks.ui.gef.model.IConnectableModel;
+import org.jboss.tools.smooks.ui.gef.model.LineConnectionModel;
+import org.jboss.tools.smooks.ui.gef.model.SourceModel;
+import org.jboss.tools.smooks.ui.gef.model.TreeItemRelationModel;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
+import org.jboss.tools.smooks.utils.UIUtils;
+import org.jboss.tools.smooks.xml.model.AbstractXMLObject;
+import org.jboss.tools.smooks.xml.model.TagObject;
+import org.jboss.tools.smooks.xml.model.TagPropertyObject;
+
+/**
+ * @author Dart Peng
+ * @Date Aug 20, 2008
+ */
+public class XML2JavaAnalyzer extends AbstractAnalyzer {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.smooks.analyzer.IAnalyzer#analyzeMappingGraphModel(org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext)
+ */
+ public void analyzeMappingGraphModel(
+ SmooksConfigurationFileGenerateContext context)
+ throws SmooksAnalyzerException {
+
+ SmooksResourceListType listType = context.getSmooksResourceListModel();
+ GraphRootModel rootModel = context.getGraphicalRootModel();
+ List children = rootModel.getChildren();
+ for (Iterator iterator = children.iterator(); iterator.hasNext();) {
+ TreeItemRelationModel dataModel = (TreeItemRelationModel) iterator
+ .next();
+ if (dataModel.getClass() == SourceModel.class) {
+ List sourceConnections = dataModel.getModelSourceConnections();
+ if (sourceConnections.isEmpty())
+ continue;
+ processSourceConnections(sourceConnections, context, listType,
+ (SourceModel) dataModel);
+ }
+ }
+ }
+
+ protected void processSourceConnections(List sourceConnections,
+ SmooksConfigurationFileGenerateContext context,
+ SmooksResourceListType listType, SourceModel sourceModel) {
+ for (Iterator iterator = sourceConnections.iterator(); iterator
+ .hasNext();) {
+ LineConnectionModel connection = (LineConnectionModel) iterator
+ .next();
+ processLineConnection(connection, context, listType, sourceModel,
+ null);
+ }
+ }
+
+ protected void processLineConnection(LineConnectionModel connection,
+ SmooksConfigurationFileGenerateContext context,
+ SmooksResourceListType listType, SourceModel sourceModel,
+ String beanID) {
+ if (this.connectionIsUsed(connection))
+ return;
+ setConnectionUsed(connection);
+ IConnectableModel sourceg = connection.getSource();
+ if (sourceg != sourceModel)
+ return;
+ IConnectableModel targetg = connection.getTarget();
+ AbstractXMLObject source = (AbstractXMLObject) sourceModel
+ .getReferenceEntityModel();
+ JavaBeanModel target = (JavaBeanModel) ((AbstractStructuredDataModel) targetg)
+ .getReferenceEntityModel();
+ ResourceConfigType resourceConfigType = SmooksFactory.eINSTANCE
+ .createResourceConfigType();
+ context.getGeneratorResourceList().add(resourceConfigType);
+ // addResourceConfigType(listType, resourceConfigType);
+ // set the selector string value
+ resourceConfigType.setSelector(source.getName());
+ // create a resource and add it to resourceConfig
+ ResourceType resourceType = SmooksFactory.eINSTANCE
+ .createResourceType();
+ resourceType.setValue(SmooksModelConstants.BEAN_POPULATOR);
+ resourceConfigType.setResource(resourceType);
+
+ // create param for resourceConfig
+ if (beanID == null) {
+ beanID = getBeanID(target);
+ } else {
+ if (beanID.startsWith("${") && beanID.endsWith("}")) {
+ beanID = beanID.substring(2, beanID.length() - 1);
+ }
+ }
+
+ addParamTypeToResourceConfig(resourceConfigType,
+ SmooksModelConstants.BEAN_ID, beanID);
+
+ // add beanClass param
+ addParamTypeToResourceConfig(resourceConfigType,
+ SmooksModelConstants.BEAN_CLASS, target.getBeanClassString());
+
+ // add bindings param
+ ParamType bindingsParam = addParamTypeToResourceConfig(
+ resourceConfigType, SmooksModelConstants.BINDINGS, null);
+ processBindingsParam(bindingsParam, target, source, context, listType);
+ //
+ }
+
+ protected void processBindingsParam(ParamType bindingsParam,
+ JavaBeanModel javaBean, AbstractXMLObject source,
+ SmooksConfigurationFileGenerateContext context,
+ SmooksResourceListType listType) {
+ List properties = javaBean.getProperties();
+ for (Iterator iterator = properties.iterator(); iterator.hasNext();) {
+ boolean isComplex = true;
+ JavaBeanModel child = (JavaBeanModel) iterator.next();
+ AbstractStructuredDataModel graphModel = UIUtils.findGraphModel(
+ context.getGraphicalRootModel(), child);
+ LineConnectionModel connection = UIUtils
+ .getFirstTargetModelViaConnection(graphModel);
+ if (connection == null)
+ continue;
+ AbstractStructuredDataModel sourceModel = (AbstractStructuredDataModel) connection
+ .getSource();
+
+ if (child.isPrimitive() || child.getProperties().isEmpty()) {
+ isComplex = false;
+ }
+
+ String selector = getSelectorID(child);
+ if (!isComplex) {
+ selector = getSelectorIDViaXMLObject(
+ (AbstractXMLObject) sourceModel
+ .getReferenceEntityModel(), source);
+ }
+ SmooksModelUtils.addBindingTypeToParamType(bindingsParam, child
+ .getName(), selector, null, null);
+ if (isComplex) {
+ processLineConnection(connection, context, listType,
+ (SourceModel) sourceModel, selector);
+ } else {
+ setConnectionUsed(connection);
+ continue;
+ }
+ }
+ }
+
+ protected String getSelectorIDViaXMLObject(AbstractXMLObject sourceModel,
+ AbstractXMLObject currentRoot) {
+ String name = sourceModel.getName();
+ if (sourceModel instanceof TagPropertyObject) {
+ name = "@" + name;
+ }
+ AbstractXMLObject parent = sourceModel.getParent();
+ while (parent != null && parent.getName() != null) {
+ name = parent.getName() + " " + name;
+ if (parent == currentRoot)
+ break;
+ parent = parent.getParent();
+ }
+ return name;
+ }
+
+ private String getSelectorID(JavaBeanModel javaBean) {
+ String selectorName = javaBean.getName();
+ return "${" + selectorName + "}";
+ }
+
+ protected String getBeanID(JavaBeanModel target) {
+ return target.getName();
+ }
+
+ public MappingResourceConfigList analyzeMappingSmooksModel(
+ SmooksResourceListType listType, Object sourceObject,
+ Object targetObject) {
+ if(targetObject instanceof List){
+ targetObject = (JavaBeanModel) ((List)targetObject).get(0);
+ }
+ if (!(sourceObject instanceof AbstractXMLObject)
+ || !(targetObject instanceof JavaBeanModel)) {
+ return MappingResourceConfigList.createEmptyList();
+ }
+ AbstractXMLObject sourceRoot = (AbstractXMLObject) sourceObject;
+ JavaBeanModel sourceTarget = (JavaBeanModel) targetObject;
+
+ ResourceConfigType rootResourceConfig = findFirstMappingResourceConfig(listType);
+ String xmlName = rootResourceConfig.getSelector();
+ AbstractXMLObject source = findXMLObjectByName(xmlName, sourceRoot);
+ if (source == null)
+ return MappingResourceConfigList.createEmptyList();
+
+ MappingResourceConfigList rcl = new MappingResourceConfigList();
+ this.createMappingResourceConfigList(rcl, listType, rootResourceConfig,
+ source, sourceTarget);
+ return rcl;
+ }
+
+ public static AbstractXMLObject findXMLObjectByName(String selector,
+ AbstractXMLObject root) {
+ if (selector == null)
+ return null;
+ if (selector.equals(root.getName())) {
+ return root;
+ }
+ if (root instanceof TagObject) {
+ List properties = ((TagObject) root).getProperties();
+ for (Iterator iterator = properties.iterator(); iterator.hasNext();) {
+ TagPropertyObject pro = (TagPropertyObject) iterator.next();
+ if (selector.equals(pro.getName()))
+ return pro;
+ }
+ List<AbstractXMLObject> tags = ((TagObject) root).getChildren();
+ for (Iterator iterator = tags.iterator(); iterator.hasNext();) {
+ AbstractXMLObject tagChild = (AbstractXMLObject) iterator
+ .next();
+ AbstractXMLObject result = findXMLObjectByName(selector,
+ tagChild);
+ if (result != null)
+ return result;
+ }
+ }
+ return null;
+
+ }
+
+ protected void createMappingResourceConfigList(
+ MappingResourceConfigList configList, SmooksResourceListType list,
+ ResourceConfigType config, AbstractXMLObject sourceRoot,
+ JavaBeanModel targetJavaBean) {
+ String selector = config.getSelector();
+ String beanID = SmooksModelUtils.getParmaText(
+ SmooksModelConstants.BEAN_ID, config);
+ String beanClass = SmooksModelUtils.getParmaText(
+ SmooksModelConstants.BEAN_CLASS, config);
+
+ MappingModel mapping = new MappingModel(sourceRoot, targetJavaBean);
+ configList.getMappingModelList().add(mapping);
+ configList.addResourceConfig(config);
+ this.setSelectorIsUsed(config.getSelector());
+
+ List<ParamType> paramList = config.getParam();
+ ParamType bindingParam = null;
+ for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
+ ParamType paramType = (ParamType) iterator.next();
+ String name = paramType.getName();
+ if (SmooksModelConstants.BINDINGS.equals(name)) {
+ bindingParam = paramType;
+ break;
+ }
+ }
+
+ if (bindingParam != null) {
+ List bindings = (List) bindingParam.getMixed().get(
+ SmooksModelUtils.ELEMENT_BINDING, true);
+ if (bindings != null) {
+ for (Iterator iterator = bindings.iterator(); iterator
+ .hasNext();) {
+ AnyType binding = (AnyType) iterator.next();
+ String property = SmooksModelUtils
+ .getAttributeValueFromAnyType(binding,
+ SmooksModelUtils.ATTRIBUTE_PROPERTY);
+ String selectorStr = SmooksModelUtils
+ .getAttributeValueFromAnyType(binding,
+ SmooksModelUtils.ATTRIBUTE_SELECTOR);
+ JavaBeanModel childBean = JavaBeanAnalyzer
+ .findTheChildJavaBeanModel(property, targetJavaBean);
+ processXMLSelector(configList, config, sourceRoot,
+ childBean, list, selectorStr);
+ }
+ }
+ }
+ }
+
+ protected void processXMLSelector(MappingResourceConfigList configList,
+ ResourceConfigType resourceConfig, AbstractXMLObject root,
+ JavaBeanModel targetBean, SmooksResourceListType listType,
+ String selector) {
+ if (isReferenceSelector(selector)) {
+ ResourceConfigType resourceConfig1 = this
+ .findResourceConfigTypeWithSelector(selector, listType);
+ String newSelector = resourceConfig1.getSelector();
+ if (newSelector == null)
+ return;
+ AbstractXMLObject newRoot = findXMLObjectByName(newSelector, root);
+ createMappingResourceConfigList(configList, listType,
+ resourceConfig1, newRoot, targetBean);
+ } else {
+ AbstractXMLObject source = findXMLObjectWithSelectorString(
+ selector, root);
+ if (source != null) {
+ MappingModel mapping = new MappingModel(source, targetBean);
+ configList.getMappingModelList().add(mapping);
+ configList.addResourceConfig(resourceConfig);
+ this.setSelectorIsUsed(selector);
+ }
+ }
+ }
+
+ public static AbstractXMLObject findXMLObjectWithSelectorString(
+ String selector, AbstractXMLObject parent) {
+ if (selector == null)
+ return null;
+ selector = selector.trim();
+ String[] names = selector.split(" ");
+ if (names == null)
+ return null;
+ AbstractXMLObject current = parent;
+ for (int i = 0; i < names.length; i++) {
+ String name = names[i].trim();
+ if (current instanceof TagObject && isXMLAttributeObject(name)) {
+ List properties = ((TagObject) current).getProperties();
+ name = name.substring(1);
+ for (Iterator iterator = properties.iterator(); iterator
+ .hasNext();) {
+ TagPropertyObject property = (TagPropertyObject) iterator
+ .next();
+ if (name.equals(property.getName())) {
+ current = property;
+ }
+ }
+ } else {
+ List list = parent.getChildren();
+ for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+ AbstractXMLObject child = (AbstractXMLObject) iterator
+ .next();
+ if (name.equals(child.getName())) {
+ current = child;
+ break;
+ }
+ }
+ }
+ }
+ if (current == parent)
+ return null;
+ return current;
+ }
+
+ public static boolean isXMLAttributeObject(String name) {
+ if (name != null && name.startsWith("@"))
+ return true;
+ return false;
+ }
+
+ private ResourceConfigType findFirstMappingResourceConfig(
+ SmooksResourceListType listType) {
+ List list = listType.getAbstractResourceConfig();
+ for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+ ResourceConfigType resource = (ResourceConfigType) iterator.next();
+ ResourceType rt = resource.getResource();
+ if (rt == null)
+ continue;
+ String value = rt.getValue();
+ if (SmooksModelConstants.BEAN_POPULATOR.equals(value)) {
+ return resource;
+ }
+ }
+ return null;
+ }
+
+ public DesignTimeAnalyzeResult analyzeGraphModel(
+ SmooksConfigurationFileGenerateContext context) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.xml2java.analyzer;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.dom4j.DocumentException;
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.smooks.analyzer.ISourceModelAnalyzer;
+import org.jboss.tools.smooks.graphical.GraphInformations;
+import org.jboss.tools.smooks.graphical.Param;
+import org.jboss.tools.smooks.graphical.Params;
+import org.jboss.tools.smooks.model.SmooksResourceListType;
+import org.jboss.tools.smooks.xml.model.AbstractXMLObject;
+import org.jboss.tools.smooks.xml.model.DocumentObject;
+import org.jboss.tools.smooks.xml.model.XMLObjectAnalyzer;
+
+/**
+ * @author Dart Peng<br>
+ * Date : Sep 23, 2008
+ */
+public class XMLSourceModelAnalyzer implements ISourceModelAnalyzer {
+
+ public static final String XML_FILE = "xmlFile";
+
+ public Object buildSourceInputObjects(GraphInformations graphInfo,
+ SmooksResourceListType listType, IFile sourceFile)
+ throws InvocationTargetException {
+ Params params = graphInfo.getParams();
+ String path = null;
+ if (params != null) {
+ List<Param> paramList = graphInfo.getParams().getParam();
+ for (Iterator<Param> iterator = paramList.iterator(); iterator
+ .hasNext();) {
+ Param param = (Param) iterator.next();
+ if (param.getName().equals(XML_FILE)) {
+ path = param.getValue();
+ break;
+ }
+ }
+ }
+ if (path == null) {
+ // TODO tell user the filepath can't find or not ?
+ return null;
+// throw new InvocationTargetException(new Exception(
+// "xml file path can't find in the graphInfo file"));
+ }
+ XMLObjectAnalyzer objectBuilder = new XMLObjectAnalyzer();
+ try {
+ FileInputStream stream = new FileInputStream(path);
+ DocumentObject document = objectBuilder.analyze(stream);
+ return document;
+ } catch (FileNotFoundException e) {
+ throw new InvocationTargetException(e);
+ } catch (DocumentException e) {
+ throw new InvocationTargetException(e);
+ }
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2008-10-20 07:59:03 UTC (rev 10956)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2008-10-20 08:08:29 UTC (rev 10957)
@@ -20,7 +20,6 @@
org.eclipse.emf,
org.eclipse.emf.edit,
org.jboss.tools.smooks.model.edit,
- org.jboss.tools.smooks.graphicalInfo,
org.eclipse.ui.views.properties.tabbed,
org.eclipse.emf.edit.ui
Bundle-ActivationPolicy: lazy
@@ -28,6 +27,9 @@
Bundle-ClassPath: .
Bundle-Vendor: JBoss
Export-Package: org.jboss.tools.smooks.analyzer,
+ org.jboss.tools.smooks.graphical,
+ org.jboss.tools.smooks.graphical.impl,
+ org.jboss.tools.smooks.graphical.util,
org.jboss.tools.smooks.ui,
org.jboss.tools.smooks.ui.editors,
org.jboss.tools.smooks.ui.gef,
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2008-10-20 07:59:03 UTC (rev 10956)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2008-10-20 08:08:29 UTC (rev 10957)
@@ -3,6 +3,12 @@
<plugin>
<extension-point id="viewerInitor" name="viewerInitor" schema="schema/viewerInitor.exsd"/>
<extension-point id="analyzer" name="analyzer" schema="schema/analyzer.exsd"/>
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <package
+ uri = "http://www.jboss.org/tools/smooks/graphicalInformation"
+ class = "org.jboss.tools.smooks.graphical.GraphicalPackage"
+ genModel = "model/graphical.genmodel" />
+ </extension>
<extension
point="org.eclipse.ui.editors">
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphInformations.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphInformations.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphInformations.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,81 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Graph Informations</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.GraphInformations#getMappingType <em>Mapping Type</em>}</li>
+ * <li>{@link org.jboss.tools.smooks.graphical.GraphInformations#getParams <em>Params</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getGraphInformations()
+ * @model
+ * @generated
+ */
+public interface GraphInformations extends EObject {
+ /**
+ * Returns the value of the '<em><b>Mapping Type</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Mapping Type</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Mapping Type</em>' containment reference.
+ * @see #setMappingType(MappingDataType)
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getGraphInformations_MappingType()
+ * @model containment="true"
+ * @generated
+ */
+ MappingDataType getMappingType();
+
+ /**
+ * Sets the value of the '{@link org.jboss.tools.smooks.graphical.GraphInformations#getMappingType <em>Mapping Type</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Mapping Type</em>' containment reference.
+ * @see #getMappingType()
+ * @generated
+ */
+ void setMappingType(MappingDataType value);
+
+ /**
+ * Returns the value of the '<em><b>Params</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Params</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Params</em>' containment reference.
+ * @see #setParams(Params)
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getGraphInformations_Params()
+ * @model containment="true"
+ * @generated
+ */
+ Params getParams();
+
+ /**
+ * Sets the value of the '{@link org.jboss.tools.smooks.graphical.GraphInformations#getParams <em>Params</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Params</em>' containment reference.
+ * @see #getParams()
+ * @generated
+ */
+ void setParams(Params value);
+
+} // GraphInformations
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphInformations.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalFactory.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalFactory.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalFactory.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,73 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage
+ * @generated
+ */
+public interface GraphicalFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ GraphicalFactory eINSTANCE = org.jboss.tools.smooks.graphical.impl.GraphicalFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Graph Informations</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Graph Informations</em>'.
+ * @generated
+ */
+ GraphInformations createGraphInformations();
+
+ /**
+ * Returns a new object of class '<em>Mapping Data Type</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Mapping Data Type</em>'.
+ * @generated
+ */
+ MappingDataType createMappingDataType();
+
+ /**
+ * Returns a new object of class '<em>Params</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Params</em>'.
+ * @generated
+ */
+ Params createParams();
+
+ /**
+ * Returns a new object of class '<em>Param</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Param</em>'.
+ * @generated
+ */
+ Param createParam();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ GraphicalPackage getGraphicalPackage();
+
+} //GraphicalFactory
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalPackage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalPackage.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalPackage.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,439 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.GraphicalFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface GraphicalPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "graphical";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.jboss.org/tools/smooks/graphicalInformation";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ GraphicalPackage eINSTANCE = org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.jboss.tools.smooks.graphical.impl.GraphInformationsImpl <em>Graph Informations</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.GraphInformationsImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getGraphInformations()
+ * @generated
+ */
+ int GRAPH_INFORMATIONS = 0;
+
+ /**
+ * The feature id for the '<em><b>Mapping Type</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_INFORMATIONS__MAPPING_TYPE = 0;
+
+ /**
+ * The feature id for the '<em><b>Params</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_INFORMATIONS__PARAMS = 1;
+
+ /**
+ * The number of structural features of the '<em>Graph Informations</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_INFORMATIONS_FEATURE_COUNT = 2;
+
+ /**
+ * The meta object id for the '{@link org.jboss.tools.smooks.graphical.impl.MappingDataTypeImpl <em>Mapping Data Type</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.MappingDataTypeImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getMappingDataType()
+ * @generated
+ */
+ int MAPPING_DATA_TYPE = 1;
+
+ /**
+ * The feature id for the '<em><b>Target Type ID</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MAPPING_DATA_TYPE__TARGET_TYPE_ID = 0;
+
+ /**
+ * The feature id for the '<em><b>Source Type ID</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MAPPING_DATA_TYPE__SOURCE_TYPE_ID = 1;
+
+ /**
+ * The number of structural features of the '<em>Mapping Data Type</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MAPPING_DATA_TYPE_FEATURE_COUNT = 2;
+
+ /**
+ * The meta object id for the '{@link org.jboss.tools.smooks.graphical.impl.ParamsImpl <em>Params</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.ParamsImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getParams()
+ * @generated
+ */
+ int PARAMS = 2;
+
+ /**
+ * The feature id for the '<em><b>Param</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PARAMS__PARAM = 0;
+
+ /**
+ * The number of structural features of the '<em>Params</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PARAMS_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link org.jboss.tools.smooks.graphical.impl.ParamImpl <em>Param</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.ParamImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getParam()
+ * @generated
+ */
+ int PARAM = 3;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PARAM__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PARAM__VALUE = 1;
+
+ /**
+ * The number of structural features of the '<em>Param</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PARAM_FEATURE_COUNT = 2;
+
+
+ /**
+ * Returns the meta object for class '{@link org.jboss.tools.smooks.graphical.GraphInformations <em>Graph Informations</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Graph Informations</em>'.
+ * @see org.jboss.tools.smooks.graphical.GraphInformations
+ * @generated
+ */
+ EClass getGraphInformations();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.jboss.tools.smooks.graphical.GraphInformations#getMappingType <em>Mapping Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Mapping Type</em>'.
+ * @see org.jboss.tools.smooks.graphical.GraphInformations#getMappingType()
+ * @see #getGraphInformations()
+ * @generated
+ */
+ EReference getGraphInformations_MappingType();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.jboss.tools.smooks.graphical.GraphInformations#getParams <em>Params</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Params</em>'.
+ * @see org.jboss.tools.smooks.graphical.GraphInformations#getParams()
+ * @see #getGraphInformations()
+ * @generated
+ */
+ EReference getGraphInformations_Params();
+
+ /**
+ * Returns the meta object for class '{@link org.jboss.tools.smooks.graphical.MappingDataType <em>Mapping Data Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Mapping Data Type</em>'.
+ * @see org.jboss.tools.smooks.graphical.MappingDataType
+ * @generated
+ */
+ EClass getMappingDataType();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.jboss.tools.smooks.graphical.MappingDataType#getTargetTypeID <em>Target Type ID</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Target Type ID</em>'.
+ * @see org.jboss.tools.smooks.graphical.MappingDataType#getTargetTypeID()
+ * @see #getMappingDataType()
+ * @generated
+ */
+ EAttribute getMappingDataType_TargetTypeID();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.jboss.tools.smooks.graphical.MappingDataType#getSourceTypeID <em>Source Type ID</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Source Type ID</em>'.
+ * @see org.jboss.tools.smooks.graphical.MappingDataType#getSourceTypeID()
+ * @see #getMappingDataType()
+ * @generated
+ */
+ EAttribute getMappingDataType_SourceTypeID();
+
+ /**
+ * Returns the meta object for class '{@link org.jboss.tools.smooks.graphical.Params <em>Params</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Params</em>'.
+ * @see org.jboss.tools.smooks.graphical.Params
+ * @generated
+ */
+ EClass getParams();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.jboss.tools.smooks.graphical.Params#getParam <em>Param</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Param</em>'.
+ * @see org.jboss.tools.smooks.graphical.Params#getParam()
+ * @see #getParams()
+ * @generated
+ */
+ EReference getParams_Param();
+
+ /**
+ * Returns the meta object for class '{@link org.jboss.tools.smooks.graphical.Param <em>Param</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Param</em>'.
+ * @see org.jboss.tools.smooks.graphical.Param
+ * @generated
+ */
+ EClass getParam();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.jboss.tools.smooks.graphical.Param#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.jboss.tools.smooks.graphical.Param#getName()
+ * @see #getParam()
+ * @generated
+ */
+ EAttribute getParam_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.jboss.tools.smooks.graphical.Param#getValue <em>Value</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Value</em>'.
+ * @see org.jboss.tools.smooks.graphical.Param#getValue()
+ * @see #getParam()
+ * @generated
+ */
+ EAttribute getParam_Value();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ GraphicalFactory getGraphicalFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link org.jboss.tools.smooks.graphical.impl.GraphInformationsImpl <em>Graph Informations</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.GraphInformationsImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getGraphInformations()
+ * @generated
+ */
+ EClass GRAPH_INFORMATIONS = eINSTANCE.getGraphInformations();
+
+ /**
+ * The meta object literal for the '<em><b>Mapping Type</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference GRAPH_INFORMATIONS__MAPPING_TYPE = eINSTANCE.getGraphInformations_MappingType();
+
+ /**
+ * The meta object literal for the '<em><b>Params</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference GRAPH_INFORMATIONS__PARAMS = eINSTANCE.getGraphInformations_Params();
+
+ /**
+ * The meta object literal for the '{@link org.jboss.tools.smooks.graphical.impl.MappingDataTypeImpl <em>Mapping Data Type</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.MappingDataTypeImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getMappingDataType()
+ * @generated
+ */
+ EClass MAPPING_DATA_TYPE = eINSTANCE.getMappingDataType();
+
+ /**
+ * The meta object literal for the '<em><b>Target Type ID</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MAPPING_DATA_TYPE__TARGET_TYPE_ID = eINSTANCE.getMappingDataType_TargetTypeID();
+
+ /**
+ * The meta object literal for the '<em><b>Source Type ID</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MAPPING_DATA_TYPE__SOURCE_TYPE_ID = eINSTANCE.getMappingDataType_SourceTypeID();
+
+ /**
+ * The meta object literal for the '{@link org.jboss.tools.smooks.graphical.impl.ParamsImpl <em>Params</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.ParamsImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getParams()
+ * @generated
+ */
+ EClass PARAMS = eINSTANCE.getParams();
+
+ /**
+ * The meta object literal for the '<em><b>Param</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PARAMS__PARAM = eINSTANCE.getParams_Param();
+
+ /**
+ * The meta object literal for the '{@link org.jboss.tools.smooks.graphical.impl.ParamImpl <em>Param</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.ParamImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getParam()
+ * @generated
+ */
+ EClass PARAM = eINSTANCE.getParam();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PARAM__NAME = eINSTANCE.getParam_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Value</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PARAM__VALUE = eINSTANCE.getParam_Value();
+
+ }
+
+} //GraphicalPackage
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalPackage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/MappingDataType.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/MappingDataType.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/MappingDataType.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,81 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Mapping Data Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.MappingDataType#getTargetTypeID <em>Target Type ID</em>}</li>
+ * <li>{@link org.jboss.tools.smooks.graphical.MappingDataType#getSourceTypeID <em>Source Type ID</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getMappingDataType()
+ * @model
+ * @generated
+ */
+public interface MappingDataType extends EObject {
+ /**
+ * Returns the value of the '<em><b>Target Type ID</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Target Type ID</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Target Type ID</em>' attribute.
+ * @see #setTargetTypeID(String)
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getMappingDataType_TargetTypeID()
+ * @model
+ * @generated
+ */
+ String getTargetTypeID();
+
+ /**
+ * Sets the value of the '{@link org.jboss.tools.smooks.graphical.MappingDataType#getTargetTypeID <em>Target Type ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Target Type ID</em>' attribute.
+ * @see #getTargetTypeID()
+ * @generated
+ */
+ void setTargetTypeID(String value);
+
+ /**
+ * Returns the value of the '<em><b>Source Type ID</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Source Type ID</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Source Type ID</em>' attribute.
+ * @see #setSourceTypeID(String)
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getMappingDataType_SourceTypeID()
+ * @model
+ * @generated
+ */
+ String getSourceTypeID();
+
+ /**
+ * Sets the value of the '{@link org.jboss.tools.smooks.graphical.MappingDataType#getSourceTypeID <em>Source Type ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Source Type ID</em>' attribute.
+ * @see #getSourceTypeID()
+ * @generated
+ */
+ void setSourceTypeID(String value);
+
+} // MappingDataType
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/MappingDataType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Param.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Param.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Param.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,81 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Param</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.Param#getName <em>Name</em>}</li>
+ * <li>{@link org.jboss.tools.smooks.graphical.Param#getValue <em>Value</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getParam()
+ * @model
+ * @generated
+ */
+public interface Param extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getParam_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.jboss.tools.smooks.graphical.Param#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Value</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Value</em>' attribute.
+ * @see #setValue(String)
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getParam_Value()
+ * @model
+ * @generated
+ */
+ String getValue();
+
+ /**
+ * Sets the value of the '{@link org.jboss.tools.smooks.graphical.Param#getValue <em>Value</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Value</em>' attribute.
+ * @see #getValue()
+ * @generated
+ */
+ void setValue(String value);
+
+} // Param
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Param.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Params.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Params.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Params.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,46 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Params</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.Params#getParam <em>Param</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getParams()
+ * @model
+ * @generated
+ */
+public interface Params extends EObject {
+ /**
+ * Returns the value of the '<em><b>Param</b></em>' containment reference list.
+ * The list contents are of type {@link org.jboss.tools.smooks.graphical.Param}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Param</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Param</em>' containment reference list.
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getParams_Param()
+ * @model containment="true"
+ * @generated
+ */
+ EList<Param> getParam();
+
+} // Params
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Params.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphInformationsImpl.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphInformationsImpl.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphInformationsImpl.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,247 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.jboss.tools.smooks.graphical.GraphInformations;
+import org.jboss.tools.smooks.graphical.GraphicalPackage;
+import org.jboss.tools.smooks.graphical.MappingDataType;
+import org.jboss.tools.smooks.graphical.Params;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Graph Informations</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.impl.GraphInformationsImpl#getMappingType <em>Mapping Type</em>}</li>
+ * <li>{@link org.jboss.tools.smooks.graphical.impl.GraphInformationsImpl#getParams <em>Params</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class GraphInformationsImpl extends EObjectImpl implements GraphInformations {
+ /**
+ * The cached value of the '{@link #getMappingType() <em>Mapping Type</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getMappingType()
+ * @generated
+ * @ordered
+ */
+ protected MappingDataType mappingType;
+
+ /**
+ * The cached value of the '{@link #getParams() <em>Params</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getParams()
+ * @generated
+ * @ordered
+ */
+ protected Params params;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GraphInformationsImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return GraphicalPackage.Literals.GRAPH_INFORMATIONS;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MappingDataType getMappingType() {
+ return mappingType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetMappingType(MappingDataType newMappingType, NotificationChain msgs) {
+ MappingDataType oldMappingType = mappingType;
+ mappingType = newMappingType;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE, oldMappingType, newMappingType);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setMappingType(MappingDataType newMappingType) {
+ if (newMappingType != mappingType) {
+ NotificationChain msgs = null;
+ if (mappingType != null)
+ msgs = ((InternalEObject)mappingType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE, null, msgs);
+ if (newMappingType != null)
+ msgs = ((InternalEObject)newMappingType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE, null, msgs);
+ msgs = basicSetMappingType(newMappingType, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE, newMappingType, newMappingType));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Params getParams() {
+ return params;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetParams(Params newParams, NotificationChain msgs) {
+ Params oldParams = params;
+ params = newParams;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GraphicalPackage.GRAPH_INFORMATIONS__PARAMS, oldParams, newParams);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setParams(Params newParams) {
+ if (newParams != params) {
+ NotificationChain msgs = null;
+ if (params != null)
+ msgs = ((InternalEObject)params).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GraphicalPackage.GRAPH_INFORMATIONS__PARAMS, null, msgs);
+ if (newParams != null)
+ msgs = ((InternalEObject)newParams).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GraphicalPackage.GRAPH_INFORMATIONS__PARAMS, null, msgs);
+ msgs = basicSetParams(newParams, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphicalPackage.GRAPH_INFORMATIONS__PARAMS, newParams, newParams));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE:
+ return basicSetMappingType(null, msgs);
+ case GraphicalPackage.GRAPH_INFORMATIONS__PARAMS:
+ return basicSetParams(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE:
+ return getMappingType();
+ case GraphicalPackage.GRAPH_INFORMATIONS__PARAMS:
+ return getParams();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE:
+ setMappingType((MappingDataType)newValue);
+ return;
+ case GraphicalPackage.GRAPH_INFORMATIONS__PARAMS:
+ setParams((Params)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE:
+ setMappingType((MappingDataType)null);
+ return;
+ case GraphicalPackage.GRAPH_INFORMATIONS__PARAMS:
+ setParams((Params)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE:
+ return mappingType != null;
+ case GraphicalPackage.GRAPH_INFORMATIONS__PARAMS:
+ return params != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //GraphInformationsImpl
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphInformationsImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalFactoryImpl.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalFactoryImpl.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalFactoryImpl.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,132 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import org.jboss.tools.smooks.graphical.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class GraphicalFactoryImpl extends EFactoryImpl implements GraphicalFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static GraphicalFactory init() {
+ try {
+ GraphicalFactory theGraphicalFactory = (GraphicalFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.jboss.org/tools/smooks");
+ if (theGraphicalFactory != null) {
+ return theGraphicalFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new GraphicalFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphicalFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case GraphicalPackage.GRAPH_INFORMATIONS: return createGraphInformations();
+ case GraphicalPackage.MAPPING_DATA_TYPE: return createMappingDataType();
+ case GraphicalPackage.PARAMS: return createParams();
+ case GraphicalPackage.PARAM: return createParam();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphInformations createGraphInformations() {
+ GraphInformationsImpl graphInformations = new GraphInformationsImpl();
+ return graphInformations;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MappingDataType createMappingDataType() {
+ MappingDataTypeImpl mappingDataType = new MappingDataTypeImpl();
+ return mappingDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Params createParams() {
+ ParamsImpl params = new ParamsImpl();
+ return params;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Param createParam() {
+ ParamImpl param = new ParamImpl();
+ return param;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphicalPackage getGraphicalPackage() {
+ return (GraphicalPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static GraphicalPackage getPackage() {
+ return GraphicalPackage.eINSTANCE;
+ }
+
+} //GraphicalFactoryImpl
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalFactoryImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalPackageImpl.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalPackageImpl.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalPackageImpl.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,318 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical.impl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.jboss.tools.smooks.graphical.GraphInformations;
+import org.jboss.tools.smooks.graphical.GraphicalFactory;
+import org.jboss.tools.smooks.graphical.GraphicalPackage;
+import org.jboss.tools.smooks.graphical.MappingDataType;
+import org.jboss.tools.smooks.graphical.Param;
+import org.jboss.tools.smooks.graphical.Params;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class GraphicalPackageImpl extends EPackageImpl implements GraphicalPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass graphInformationsEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass mappingDataTypeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass paramsEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass paramEClass = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private GraphicalPackageImpl() {
+ super(eNS_URI, GraphicalFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this
+ * model, and for any others upon which it depends. Simple
+ * dependencies are satisfied by calling this method on all
+ * dependent packages before doing anything else. This method drives
+ * initialization for interdependent packages directly, in parallel
+ * with this package, itself.
+ * <p>Of this package and its interdependencies, all packages which
+ * have not yet been registered by their URI values are first created
+ * and registered. The packages are then initialized in two steps:
+ * meta-model objects for all of the packages are created before any
+ * are initialized, since one package's meta-model objects may refer to
+ * those of another.
+ * <p>Invocation of this method will not affect any packages that have
+ * already been initialized.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static GraphicalPackage init() {
+ if (isInited) return (GraphicalPackage)EPackage.Registry.INSTANCE.getEPackage(GraphicalPackage.eNS_URI);
+
+ // Obtain or create and register package
+ GraphicalPackageImpl theGraphicalPackage = (GraphicalPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof GraphicalPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new GraphicalPackageImpl());
+
+ isInited = true;
+
+ // Create package meta-data objects
+ theGraphicalPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theGraphicalPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theGraphicalPackage.freeze();
+
+ return theGraphicalPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getGraphInformations() {
+ return graphInformationsEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getGraphInformations_MappingType() {
+ return (EReference)graphInformationsEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getGraphInformations_Params() {
+ return (EReference)graphInformationsEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getMappingDataType() {
+ return mappingDataTypeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getMappingDataType_TargetTypeID() {
+ return (EAttribute)mappingDataTypeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getMappingDataType_SourceTypeID() {
+ return (EAttribute)mappingDataTypeEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getParams() {
+ return paramsEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getParams_Param() {
+ return (EReference)paramsEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getParam() {
+ return paramEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getParam_Name() {
+ return (EAttribute)paramEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getParam_Value() {
+ return (EAttribute)paramEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphicalFactory getGraphicalFactory() {
+ return (GraphicalFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ graphInformationsEClass = createEClass(GRAPH_INFORMATIONS);
+ createEReference(graphInformationsEClass, GRAPH_INFORMATIONS__MAPPING_TYPE);
+ createEReference(graphInformationsEClass, GRAPH_INFORMATIONS__PARAMS);
+
+ mappingDataTypeEClass = createEClass(MAPPING_DATA_TYPE);
+ createEAttribute(mappingDataTypeEClass, MAPPING_DATA_TYPE__TARGET_TYPE_ID);
+ createEAttribute(mappingDataTypeEClass, MAPPING_DATA_TYPE__SOURCE_TYPE_ID);
+
+ paramsEClass = createEClass(PARAMS);
+ createEReference(paramsEClass, PARAMS__PARAM);
+
+ paramEClass = createEClass(PARAM);
+ createEAttribute(paramEClass, PARAM__NAME);
+ createEAttribute(paramEClass, PARAM__VALUE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents() {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(graphInformationsEClass, GraphInformations.class, "GraphInformations", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getGraphInformations_MappingType(), this.getMappingDataType(), null, "mappingType", null, 0, 1, GraphInformations.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getGraphInformations_Params(), this.getParams(), null, "params", null, 0, 1, GraphInformations.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(mappingDataTypeEClass, MappingDataType.class, "MappingDataType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getMappingDataType_TargetTypeID(), ecorePackage.getEString(), "targetTypeID", null, 0, 1, MappingDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getMappingDataType_SourceTypeID(), ecorePackage.getEString(), "sourceTypeID", null, 0, 1, MappingDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(paramsEClass, Params.class, "Params", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getParams_Param(), this.getParam(), null, "param", null, 0, -1, Params.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(paramEClass, Param.class, "Param", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getParam_Name(), ecorePackage.getEString(), "name", null, 0, 1, Param.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getParam_Value(), ecorePackage.getEString(), "value", null, 0, 1, Param.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //GraphicalPackageImpl
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalPackageImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/MappingDataTypeImpl.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/MappingDataTypeImpl.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/MappingDataTypeImpl.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,221 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.jboss.tools.smooks.graphical.GraphicalPackage;
+import org.jboss.tools.smooks.graphical.MappingDataType;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Mapping Data Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.impl.MappingDataTypeImpl#getTargetTypeID <em>Target Type ID</em>}</li>
+ * <li>{@link org.jboss.tools.smooks.graphical.impl.MappingDataTypeImpl#getSourceTypeID <em>Source Type ID</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class MappingDataTypeImpl extends EObjectImpl implements MappingDataType {
+ /**
+ * The default value of the '{@link #getTargetTypeID() <em>Target Type ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTargetTypeID()
+ * @generated
+ * @ordered
+ */
+ protected static final String TARGET_TYPE_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getTargetTypeID() <em>Target Type ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTargetTypeID()
+ * @generated
+ * @ordered
+ */
+ protected String targetTypeID = TARGET_TYPE_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getSourceTypeID() <em>Source Type ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSourceTypeID()
+ * @generated
+ * @ordered
+ */
+ protected static final String SOURCE_TYPE_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getSourceTypeID() <em>Source Type ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSourceTypeID()
+ * @generated
+ * @ordered
+ */
+ protected String sourceTypeID = SOURCE_TYPE_ID_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MappingDataTypeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return GraphicalPackage.Literals.MAPPING_DATA_TYPE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getTargetTypeID() {
+ return targetTypeID;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTargetTypeID(String newTargetTypeID) {
+ String oldTargetTypeID = targetTypeID;
+ targetTypeID = newTargetTypeID;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphicalPackage.MAPPING_DATA_TYPE__TARGET_TYPE_ID, oldTargetTypeID, targetTypeID));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getSourceTypeID() {
+ return sourceTypeID;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSourceTypeID(String newSourceTypeID) {
+ String oldSourceTypeID = sourceTypeID;
+ sourceTypeID = newSourceTypeID;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphicalPackage.MAPPING_DATA_TYPE__SOURCE_TYPE_ID, oldSourceTypeID, sourceTypeID));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case GraphicalPackage.MAPPING_DATA_TYPE__TARGET_TYPE_ID:
+ return getTargetTypeID();
+ case GraphicalPackage.MAPPING_DATA_TYPE__SOURCE_TYPE_ID:
+ return getSourceTypeID();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case GraphicalPackage.MAPPING_DATA_TYPE__TARGET_TYPE_ID:
+ setTargetTypeID((String)newValue);
+ return;
+ case GraphicalPackage.MAPPING_DATA_TYPE__SOURCE_TYPE_ID:
+ setSourceTypeID((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.MAPPING_DATA_TYPE__TARGET_TYPE_ID:
+ setTargetTypeID(TARGET_TYPE_ID_EDEFAULT);
+ return;
+ case GraphicalPackage.MAPPING_DATA_TYPE__SOURCE_TYPE_ID:
+ setSourceTypeID(SOURCE_TYPE_ID_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.MAPPING_DATA_TYPE__TARGET_TYPE_ID:
+ return TARGET_TYPE_ID_EDEFAULT == null ? targetTypeID != null : !TARGET_TYPE_ID_EDEFAULT.equals(targetTypeID);
+ case GraphicalPackage.MAPPING_DATA_TYPE__SOURCE_TYPE_ID:
+ return SOURCE_TYPE_ID_EDEFAULT == null ? sourceTypeID != null : !SOURCE_TYPE_ID_EDEFAULT.equals(sourceTypeID);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (targetTypeID: ");
+ result.append(targetTypeID);
+ result.append(", sourceTypeID: ");
+ result.append(sourceTypeID);
+ result.append(')');
+ return result.toString();
+ }
+
+} //MappingDataTypeImpl
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/MappingDataTypeImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamImpl.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamImpl.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamImpl.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,221 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.jboss.tools.smooks.graphical.GraphicalPackage;
+import org.jboss.tools.smooks.graphical.Param;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Param</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.impl.ParamImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.jboss.tools.smooks.graphical.impl.ParamImpl#getValue <em>Value</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ParamImpl extends EObjectImpl implements Param {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected static final String VALUE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected String value = VALUE_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ParamImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return GraphicalPackage.Literals.PARAM;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphicalPackage.PARAM__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setValue(String newValue) {
+ String oldValue = value;
+ value = newValue;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphicalPackage.PARAM__VALUE, oldValue, value));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case GraphicalPackage.PARAM__NAME:
+ return getName();
+ case GraphicalPackage.PARAM__VALUE:
+ return getValue();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case GraphicalPackage.PARAM__NAME:
+ setName((String)newValue);
+ return;
+ case GraphicalPackage.PARAM__VALUE:
+ setValue((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.PARAM__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case GraphicalPackage.PARAM__VALUE:
+ setValue(VALUE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.PARAM__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case GraphicalPackage.PARAM__VALUE:
+ return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(", value: ");
+ result.append(value);
+ result.append(')');
+ return result.toString();
+ }
+
+} //ParamImpl
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamsImpl.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamsImpl.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamsImpl.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,156 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+import org.jboss.tools.smooks.graphical.GraphicalPackage;
+import org.jboss.tools.smooks.graphical.Param;
+import org.jboss.tools.smooks.graphical.Params;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Params</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.impl.ParamsImpl#getParam <em>Param</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ParamsImpl extends EObjectImpl implements Params {
+ /**
+ * The cached value of the '{@link #getParam() <em>Param</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getParam()
+ * @generated
+ * @ordered
+ */
+ protected EList<Param> param;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ParamsImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return GraphicalPackage.Literals.PARAMS;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Param> getParam() {
+ if (param == null) {
+ param = new EObjectContainmentEList<Param>(Param.class, this, GraphicalPackage.PARAMS__PARAM);
+ }
+ return param;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GraphicalPackage.PARAMS__PARAM:
+ return ((InternalEList<?>)getParam()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case GraphicalPackage.PARAMS__PARAM:
+ return getParam();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case GraphicalPackage.PARAMS__PARAM:
+ getParam().clear();
+ getParam().addAll((Collection<? extends Param>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.PARAMS__PARAM:
+ getParam().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.PARAMS__PARAM:
+ return param != null && !param.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //ParamsImpl
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamsImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalAdapterFactory.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalAdapterFactory.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalAdapterFactory.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,178 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.jboss.tools.smooks.graphical.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage
+ * @generated
+ */
+public class GraphicalAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static GraphicalPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphicalAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = GraphicalPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch the delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GraphicalSwitch<Adapter> modelSwitch =
+ new GraphicalSwitch<Adapter>() {
+ @Override
+ public Adapter caseGraphInformations(GraphInformations object) {
+ return createGraphInformationsAdapter();
+ }
+ @Override
+ public Adapter caseMappingDataType(MappingDataType object) {
+ return createMappingDataTypeAdapter();
+ }
+ @Override
+ public Adapter caseParams(Params object) {
+ return createParamsAdapter();
+ }
+ @Override
+ public Adapter caseParam(Param object) {
+ return createParamAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.jboss.tools.smooks.graphical.GraphInformations <em>Graph Informations</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.jboss.tools.smooks.graphical.GraphInformations
+ * @generated
+ */
+ public Adapter createGraphInformationsAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.jboss.tools.smooks.graphical.MappingDataType <em>Mapping Data Type</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.jboss.tools.smooks.graphical.MappingDataType
+ * @generated
+ */
+ public Adapter createMappingDataTypeAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.jboss.tools.smooks.graphical.Params <em>Params</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.jboss.tools.smooks.graphical.Params
+ * @generated
+ */
+ public Adapter createParamsAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.jboss.tools.smooks.graphical.Param <em>Param</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.jboss.tools.smooks.graphical.Param
+ * @generated
+ */
+ public Adapter createParamAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //GraphicalAdapterFactory
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalAdapterFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalSwitch.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalSwitch.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalSwitch.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -0,0 +1,193 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical.util;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+
+import org.jboss.tools.smooks.graphical.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage
+ * @generated
+ */
+public class GraphicalSwitch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static GraphicalPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphicalSwitch() {
+ if (modelPackage == null) {
+ modelPackage = GraphicalPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ public T doSwitch(EObject theEObject) {
+ return doSwitch(theEObject.eClass(), theEObject);
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(EClass theEClass, EObject theEObject) {
+ if (theEClass.eContainer() == modelPackage) {
+ return doSwitch(theEClass.getClassifierID(), theEObject);
+ }
+ else {
+ List<EClass> eSuperTypes = theEClass.getESuperTypes();
+ return
+ eSuperTypes.isEmpty() ?
+ defaultCase(theEObject) :
+ doSwitch(eSuperTypes.get(0), theEObject);
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case GraphicalPackage.GRAPH_INFORMATIONS: {
+ GraphInformations graphInformations = (GraphInformations)theEObject;
+ T result = caseGraphInformations(graphInformations);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case GraphicalPackage.MAPPING_DATA_TYPE: {
+ MappingDataType mappingDataType = (MappingDataType)theEObject;
+ T result = caseMappingDataType(mappingDataType);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case GraphicalPackage.PARAMS: {
+ Params params = (Params)theEObject;
+ T result = caseParams(params);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case GraphicalPackage.PARAM: {
+ Param param = (Param)theEObject;
+ T result = caseParam(param);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Graph Informations</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Graph Informations</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseGraphInformations(GraphInformations object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Mapping Data Type</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Mapping Data Type</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseMappingDataType(MappingDataType object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Params</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Params</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseParams(Params object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Param</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Param</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseParam(Param object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //GraphicalSwitch
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalSwitch.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/tests/org.jboss.tools.smooks.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/smooks/tests/org.jboss.tools.smooks.test/META-INF/MANIFEST.MF 2008-10-20 07:59:03 UTC (rev 10956)
+++ trunk/smooks/tests/org.jboss.tools.smooks.test/META-INF/MANIFEST.MF 2008-10-20 08:08:29 UTC (rev 10957)
@@ -6,21 +6,18 @@
Bundle-Activator: org.jboss.tools.smooks.test.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.jboss.tools.smooks.graphicalInfo,
org.jboss.tools.smooks.javabean,
org.jboss.tools.smooks.model,
org.jboss.tools.smooks.model.edit,
org.jboss.tools.smooks.ui,
org.jboss.tools.smooks.xml,
- org.jboss.tools.smooks.xml2java,
org.junit,
org.eclipse.core.resources,
org.eclipse.xsd,
org.eclipse.xsd.edit,
org.eclipse.emf,
org.eclipse.emf.ecore.edit,
- org.eclipse.emf.edit.ui,
- org.jboss.tools.smooks.java2xml
+ org.eclipse.emf.edit.ui
Eclipse-LazyStart: true
Bundle-ClassPath: lib/dom4j-1.6.1.jar,
.
Modified: trunk/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java2java/SmooksAnalyzerTester.java
===================================================================
--- trunk/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java2java/SmooksAnalyzerTester.java 2008-10-20 07:59:03 UTC (rev 10956)
+++ trunk/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java2java/SmooksAnalyzerTester.java 2008-10-20 08:08:29 UTC (rev 10957)
@@ -1,145 +1,145 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.test.java2java;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.emf.common.command.BasicCommandStack;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EPackage.Registry;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.xmi.impl.XMLResourceFactoryImpl;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
-import org.jboss.tools.smooks.analyzer.MappingResourceConfigList;
-import org.jboss.tools.smooks.analyzer.NormalSmooksModelBuilder;
-import org.jboss.tools.smooks.analyzer.NormalSmooksModelPackage;
-import org.jboss.tools.smooks.analyzer.ResourceConfigEraser;
-import org.jboss.tools.smooks.graphical.GraphInformations;
-import org.jboss.tools.smooks.graphical.GraphicalPackage;
-import org.jboss.tools.smooks.javabean.analyzer.JavaBeanAnalyzer;
-import org.jboss.tools.smooks.model.DocumentRoot;
-import org.jboss.tools.smooks.model.SmooksPackage;
-import org.jboss.tools.smooks.model.SmooksResourceListType;
-import org.jboss.tools.smooks.model.provider.SmooksItemProviderAdapterFactory;
-import org.jboss.tools.smooks.model.util.SmooksResourceFactoryImpl;
-
-/**
- * @author Dart Peng Date : 2008-9-1
- */
-public class SmooksAnalyzerTester extends TestCase {
-
- private GraphInformations graph;
- private Resource resource;
- private ComposedAdapterFactory adapterFactory;
- private AdapterFactoryEditingDomain editingDomain;
- private Resource smooksResource;
- protected CommandStack createCommandStack() {
- return new BasicCommandStack();
- }
- public SmooksAnalyzerTester() throws IOException {
- super();
- adapterFactory = new ComposedAdapterFactory(
- ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
- adapterFactory
- .addAdapterFactory(new ResourceItemProviderAdapterFactory());
- adapterFactory
- .addAdapterFactory(new SmooksItemProviderAdapterFactory());
- editingDomain = new AdapterFactoryEditingDomain(adapterFactory,
- createCommandStack(), new HashMap<Resource, Boolean>());
-
-
- ClassLoader classLoader = SmooksAnalyzerTester.class.getClassLoader();
- Registry.INSTANCE.put(GraphicalPackage.eNS_URI,
- GraphicalPackage.eINSTANCE);
- Registry.INSTANCE.put(SmooksPackage.eNS_URI, SmooksPackage.eINSTANCE);
-
- resource = editingDomain.getResourceSet().createResource(null);
- Resource gr = new XMLResourceFactoryImpl().createResource(null);
- InputStream stream1 = classLoader
- .getResourceAsStream("org/jboss/tools/smooks/test/java2java/Test.xml");
- InputStream stream2 = classLoader
- .getResourceAsStream("org/jboss/tools/smooks/test/java2java/Test.smooks.graph");
- gr.load(stream2, Collections.EMPTY_MAP);
- graph = (GraphInformations) gr.getContents().get(0);
-
- resource.load(stream1, Collections.EMPTY_MAP);
- }
-
- public MappingResourceConfigList analyzeGraphical() {
- try {
- ClassLoader classLoader = SmooksAnalyzerTester.class
- .getClassLoader();
- JavaBeanAnalyzer sourceModelAnalyzer = new JavaBeanAnalyzer();
- JavaBeanAnalyzer targetModelAnalyzer = new JavaBeanAnalyzer();
- JavaBeanAnalyzer connectionsAnalyzer = new JavaBeanAnalyzer();
- SmooksResourceListType listType = ((DocumentRoot) resource
- .getContents().get(0)).getSmooksResourceList();
- Object source = sourceModelAnalyzer.buildSourceInputObjects(graph,
- listType, null, classLoader);
- Object target = targetModelAnalyzer.buildTargetInputObjects(graph,
- listType, null, classLoader);
- MappingResourceConfigList configList = connectionsAnalyzer
- .analyzeMappingSmooksModel(listType, source, target);
- List connections = configList.getMappingModelList();
- List relationgConnection = configList
- .getRelationgResourceConfigList();
- Assert.assertTrue(!connections.isEmpty());
- Assert.assertTrue(!relationgConnection.isEmpty());
- System.out.println(connections);
- return configList;
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public void eraserMappingResourceConfig() {
- ResourceConfigEraser eraser = new ResourceConfigEraser();
- SmooksResourceListType listType = ((DocumentRoot) resource
- .getContents().get(0)).getSmooksResourceList();
- int oldCount = listType.getAbstractResourceConfig().size();
- MappingResourceConfigList configList = analyzeGraphical();
- eraser.cleanMappingResourceConfig(listType, configList, null);
- int newCount = listType.getAbstractResourceConfig().size();
- Assert.assertTrue(oldCount >= newCount);
- }
-
- public void testEraser() {
- eraserMappingResourceConfig();
- }
-
- public void testAnalyzer() {
- MappingResourceConfigList configList = analyzeGraphical();
- }
-
- public void generateNormalInforPackage() {
- SmooksResourceListType listType = ((DocumentRoot) resource
- .getContents().get(0)).getSmooksResourceList();
- NormalSmooksModelPackage modePackage = NormalSmooksModelBuilder
- .getInstance().buildNormalSmooksModelPackage(listType);
-
- }
-
- public void testGenerateNormalInforPackage(){
- eraserMappingResourceConfig();
- generateNormalInforPackage();
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.test.java2java;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.ecore.EPackage.Registry;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.xmi.impl.XMLResourceFactoryImpl;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+import org.jboss.tools.smooks.analyzer.MappingResourceConfigList;
+import org.jboss.tools.smooks.analyzer.NormalSmooksModelBuilder;
+import org.jboss.tools.smooks.analyzer.NormalSmooksModelPackage;
+import org.jboss.tools.smooks.analyzer.ResourceConfigEraser;
+import org.jboss.tools.smooks.graphical.GraphInformations;
+import org.jboss.tools.smooks.graphical.GraphicalPackage;
+import org.jboss.tools.smooks.javabean.analyzer.JavaBeanAnalyzer;
+import org.jboss.tools.smooks.model.DocumentRoot;
+import org.jboss.tools.smooks.model.SmooksPackage;
+import org.jboss.tools.smooks.model.SmooksResourceListType;
+import org.jboss.tools.smooks.model.provider.SmooksItemProviderAdapterFactory;
+import org.jboss.tools.smooks.model.util.SmooksResourceFactoryImpl;
+
+/**
+ * @author Dart Peng Date : 2008-9-1
+ */
+public class SmooksAnalyzerTester extends TestCase {
+
+ private GraphInformations graph;
+ private Resource resource;
+ private ComposedAdapterFactory adapterFactory;
+ private AdapterFactoryEditingDomain editingDomain;
+ private Resource smooksResource;
+ protected CommandStack createCommandStack() {
+ return new BasicCommandStack();
+ }
+ public SmooksAnalyzerTester() throws IOException {
+// super();
+ adapterFactory = new ComposedAdapterFactory(
+ ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ adapterFactory
+ .addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory
+ .addAdapterFactory(new SmooksItemProviderAdapterFactory());
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory,
+ createCommandStack(), new HashMap<Resource, Boolean>());
+
+
+ ClassLoader classLoader = SmooksAnalyzerTester.class.getClassLoader();
+ Registry.INSTANCE.put(GraphicalPackage.eNS_URI,
+ GraphicalPackage.eINSTANCE);
+ Registry.INSTANCE.put(SmooksPackage.eNS_URI, SmooksPackage.eINSTANCE);
+
+ resource = new SmooksResourceFactoryImpl().createResource(null);
+ Resource gr = new XMLResourceFactoryImpl().createResource(null);
+ InputStream stream1 = classLoader
+ .getResourceAsStream("org/jboss/tools/smooks/test/java2java/Test.xml");
+ InputStream stream2 = classLoader
+ .getResourceAsStream("org/jboss/tools/smooks/test/java2java/Test.smooks.graph");
+ gr.load(stream2, Collections.EMPTY_MAP);
+ graph = (GraphInformations) gr.getContents().get(0);
+
+ resource.load(stream1, Collections.EMPTY_MAP);
+ }
+
+ public MappingResourceConfigList analyzeGraphical() {
+ try {
+ ClassLoader classLoader = SmooksAnalyzerTester.class
+ .getClassLoader();
+ JavaBeanAnalyzer sourceModelAnalyzer = new JavaBeanAnalyzer();
+ JavaBeanAnalyzer targetModelAnalyzer = new JavaBeanAnalyzer();
+ JavaBeanAnalyzer connectionsAnalyzer = new JavaBeanAnalyzer();
+ SmooksResourceListType listType = ((DocumentRoot) resource
+ .getContents().get(0)).getSmooksResourceList();
+ Object source = sourceModelAnalyzer.buildSourceInputObjects(graph,
+ listType, null, classLoader);
+ Object target = targetModelAnalyzer.buildTargetInputObjects(graph,
+ listType, null, classLoader);
+ MappingResourceConfigList configList = connectionsAnalyzer
+ .analyzeMappingSmooksModel(listType, source, target);
+ List connections = configList.getMappingModelList();
+ List relationgConnection = configList
+ .getRelationgResourceConfigList();
+ Assert.assertTrue(!connections.isEmpty());
+ Assert.assertTrue(!relationgConnection.isEmpty());
+ System.out.println(connections);
+ return configList;
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public void eraserMappingResourceConfig() {
+ ResourceConfigEraser eraser = new ResourceConfigEraser();
+ SmooksResourceListType listType = ((DocumentRoot) resource
+ .getContents().get(0)).getSmooksResourceList();
+ int oldCount = listType.getAbstractResourceConfig().size();
+ MappingResourceConfigList configList = analyzeGraphical();
+ eraser.cleanMappingResourceConfig(listType, configList, null);
+ int newCount = listType.getAbstractResourceConfig().size();
+ Assert.assertTrue(oldCount >= newCount);
+ }
+
+ public void testEraser() {
+ eraserMappingResourceConfig();
+ }
+
+ public void testAnalyzer() {
+ MappingResourceConfigList configList = analyzeGraphical();
+ }
+
+ public void generateNormalInforPackage() {
+ SmooksResourceListType listType = ((DocumentRoot) resource
+ .getContents().get(0)).getSmooksResourceList();
+ NormalSmooksModelPackage modePackage = NormalSmooksModelBuilder
+ .getInstance().buildNormalSmooksModelPackage(listType);
+
+ }
+
+ public void testGenerateNormalInforPackage(){
+ eraserMappingResourceConfig();
+ generateNormalInforPackage();
+ }
+}
16 years, 2 months
JBoss Tools SVN: r10956 - in branches/jbosstools-3.0.0.Beta1/smooks: plugins/org.jboss.tools.smooks.javabean and 17 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-20 03:59:03 -0400 (Mon, 20 Oct 2008)
New Revision: 10956
Added:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/libs/dom4j-1.6.1.jar
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/DOM2FreeMarkerTransformor.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/FreeMarkerContentReplacer.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/utils/
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/utils/XMLConstants.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphInformations.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalFactory.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalPackage.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/MappingDataType.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Param.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Params.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphInformationsImpl.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalFactoryImpl.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalPackageImpl.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/MappingDataTypeImpl.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamImpl.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamsImpl.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalAdapterFactory.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalSwitch.java
Modified:
branches/jbosstools-3.0.0.Beta1/smooks/features/org.jboss.tools.smooks.feature/feature.xml
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/.classpath
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF/MANIFEST.MF
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/build.properties
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/plugin.xml
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
branches/jbosstools-3.0.0.Beta1/smooks/tests/org.jboss.tools.smooks.test/META-INF/MANIFEST.MF
branches/jbosstools-3.0.0.Beta1/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java2java/SmooksAnalyzerTester.java
Log:
JBIDE-2835
1.org.jboss.tools.smooks.graphicalInfo merge into the org.jboss.tools.smooks.ui
2.org.jboss.tools.smooks.xml2java merge into the org.jboss.tools.smooks.javabean
3.org.jboss.tools.smooks.java2xml merge into the org.jboss,tools.smooks.javabean
Now there are 5 plugins for smooks tools :
javabean
xml
ui
model
model.edit
Modified: branches/jbosstools-3.0.0.Beta1/smooks/features/org.jboss.tools.smooks.feature/feature.xml
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/features/org.jboss.tools.smooks.feature/feature.xml 2008-10-18 22:02:22 UTC (rev 10955)
+++ branches/jbosstools-3.0.0.Beta1/smooks/features/org.jboss.tools.smooks.feature/feature.xml 2008-10-20 07:59:03 UTC (rev 10956)
@@ -1,25 +1,25 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.jboss.tools.smooks.feature"
- label="Smooks Tools"
- version="1.0.0"
- provider-name="JBoss, a division of Red Hat">
-
- <description url="http://www.example.com/description">
- Smooks Tools
- </description>
-
- <copyright url="http://www.example.com/copyright">
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.smooks.feature"
+ label="Smooks Tools"
+ version="1.0.0"
+ provider-name="JBoss, a division of Red Hat">
+
+ <description url="http://www.example.com/description">
+ Smooks Tools
+ </description>
+
+ <copyright url="http://www.example.com/copyright">
Copyright (c) 2008 Red Hat, Inc.
Distributed under license by Red Hat, Inc. All rights reserved.
This program is 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:
-Red Hat, Inc. - initial API and implementation
- </copyright>
-
- <license url="http://www.example.com/license">
+Red Hat, Inc. - initial API and implementation
+ </copyright>
+
+ <license url="http://www.example.com/license">
Eclipse Public License - v 1.0
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS
ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
@@ -215,63 +215,42 @@
No party to this Agreement will bring a legal action under this
Agreement more than one year after the cause of action arose.
Each party waives its rights to a jury trial in any resulting
-litigation.
- </license>
-
- <plugin
- id="org.jboss.tools.smooks.graphicalInfo"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.javabean"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.model"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.model.edit"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.xml"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.xml2java"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.smooks.java2xml"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
+litigation.
+ </license>
+
+ <plugin
+ id="org.jboss.tools.smooks.javabean"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.smooks.model"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.smooks.model.edit"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.smooks.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.smooks.xml"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/.classpath
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/.classpath 2008-10-18 22:02:22 UTC (rev 10955)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/.classpath 2008-10-20 07:59:03 UTC (rev 10956)
@@ -3,5 +3,6 @@
<classpathentry 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="lib" path="libs/dom4j-1.6.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF/MANIFEST.MF 2008-10-18 22:02:22 UTC (rev 10955)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF/MANIFEST.MF 2008-10-20 07:59:03 UTC (rev 10956)
@@ -17,11 +17,16 @@
org.jboss.tools.smooks.model,
org.jboss.tools.smooks.model.edit,
org.eclipse.ui.ide,
- org.jboss.tools.smooks.graphicalInfo
+ org.jboss.tools.smooks.xml;bundle-version="1.0.0"
Eclipse-LazyStart: true
-Export-Package: org.jboss.tools.smooks.javabean,
+Export-Package: org.jboss.tools.smooks.java2xml.analyzer,
+ org.jboss.tools.smooks.java2xml.utils,
+ org.jboss.tools.smooks.javabean,
org.jboss.tools.smooks.javabean.analyzer,
org.jboss.tools.smooks.javabean.commandprocessor,
org.jboss.tools.smooks.javabean.model,
- org.jboss.tools.smooks.javabean.ui
-Bundle-ClassPath: .
+ org.jboss.tools.smooks.javabean.ui,
+ org.jboss.tools.smooks.javabean.uitils,
+ org.jboss.tools.smooks.xml2java.analyzer
+Bundle-ClassPath: .,
+ libs/dom4j-1.6.1.jar
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/build.properties
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/build.properties 2008-10-18 22:02:22 UTC (rev 10955)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/build.properties 2008-10-20 07:59:03 UTC (rev 10956)
@@ -2,7 +2,8 @@
bin.includes = META-INF/,\
plugin.xml,\
icons/,\
- .
+ .,\
+ libs/dom4j-1.6.1.jar
jars.compile.order = smooks-javabean.jar
output.smooks-javabean.jar = bin/
src.includes = src/,\
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/libs/dom4j-1.6.1.jar
===================================================================
(Binary files differ)
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/libs/dom4j-1.6.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/plugin.xml
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/plugin.xml 2008-10-18 22:02:22 UTC (rev 10955)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/plugin.xml 2008-10-20 07:59:03 UTC (rev 10956)
@@ -36,4 +36,35 @@
typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
</targetModelAnalyzer>
</extension>
+
+ <extension
+ point="org.jboss.tools.smooks.ui.analyzer">
+ <mappingAnalyzer
+ class="org.jboss.tools.smooks.java2xml.analyzer.Java2XMLAnalyzer"
+ name="Java Bean"
+ typeID="org.jboss.tools.smooks.ui.viewerInitor.javabean">
+ <targetSourceType
+ id="org.jboss.tools.smooks.xml.viewerInitor.xml"
+ name="XML">
+ </targetSourceType>
+ </mappingAnalyzer>
+ </extension>
+
+ <extension
+ point="org.jboss.tools.smooks.ui.analyzer">
+ <mappingAnalyzer
+ class="org.jboss.tools.smooks.xml2java.analyzer.XML2JavaAnalyzer"
+ name="XML2Java"
+ typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
+ <targetSourceType
+ id="org.jboss.tools.smooks.ui.viewerInitor.javabean"
+ name="JavaBean">
+ </targetSourceType>
+ </mappingAnalyzer>
+ <sourceModelAnalyzer
+ class="org.jboss.tools.smooks.xml2java.analyzer.XMLSourceModelAnalyzer"
+ name="XML"
+ typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
+ </sourceModelAnalyzer>
+ </extension>
</plugin>
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/DOM2FreeMarkerTransformor.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/DOM2FreeMarkerTransformor.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/DOM2FreeMarkerTransformor.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.java2xml.analyzer;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.dom4j.Attribute;
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.jboss.tools.smooks.java2xml.utils.XMLConstants;
+
+/**
+ * @author Dart Peng
+ * @Date : Sep 25, 2008
+ */
+public class DOM2FreeMarkerTransformor {
+
+ public String transformDOM(Document document) {
+ Element element = document.getRootElement();
+ StringBuffer buffer = new StringBuffer();
+ transform(element, buffer);
+ return buffer.toString();
+ }
+
+ protected void transform(Element element, StringBuffer buffer) {
+ String name = element.getName();
+ if (XMLConstants.REPLACE_FREEMARKER_FOR_EXPRESS_ELEMENT_NAME
+ .equals(name)) {
+ String desc = element
+ .attributeValue(XMLConstants.REPLACE_FREEMARKER_FOR_EXPRESS_ELEMENT_ATTRIBUTE);
+ name = "#" + desc;
+ }
+ String attributesString = "";
+ if(!isFreeMarkerExpression(name)){
+ attributesString = buildAttributeString(element);
+ }
+ List children = element.elements();
+ if (children.isEmpty()) {
+ buffer.append("<" + name + " " +attributesString + "/>");
+ return;
+ } else {
+ buffer.append("<" + name + " " +attributesString + "/>");
+ for (Iterator iterator = children.iterator(); iterator.hasNext();) {
+ Element child = (Element) iterator.next();
+ transform(child, buffer);
+ }
+ if(isFreeMarkerExpression(name)){
+ name = name.trim();
+ int index = name.indexOf(" ");
+ if(index != -1){
+ name = name.substring(0,index);
+ }
+ }
+ buffer.append("</" + name + ">");
+ }
+ }
+
+ private String buildAttributeString(Element element) {
+ List list = element.attributes();
+ StringBuffer buffer = new StringBuffer("");
+ for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+ Attribute att = (Attribute) iterator.next();
+ String name = att.getName();
+ String value = att.getValue();
+ if(value == null) value = "";
+ if(name != null){
+ buffer.append(name);
+ buffer.append("=");
+ buffer.append("\"");
+ buffer.append(value);
+ buffer.append("\"");
+ buffer.append(" ");
+ }
+ }
+ return buffer.toString();
+ }
+
+ private boolean isFreeMarkerExpression(String str){
+ return str.startsWith("#");
+ }
+
+}
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/DOM2FreeMarkerTransformor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/FreeMarkerContentReplacer.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/FreeMarkerContentReplacer.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/FreeMarkerContentReplacer.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.java2xml.analyzer;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+
+/**
+ * @author Dart Peng
+ * @Date : Sep 25, 2008
+ */
+public class FreeMarkerContentReplacer {
+
+ public String replaceFreeMarkerTemplate(Reader reader) throws IOException {
+ StringBuffer buffer = new StringBuffer();
+// Configuration fmConfiguration = new Configuration();
+// fmConfiguration.setTagSyntax(Configuration.AUTO_DETECT_TAG_SYNTAX);
+//
+// Template template;
+// template = new Template("XML2Java_FreeMarker", reader, fmConfiguration);
+// TemplateElement root = template.getRootTreeNode();
+// visitTemplateElement(root, buffer);
+ return buffer.toString();
+ }
+
+ public String replaceFreeMarkerTemplate(String templateContents)
+ throws IOException {
+ Reader reader = new StringReader(templateContents);
+ return replaceFreeMarkerTemplate(reader);
+ }
+
+// private void visitTemplateElement(TemplateElement model, StringBuffer buffer) {
+
+// Enumeration children = ((TemplateElement) model).children();
+// if (!"MixedContent".equals(model.getNodeName())) {
+// buffer
+// .append("<"
+// + XMLConstants.REPLACE_FREEMARKER_FOR_EXPRESS_ELEMENT_NAME
+// + " "
+// + XMLConstants.REPLACE_FREEMARKER_FOR_EXPRESS_ELEMENT_ATTRIBUTE
+// + "= \"" + model.getDescription() + "\">");
+// }
+// while (children.hasMoreElements()) {
+// Object obj = children.nextElement();
+// if (!(obj instanceof TextBlock)) {
+// TemplateElement child = (TemplateElement) obj;
+// String str = child.getSource();
+// if (child.isLeaf()) {
+// if (child.getNodeName().equals("DollarVariable")) {
+// buffer.append(child.getSource());
+// } else {
+// buffer.append(child.getDescription());
+// }
+// continue;
+// }
+// visitTemplateElement(child, buffer);
+// } else {
+// buffer.append(obj);
+// }
+// }
+// if (!"MixedContent".equals(model.getNodeName())) {
+// buffer.append("</"
+// + XMLConstants.REPLACE_FREEMARKER_FOR_EXPRESS_ELEMENT_NAME
+// + ">");
+// }
+// }
+}
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/FreeMarkerContentReplacer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.java2xml.analyzer;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.smooks.analyzer.AbstractAnalyzer;
+import org.jboss.tools.smooks.analyzer.DesignTimeAnalyzeResult;
+import org.jboss.tools.smooks.analyzer.MappingResourceConfigList;
+import org.jboss.tools.smooks.analyzer.SmooksAnalyzerException;
+import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
+import org.jboss.tools.smooks.model.ParamType;
+import org.jboss.tools.smooks.model.ResourceConfigType;
+import org.jboss.tools.smooks.model.SmooksFactory;
+import org.jboss.tools.smooks.model.SmooksResourceListType;
+import org.jboss.tools.smooks.model.util.SmooksModelUtils;
+import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataModel;
+import org.jboss.tools.smooks.ui.gef.model.GraphRootModel;
+import org.jboss.tools.smooks.ui.gef.model.LineConnectionModel;
+import org.jboss.tools.smooks.ui.gef.model.SourceModel;
+import org.jboss.tools.smooks.ui.gef.model.TargetModel;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
+import org.jboss.tools.smooks.utils.UIUtils;
+import org.jboss.tools.smooks.xml.model.AbstractXMLObject;
+import org.jboss.tools.smooks.xml.model.DocumentObject;
+import org.jboss.tools.smooks.xml.model.TagObject;
+import org.jboss.tools.smooks.xml.model.TagPropertyObject;
+
+/**
+ *
+ * @author <a href="mailto:dpeng@redhat.com">Dart Peng</a>
+ * @Date 2008-9-22
+ */
+public class Java2XMLAnalyzer extends AbstractAnalyzer {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.smooks.analyzer.IMappingAnalyzer#analyzeMappingGraphModel(org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext)
+ */
+ public void analyzeMappingGraphModel(
+ SmooksConfigurationFileGenerateContext context)
+ throws SmooksAnalyzerException {
+ // TODO will modify soon
+
+ if(true){
+ Shell shell = context.getShell();
+ MessageDialog.openWarning(shell, "Warning", "The java2xml can't be generate to config file currently.");
+ return;
+ }
+
+ GraphRootModel rootModel = context.getGraphicalRootModel();
+ List<SourceModel> sourceModelList = rootModel.loadSourceModelList();
+ List<TargetModel> targetModelList = rootModel.loadTargetModelList();
+
+ // Element rootElement = DocumentHelper.createElement(name);
+ TagObject root = null;
+ for (Iterator iterator = targetModelList.iterator(); iterator.hasNext();) {
+ TargetModel targetModel = (TargetModel) iterator.next();
+ AbstractXMLObject tag = (AbstractXMLObject) targetModel
+ .getReferenceEntityModel();
+ root = findTheRootTagObject(tag);
+ break;
+ }
+
+ if (root == null)
+ throw new SmooksAnalyzerException("can't find the root element");
+ Document document = DocumentHelper.createDocument();
+ Element rootElement = generateXMLContents(rootModel, root);
+ document.setRootElement(rootElement);
+
+ String string = document.asXML();
+
+ ResourceConfigType resource = SmooksFactory.eINSTANCE
+ .createResourceConfigType();
+ ParamType param = SmooksFactory.eINSTANCE.createParamType();
+ resource.getParam().add(param);
+ SmooksModelUtils.appendTextToSmooksType(param, string);
+ context.getGeneratorResourceList().add(resource);
+ System.out.println(string);
+ }
+
+ protected Element generateXMLContents(GraphRootModel graph, TagObject tag) {
+ Element element = DocumentHelper.createElement(tag.getName());
+ AbstractStructuredDataModel dataModel = UIUtils.findGraphModel(graph,
+ tag);
+ generateElementAttribute(graph, element, tag.getProperties());
+ List children = tag.getChildren();
+ for (Iterator iterator = children.iterator(); iterator.hasNext();) {
+ TagObject child = (TagObject) iterator.next();
+ element.add(generateXMLContents(graph, child));
+ }
+
+ if (dataModel != null) {
+ LineConnectionModel connection = UIUtils
+ .getFirstTargetModelViaConnection(dataModel);
+ if (connection != null) {
+ SourceModel source = (SourceModel) connection.getSource();
+ element
+ .add(DocumentHelper
+ .createCDATA(getTheJavaBeanString((JavaBeanModel) source
+ .getReferenceEntityModel())));
+ }
+ }
+
+ return element;
+ }
+
+ protected void generateElementAttribute(GraphRootModel graph,
+ Element element, List<TagPropertyObject> properties) {
+ for (Iterator iterator = properties.iterator(); iterator.hasNext();) {
+ TagPropertyObject tagPropertyObject = (TagPropertyObject) iterator
+ .next();
+
+ AbstractStructuredDataModel dataModel = UIUtils.findGraphModel(
+ graph, tagPropertyObject);
+ LineConnectionModel connect = UIUtils
+ .getFirstTargetModelViaConnection(dataModel);
+ if (connect == null)
+ continue;
+
+ SourceModel source = (SourceModel) connect.getSource();
+
+ element.addAttribute(tagPropertyObject.getName(),
+ getTheJavaBeanString((JavaBeanModel) source
+ .getReferenceEntityModel()));
+ }
+ }
+
+ protected TagObject findTheRootTagObject(AbstractXMLObject obj) {
+ AbstractXMLObject parent = obj.getParent();
+ if (parent instanceof DocumentObject && obj instanceof TagObject)
+ return (TagObject) obj;
+ return (TagObject) findTheRootTagObject(parent);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.smooks.analyzer.IMappingAnalyzer#analyzeMappingSmooksModel(org.jboss.tools.smooks.model.SmooksResourceListType,
+ * java.lang.Object, java.lang.Object)
+ */
+ public MappingResourceConfigList analyzeMappingSmooksModel(
+ SmooksResourceListType listType, Object sourceObject,
+ Object targetObject) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ protected String getTheJavaBeanString(JavaBeanModel currentModel) {
+ String name = currentModel.getName();
+ JavaBeanModel parent = currentModel.getParent();
+ while (parent != null ) {
+ String pn = parent.getName();
+ if (pn != null) {
+ name = parent.getName() + "." + name;
+ }
+ parent = parent.getParent();
+ }
+ return "${" + name + "}";
+ }
+
+ public DesignTimeAnalyzeResult analyzeGraphModel(
+ SmooksConfigurationFileGenerateContext context) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/utils/XMLConstants.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/utils/XMLConstants.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/utils/XMLConstants.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.java2xml.utils;
+
+/**
+ * @author Dart Peng
+ * @Date : Sep 25, 2008
+ */
+public class XMLConstants {
+ public static final String REPLACE_FREEMARKER_FOR_EXPRESS_ELEMENT_NAME = "replaceElementNameForFreeMarker";
+
+ public static final String REPLACE_FREEMARKER_FOR_EXPRESS_ELEMENT_ATTRIBUTE = "desc";
+
+}
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/java2xml/utils/XMLConstants.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-18 22:02:22 UTC (rev 10955)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -350,6 +350,9 @@
AbstractStructuredDataModel sourceModel) {
JavaBeanModel source = (JavaBeanModel) sourceModel
.getReferenceEntityModel();
+ if(source.getBeanClass().isArray()){
+ return source.getName();
+ }
if (Collection.class.isAssignableFrom(source.getBeanClass())) {
return source.getName();
}
@@ -538,7 +541,7 @@
}
String beanClass = SmooksModelUtils.getParmaText(
"beanClass", rc);
- if (targetName.equals(beanClass)) {
+ if (targetName!=null && targetName.trim().equals(beanClass)) {
setSelectorIsUsed(sourceName);
// create the first connection
mappingModelList.add(new MappingModel(source, target));
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java 2008-10-18 22:02:22 UTC (rev 10955)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -227,6 +227,7 @@
Class beanType = beanClass.getComponentType();
setMany(true);
componentClass = beanType;
+ setGenericType(true);
}
return many;
}
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,396 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.xml2java.analyzer;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.text.html.HTMLDocument.HTMLReader.TagAction;
+
+import org.eclipse.emf.ecore.xml.type.AnyType;
+import org.jboss.tools.smooks.analyzer.AbstractAnalyzer;
+import org.jboss.tools.smooks.analyzer.DesignTimeAnalyzeResult;
+import org.jboss.tools.smooks.analyzer.MappingModel;
+import org.jboss.tools.smooks.analyzer.MappingResourceConfigList;
+import org.jboss.tools.smooks.analyzer.SmooksAnalyzerException;
+import org.jboss.tools.smooks.javabean.analyzer.JavaBeanAnalyzer;
+import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
+import org.jboss.tools.smooks.model.ParamType;
+import org.jboss.tools.smooks.model.ResourceConfigType;
+import org.jboss.tools.smooks.model.ResourceType;
+import org.jboss.tools.smooks.model.SmooksFactory;
+import org.jboss.tools.smooks.model.SmooksResourceListType;
+import org.jboss.tools.smooks.model.util.SmooksModelConstants;
+import org.jboss.tools.smooks.model.util.SmooksModelUtils;
+import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataModel;
+import org.jboss.tools.smooks.ui.gef.model.GraphRootModel;
+import org.jboss.tools.smooks.ui.gef.model.IConnectableModel;
+import org.jboss.tools.smooks.ui.gef.model.LineConnectionModel;
+import org.jboss.tools.smooks.ui.gef.model.SourceModel;
+import org.jboss.tools.smooks.ui.gef.model.TreeItemRelationModel;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
+import org.jboss.tools.smooks.utils.UIUtils;
+import org.jboss.tools.smooks.xml.model.AbstractXMLObject;
+import org.jboss.tools.smooks.xml.model.TagObject;
+import org.jboss.tools.smooks.xml.model.TagPropertyObject;
+
+/**
+ * @author Dart Peng
+ * @Date Aug 20, 2008
+ */
+public class XML2JavaAnalyzer extends AbstractAnalyzer {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.smooks.analyzer.IAnalyzer#analyzeMappingGraphModel(org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext)
+ */
+ public void analyzeMappingGraphModel(
+ SmooksConfigurationFileGenerateContext context)
+ throws SmooksAnalyzerException {
+
+ SmooksResourceListType listType = context.getSmooksResourceListModel();
+ GraphRootModel rootModel = context.getGraphicalRootModel();
+ List children = rootModel.getChildren();
+ for (Iterator iterator = children.iterator(); iterator.hasNext();) {
+ TreeItemRelationModel dataModel = (TreeItemRelationModel) iterator
+ .next();
+ if (dataModel.getClass() == SourceModel.class) {
+ List sourceConnections = dataModel.getModelSourceConnections();
+ if (sourceConnections.isEmpty())
+ continue;
+ processSourceConnections(sourceConnections, context, listType,
+ (SourceModel) dataModel);
+ }
+ }
+ }
+
+ protected void processSourceConnections(List sourceConnections,
+ SmooksConfigurationFileGenerateContext context,
+ SmooksResourceListType listType, SourceModel sourceModel) {
+ for (Iterator iterator = sourceConnections.iterator(); iterator
+ .hasNext();) {
+ LineConnectionModel connection = (LineConnectionModel) iterator
+ .next();
+ processLineConnection(connection, context, listType, sourceModel,
+ null);
+ }
+ }
+
+ protected void processLineConnection(LineConnectionModel connection,
+ SmooksConfigurationFileGenerateContext context,
+ SmooksResourceListType listType, SourceModel sourceModel,
+ String beanID) {
+ if (this.connectionIsUsed(connection))
+ return;
+ setConnectionUsed(connection);
+ IConnectableModel sourceg = connection.getSource();
+ if (sourceg != sourceModel)
+ return;
+ IConnectableModel targetg = connection.getTarget();
+ AbstractXMLObject source = (AbstractXMLObject) sourceModel
+ .getReferenceEntityModel();
+ JavaBeanModel target = (JavaBeanModel) ((AbstractStructuredDataModel) targetg)
+ .getReferenceEntityModel();
+ ResourceConfigType resourceConfigType = SmooksFactory.eINSTANCE
+ .createResourceConfigType();
+ context.getGeneratorResourceList().add(resourceConfigType);
+ // addResourceConfigType(listType, resourceConfigType);
+ // set the selector string value
+ resourceConfigType.setSelector(source.getName());
+ // create a resource and add it to resourceConfig
+ ResourceType resourceType = SmooksFactory.eINSTANCE
+ .createResourceType();
+ resourceType.setValue(SmooksModelConstants.BEAN_POPULATOR);
+ resourceConfigType.setResource(resourceType);
+
+ // create param for resourceConfig
+ if (beanID == null) {
+ beanID = getBeanID(target);
+ } else {
+ if (beanID.startsWith("${") && beanID.endsWith("}")) {
+ beanID = beanID.substring(2, beanID.length() - 1);
+ }
+ }
+
+ addParamTypeToResourceConfig(resourceConfigType,
+ SmooksModelConstants.BEAN_ID, beanID);
+
+ // add beanClass param
+ addParamTypeToResourceConfig(resourceConfigType,
+ SmooksModelConstants.BEAN_CLASS, target.getBeanClassString());
+
+ // add bindings param
+ ParamType bindingsParam = addParamTypeToResourceConfig(
+ resourceConfigType, SmooksModelConstants.BINDINGS, null);
+ processBindingsParam(bindingsParam, target, source, context, listType);
+ //
+ }
+
+ protected void processBindingsParam(ParamType bindingsParam,
+ JavaBeanModel javaBean, AbstractXMLObject source,
+ SmooksConfigurationFileGenerateContext context,
+ SmooksResourceListType listType) {
+ List properties = javaBean.getProperties();
+ for (Iterator iterator = properties.iterator(); iterator.hasNext();) {
+ boolean isComplex = true;
+ JavaBeanModel child = (JavaBeanModel) iterator.next();
+ AbstractStructuredDataModel graphModel = UIUtils.findGraphModel(
+ context.getGraphicalRootModel(), child);
+ LineConnectionModel connection = UIUtils
+ .getFirstTargetModelViaConnection(graphModel);
+ if (connection == null)
+ continue;
+ AbstractStructuredDataModel sourceModel = (AbstractStructuredDataModel) connection
+ .getSource();
+
+ if (child.isPrimitive() || child.getProperties().isEmpty()) {
+ isComplex = false;
+ }
+
+ String selector = getSelectorID(child);
+ if (!isComplex) {
+ selector = getSelectorIDViaXMLObject(
+ (AbstractXMLObject) sourceModel
+ .getReferenceEntityModel(), source);
+ }
+ SmooksModelUtils.addBindingTypeToParamType(bindingsParam, child
+ .getName(), selector, null, null);
+ if (isComplex) {
+ processLineConnection(connection, context, listType,
+ (SourceModel) sourceModel, selector);
+ } else {
+ setConnectionUsed(connection);
+ continue;
+ }
+ }
+ }
+
+ protected String getSelectorIDViaXMLObject(AbstractXMLObject sourceModel,
+ AbstractXMLObject currentRoot) {
+ String name = sourceModel.getName();
+ if (sourceModel instanceof TagPropertyObject) {
+ name = "@" + name;
+ }
+ AbstractXMLObject parent = sourceModel.getParent();
+ while (parent != null && parent.getName() != null) {
+ name = parent.getName() + " " + name;
+ if (parent == currentRoot)
+ break;
+ parent = parent.getParent();
+ }
+ return name;
+ }
+
+ private String getSelectorID(JavaBeanModel javaBean) {
+ String selectorName = javaBean.getName();
+ return "${" + selectorName + "}";
+ }
+
+ protected String getBeanID(JavaBeanModel target) {
+ return target.getName();
+ }
+
+ public MappingResourceConfigList analyzeMappingSmooksModel(
+ SmooksResourceListType listType, Object sourceObject,
+ Object targetObject) {
+ if(targetObject instanceof List){
+ targetObject = (JavaBeanModel) ((List)targetObject).get(0);
+ }
+ if (!(sourceObject instanceof AbstractXMLObject)
+ || !(targetObject instanceof JavaBeanModel)) {
+ return MappingResourceConfigList.createEmptyList();
+ }
+ AbstractXMLObject sourceRoot = (AbstractXMLObject) sourceObject;
+ JavaBeanModel sourceTarget = (JavaBeanModel) targetObject;
+
+ ResourceConfigType rootResourceConfig = findFirstMappingResourceConfig(listType);
+ String xmlName = rootResourceConfig.getSelector();
+ AbstractXMLObject source = findXMLObjectByName(xmlName, sourceRoot);
+ if (source == null)
+ return MappingResourceConfigList.createEmptyList();
+
+ MappingResourceConfigList rcl = new MappingResourceConfigList();
+ this.createMappingResourceConfigList(rcl, listType, rootResourceConfig,
+ source, sourceTarget);
+ return rcl;
+ }
+
+ public static AbstractXMLObject findXMLObjectByName(String selector,
+ AbstractXMLObject root) {
+ if (selector == null)
+ return null;
+ if (selector.equals(root.getName())) {
+ return root;
+ }
+ if (root instanceof TagObject) {
+ List properties = ((TagObject) root).getProperties();
+ for (Iterator iterator = properties.iterator(); iterator.hasNext();) {
+ TagPropertyObject pro = (TagPropertyObject) iterator.next();
+ if (selector.equals(pro.getName()))
+ return pro;
+ }
+ List<AbstractXMLObject> tags = ((TagObject) root).getChildren();
+ for (Iterator iterator = tags.iterator(); iterator.hasNext();) {
+ AbstractXMLObject tagChild = (AbstractXMLObject) iterator
+ .next();
+ AbstractXMLObject result = findXMLObjectByName(selector,
+ tagChild);
+ if (result != null)
+ return result;
+ }
+ }
+ return null;
+
+ }
+
+ protected void createMappingResourceConfigList(
+ MappingResourceConfigList configList, SmooksResourceListType list,
+ ResourceConfigType config, AbstractXMLObject sourceRoot,
+ JavaBeanModel targetJavaBean) {
+ String selector = config.getSelector();
+ String beanID = SmooksModelUtils.getParmaText(
+ SmooksModelConstants.BEAN_ID, config);
+ String beanClass = SmooksModelUtils.getParmaText(
+ SmooksModelConstants.BEAN_CLASS, config);
+
+ MappingModel mapping = new MappingModel(sourceRoot, targetJavaBean);
+ configList.getMappingModelList().add(mapping);
+ configList.addResourceConfig(config);
+ this.setSelectorIsUsed(config.getSelector());
+
+ List<ParamType> paramList = config.getParam();
+ ParamType bindingParam = null;
+ for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
+ ParamType paramType = (ParamType) iterator.next();
+ String name = paramType.getName();
+ if (SmooksModelConstants.BINDINGS.equals(name)) {
+ bindingParam = paramType;
+ break;
+ }
+ }
+
+ if (bindingParam != null) {
+ List bindings = (List) bindingParam.getMixed().get(
+ SmooksModelUtils.ELEMENT_BINDING, true);
+ if (bindings != null) {
+ for (Iterator iterator = bindings.iterator(); iterator
+ .hasNext();) {
+ AnyType binding = (AnyType) iterator.next();
+ String property = SmooksModelUtils
+ .getAttributeValueFromAnyType(binding,
+ SmooksModelUtils.ATTRIBUTE_PROPERTY);
+ String selectorStr = SmooksModelUtils
+ .getAttributeValueFromAnyType(binding,
+ SmooksModelUtils.ATTRIBUTE_SELECTOR);
+ JavaBeanModel childBean = JavaBeanAnalyzer
+ .findTheChildJavaBeanModel(property, targetJavaBean);
+ processXMLSelector(configList, config, sourceRoot,
+ childBean, list, selectorStr);
+ }
+ }
+ }
+ }
+
+ protected void processXMLSelector(MappingResourceConfigList configList,
+ ResourceConfigType resourceConfig, AbstractXMLObject root,
+ JavaBeanModel targetBean, SmooksResourceListType listType,
+ String selector) {
+ if (isReferenceSelector(selector)) {
+ ResourceConfigType resourceConfig1 = this
+ .findResourceConfigTypeWithSelector(selector, listType);
+ String newSelector = resourceConfig1.getSelector();
+ if (newSelector == null)
+ return;
+ AbstractXMLObject newRoot = findXMLObjectByName(newSelector, root);
+ createMappingResourceConfigList(configList, listType,
+ resourceConfig1, newRoot, targetBean);
+ } else {
+ AbstractXMLObject source = findXMLObjectWithSelectorString(
+ selector, root);
+ if (source != null) {
+ MappingModel mapping = new MappingModel(source, targetBean);
+ configList.getMappingModelList().add(mapping);
+ configList.addResourceConfig(resourceConfig);
+ this.setSelectorIsUsed(selector);
+ }
+ }
+ }
+
+ public static AbstractXMLObject findXMLObjectWithSelectorString(
+ String selector, AbstractXMLObject parent) {
+ if (selector == null)
+ return null;
+ selector = selector.trim();
+ String[] names = selector.split(" ");
+ if (names == null)
+ return null;
+ AbstractXMLObject current = parent;
+ for (int i = 0; i < names.length; i++) {
+ String name = names[i].trim();
+ if (current instanceof TagObject && isXMLAttributeObject(name)) {
+ List properties = ((TagObject) current).getProperties();
+ name = name.substring(1);
+ for (Iterator iterator = properties.iterator(); iterator
+ .hasNext();) {
+ TagPropertyObject property = (TagPropertyObject) iterator
+ .next();
+ if (name.equals(property.getName())) {
+ current = property;
+ }
+ }
+ } else {
+ List list = parent.getChildren();
+ for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+ AbstractXMLObject child = (AbstractXMLObject) iterator
+ .next();
+ if (name.equals(child.getName())) {
+ current = child;
+ break;
+ }
+ }
+ }
+ }
+ if (current == parent)
+ return null;
+ return current;
+ }
+
+ public static boolean isXMLAttributeObject(String name) {
+ if (name != null && name.startsWith("@"))
+ return true;
+ return false;
+ }
+
+ private ResourceConfigType findFirstMappingResourceConfig(
+ SmooksResourceListType listType) {
+ List list = listType.getAbstractResourceConfig();
+ for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+ ResourceConfigType resource = (ResourceConfigType) iterator.next();
+ ResourceType rt = resource.getResource();
+ if (rt == null)
+ continue;
+ String value = rt.getValue();
+ if (SmooksModelConstants.BEAN_POPULATOR.equals(value)) {
+ return resource;
+ }
+ }
+ return null;
+ }
+
+ public DesignTimeAnalyzeResult analyzeGraphModel(
+ SmooksConfigurationFileGenerateContext context) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.xml2java.analyzer;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.dom4j.DocumentException;
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.smooks.analyzer.ISourceModelAnalyzer;
+import org.jboss.tools.smooks.graphical.GraphInformations;
+import org.jboss.tools.smooks.graphical.Param;
+import org.jboss.tools.smooks.graphical.Params;
+import org.jboss.tools.smooks.model.SmooksResourceListType;
+import org.jboss.tools.smooks.xml.model.AbstractXMLObject;
+import org.jboss.tools.smooks.xml.model.DocumentObject;
+import org.jboss.tools.smooks.xml.model.XMLObjectAnalyzer;
+
+/**
+ * @author Dart Peng<br>
+ * Date : Sep 23, 2008
+ */
+public class XMLSourceModelAnalyzer implements ISourceModelAnalyzer {
+
+ public static final String XML_FILE = "xmlFile";
+
+ public Object buildSourceInputObjects(GraphInformations graphInfo,
+ SmooksResourceListType listType, IFile sourceFile)
+ throws InvocationTargetException {
+ Params params = graphInfo.getParams();
+ String path = null;
+ if (params != null) {
+ List<Param> paramList = graphInfo.getParams().getParam();
+ for (Iterator<Param> iterator = paramList.iterator(); iterator
+ .hasNext();) {
+ Param param = (Param) iterator.next();
+ if (param.getName().equals(XML_FILE)) {
+ path = param.getValue();
+ break;
+ }
+ }
+ }
+ if (path == null) {
+ // TODO tell user the filepath can't find or not ?
+ return null;
+// throw new InvocationTargetException(new Exception(
+// "xml file path can't find in the graphInfo file"));
+ }
+ XMLObjectAnalyzer objectBuilder = new XMLObjectAnalyzer();
+ try {
+ FileInputStream stream = new FileInputStream(path);
+ DocumentObject document = objectBuilder.analyze(stream);
+ return document;
+ } catch (FileNotFoundException e) {
+ throw new InvocationTargetException(e);
+ } catch (DocumentException e) {
+ throw new InvocationTargetException(e);
+ }
+ }
+}
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2008-10-18 22:02:22 UTC (rev 10955)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2008-10-20 07:59:03 UTC (rev 10956)
@@ -20,7 +20,6 @@
org.eclipse.emf,
org.eclipse.emf.edit,
org.jboss.tools.smooks.model.edit,
- org.jboss.tools.smooks.graphicalInfo,
org.eclipse.ui.views.properties.tabbed,
org.eclipse.emf.edit.ui
Bundle-ActivationPolicy: lazy
@@ -28,6 +27,9 @@
Bundle-ClassPath: .
Bundle-Vendor: JBoss
Export-Package: org.jboss.tools.smooks.analyzer,
+ org.jboss.tools.smooks.graphical,
+ org.jboss.tools.smooks.graphical.impl,
+ org.jboss.tools.smooks.graphical.util,
org.jboss.tools.smooks.ui,
org.jboss.tools.smooks.ui.editors,
org.jboss.tools.smooks.ui.gef,
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2008-10-18 22:02:22 UTC (rev 10955)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2008-10-20 07:59:03 UTC (rev 10956)
@@ -3,6 +3,12 @@
<plugin>
<extension-point id="viewerInitor" name="viewerInitor" schema="schema/viewerInitor.exsd"/>
<extension-point id="analyzer" name="analyzer" schema="schema/analyzer.exsd"/>
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <package
+ uri = "http://www.jboss.org/tools/smooks/graphicalInformation"
+ class = "org.jboss.tools.smooks.graphical.GraphicalPackage"
+ genModel = "model/graphical.genmodel" />
+ </extension>
<extension
point="org.eclipse.ui.editors">
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphInformations.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphInformations.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphInformations.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,81 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Graph Informations</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.GraphInformations#getMappingType <em>Mapping Type</em>}</li>
+ * <li>{@link org.jboss.tools.smooks.graphical.GraphInformations#getParams <em>Params</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getGraphInformations()
+ * @model
+ * @generated
+ */
+public interface GraphInformations extends EObject {
+ /**
+ * Returns the value of the '<em><b>Mapping Type</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Mapping Type</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Mapping Type</em>' containment reference.
+ * @see #setMappingType(MappingDataType)
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getGraphInformations_MappingType()
+ * @model containment="true"
+ * @generated
+ */
+ MappingDataType getMappingType();
+
+ /**
+ * Sets the value of the '{@link org.jboss.tools.smooks.graphical.GraphInformations#getMappingType <em>Mapping Type</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Mapping Type</em>' containment reference.
+ * @see #getMappingType()
+ * @generated
+ */
+ void setMappingType(MappingDataType value);
+
+ /**
+ * Returns the value of the '<em><b>Params</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Params</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Params</em>' containment reference.
+ * @see #setParams(Params)
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getGraphInformations_Params()
+ * @model containment="true"
+ * @generated
+ */
+ Params getParams();
+
+ /**
+ * Sets the value of the '{@link org.jboss.tools.smooks.graphical.GraphInformations#getParams <em>Params</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Params</em>' containment reference.
+ * @see #getParams()
+ * @generated
+ */
+ void setParams(Params value);
+
+} // GraphInformations
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphInformations.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalFactory.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalFactory.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalFactory.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,73 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage
+ * @generated
+ */
+public interface GraphicalFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ GraphicalFactory eINSTANCE = org.jboss.tools.smooks.graphical.impl.GraphicalFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Graph Informations</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Graph Informations</em>'.
+ * @generated
+ */
+ GraphInformations createGraphInformations();
+
+ /**
+ * Returns a new object of class '<em>Mapping Data Type</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Mapping Data Type</em>'.
+ * @generated
+ */
+ MappingDataType createMappingDataType();
+
+ /**
+ * Returns a new object of class '<em>Params</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Params</em>'.
+ * @generated
+ */
+ Params createParams();
+
+ /**
+ * Returns a new object of class '<em>Param</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Param</em>'.
+ * @generated
+ */
+ Param createParam();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ GraphicalPackage getGraphicalPackage();
+
+} //GraphicalFactory
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalPackage.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalPackage.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalPackage.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,439 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.GraphicalFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface GraphicalPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "graphical";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.jboss.org/tools/smooks/graphicalInformation";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ GraphicalPackage eINSTANCE = org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.jboss.tools.smooks.graphical.impl.GraphInformationsImpl <em>Graph Informations</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.GraphInformationsImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getGraphInformations()
+ * @generated
+ */
+ int GRAPH_INFORMATIONS = 0;
+
+ /**
+ * The feature id for the '<em><b>Mapping Type</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_INFORMATIONS__MAPPING_TYPE = 0;
+
+ /**
+ * The feature id for the '<em><b>Params</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_INFORMATIONS__PARAMS = 1;
+
+ /**
+ * The number of structural features of the '<em>Graph Informations</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_INFORMATIONS_FEATURE_COUNT = 2;
+
+ /**
+ * The meta object id for the '{@link org.jboss.tools.smooks.graphical.impl.MappingDataTypeImpl <em>Mapping Data Type</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.MappingDataTypeImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getMappingDataType()
+ * @generated
+ */
+ int MAPPING_DATA_TYPE = 1;
+
+ /**
+ * The feature id for the '<em><b>Target Type ID</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MAPPING_DATA_TYPE__TARGET_TYPE_ID = 0;
+
+ /**
+ * The feature id for the '<em><b>Source Type ID</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MAPPING_DATA_TYPE__SOURCE_TYPE_ID = 1;
+
+ /**
+ * The number of structural features of the '<em>Mapping Data Type</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MAPPING_DATA_TYPE_FEATURE_COUNT = 2;
+
+ /**
+ * The meta object id for the '{@link org.jboss.tools.smooks.graphical.impl.ParamsImpl <em>Params</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.ParamsImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getParams()
+ * @generated
+ */
+ int PARAMS = 2;
+
+ /**
+ * The feature id for the '<em><b>Param</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PARAMS__PARAM = 0;
+
+ /**
+ * The number of structural features of the '<em>Params</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PARAMS_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link org.jboss.tools.smooks.graphical.impl.ParamImpl <em>Param</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.ParamImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getParam()
+ * @generated
+ */
+ int PARAM = 3;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PARAM__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PARAM__VALUE = 1;
+
+ /**
+ * The number of structural features of the '<em>Param</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PARAM_FEATURE_COUNT = 2;
+
+
+ /**
+ * Returns the meta object for class '{@link org.jboss.tools.smooks.graphical.GraphInformations <em>Graph Informations</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Graph Informations</em>'.
+ * @see org.jboss.tools.smooks.graphical.GraphInformations
+ * @generated
+ */
+ EClass getGraphInformations();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.jboss.tools.smooks.graphical.GraphInformations#getMappingType <em>Mapping Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Mapping Type</em>'.
+ * @see org.jboss.tools.smooks.graphical.GraphInformations#getMappingType()
+ * @see #getGraphInformations()
+ * @generated
+ */
+ EReference getGraphInformations_MappingType();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.jboss.tools.smooks.graphical.GraphInformations#getParams <em>Params</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Params</em>'.
+ * @see org.jboss.tools.smooks.graphical.GraphInformations#getParams()
+ * @see #getGraphInformations()
+ * @generated
+ */
+ EReference getGraphInformations_Params();
+
+ /**
+ * Returns the meta object for class '{@link org.jboss.tools.smooks.graphical.MappingDataType <em>Mapping Data Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Mapping Data Type</em>'.
+ * @see org.jboss.tools.smooks.graphical.MappingDataType
+ * @generated
+ */
+ EClass getMappingDataType();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.jboss.tools.smooks.graphical.MappingDataType#getTargetTypeID <em>Target Type ID</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Target Type ID</em>'.
+ * @see org.jboss.tools.smooks.graphical.MappingDataType#getTargetTypeID()
+ * @see #getMappingDataType()
+ * @generated
+ */
+ EAttribute getMappingDataType_TargetTypeID();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.jboss.tools.smooks.graphical.MappingDataType#getSourceTypeID <em>Source Type ID</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Source Type ID</em>'.
+ * @see org.jboss.tools.smooks.graphical.MappingDataType#getSourceTypeID()
+ * @see #getMappingDataType()
+ * @generated
+ */
+ EAttribute getMappingDataType_SourceTypeID();
+
+ /**
+ * Returns the meta object for class '{@link org.jboss.tools.smooks.graphical.Params <em>Params</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Params</em>'.
+ * @see org.jboss.tools.smooks.graphical.Params
+ * @generated
+ */
+ EClass getParams();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.jboss.tools.smooks.graphical.Params#getParam <em>Param</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Param</em>'.
+ * @see org.jboss.tools.smooks.graphical.Params#getParam()
+ * @see #getParams()
+ * @generated
+ */
+ EReference getParams_Param();
+
+ /**
+ * Returns the meta object for class '{@link org.jboss.tools.smooks.graphical.Param <em>Param</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Param</em>'.
+ * @see org.jboss.tools.smooks.graphical.Param
+ * @generated
+ */
+ EClass getParam();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.jboss.tools.smooks.graphical.Param#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.jboss.tools.smooks.graphical.Param#getName()
+ * @see #getParam()
+ * @generated
+ */
+ EAttribute getParam_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.jboss.tools.smooks.graphical.Param#getValue <em>Value</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Value</em>'.
+ * @see org.jboss.tools.smooks.graphical.Param#getValue()
+ * @see #getParam()
+ * @generated
+ */
+ EAttribute getParam_Value();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ GraphicalFactory getGraphicalFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link org.jboss.tools.smooks.graphical.impl.GraphInformationsImpl <em>Graph Informations</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.GraphInformationsImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getGraphInformations()
+ * @generated
+ */
+ EClass GRAPH_INFORMATIONS = eINSTANCE.getGraphInformations();
+
+ /**
+ * The meta object literal for the '<em><b>Mapping Type</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference GRAPH_INFORMATIONS__MAPPING_TYPE = eINSTANCE.getGraphInformations_MappingType();
+
+ /**
+ * The meta object literal for the '<em><b>Params</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference GRAPH_INFORMATIONS__PARAMS = eINSTANCE.getGraphInformations_Params();
+
+ /**
+ * The meta object literal for the '{@link org.jboss.tools.smooks.graphical.impl.MappingDataTypeImpl <em>Mapping Data Type</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.MappingDataTypeImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getMappingDataType()
+ * @generated
+ */
+ EClass MAPPING_DATA_TYPE = eINSTANCE.getMappingDataType();
+
+ /**
+ * The meta object literal for the '<em><b>Target Type ID</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MAPPING_DATA_TYPE__TARGET_TYPE_ID = eINSTANCE.getMappingDataType_TargetTypeID();
+
+ /**
+ * The meta object literal for the '<em><b>Source Type ID</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MAPPING_DATA_TYPE__SOURCE_TYPE_ID = eINSTANCE.getMappingDataType_SourceTypeID();
+
+ /**
+ * The meta object literal for the '{@link org.jboss.tools.smooks.graphical.impl.ParamsImpl <em>Params</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.ParamsImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getParams()
+ * @generated
+ */
+ EClass PARAMS = eINSTANCE.getParams();
+
+ /**
+ * The meta object literal for the '<em><b>Param</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PARAMS__PARAM = eINSTANCE.getParams_Param();
+
+ /**
+ * The meta object literal for the '{@link org.jboss.tools.smooks.graphical.impl.ParamImpl <em>Param</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.ParamImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getParam()
+ * @generated
+ */
+ EClass PARAM = eINSTANCE.getParam();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PARAM__NAME = eINSTANCE.getParam_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Value</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PARAM__VALUE = eINSTANCE.getParam_Value();
+
+ }
+
+} //GraphicalPackage
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalPackage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/MappingDataType.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/MappingDataType.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/MappingDataType.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,81 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Mapping Data Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.MappingDataType#getTargetTypeID <em>Target Type ID</em>}</li>
+ * <li>{@link org.jboss.tools.smooks.graphical.MappingDataType#getSourceTypeID <em>Source Type ID</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getMappingDataType()
+ * @model
+ * @generated
+ */
+public interface MappingDataType extends EObject {
+ /**
+ * Returns the value of the '<em><b>Target Type ID</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Target Type ID</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Target Type ID</em>' attribute.
+ * @see #setTargetTypeID(String)
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getMappingDataType_TargetTypeID()
+ * @model
+ * @generated
+ */
+ String getTargetTypeID();
+
+ /**
+ * Sets the value of the '{@link org.jboss.tools.smooks.graphical.MappingDataType#getTargetTypeID <em>Target Type ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Target Type ID</em>' attribute.
+ * @see #getTargetTypeID()
+ * @generated
+ */
+ void setTargetTypeID(String value);
+
+ /**
+ * Returns the value of the '<em><b>Source Type ID</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Source Type ID</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Source Type ID</em>' attribute.
+ * @see #setSourceTypeID(String)
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getMappingDataType_SourceTypeID()
+ * @model
+ * @generated
+ */
+ String getSourceTypeID();
+
+ /**
+ * Sets the value of the '{@link org.jboss.tools.smooks.graphical.MappingDataType#getSourceTypeID <em>Source Type ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Source Type ID</em>' attribute.
+ * @see #getSourceTypeID()
+ * @generated
+ */
+ void setSourceTypeID(String value);
+
+} // MappingDataType
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/MappingDataType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Param.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Param.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Param.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,81 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Param</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.Param#getName <em>Name</em>}</li>
+ * <li>{@link org.jboss.tools.smooks.graphical.Param#getValue <em>Value</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getParam()
+ * @model
+ * @generated
+ */
+public interface Param extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getParam_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.jboss.tools.smooks.graphical.Param#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Value</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Value</em>' attribute.
+ * @see #setValue(String)
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getParam_Value()
+ * @model
+ * @generated
+ */
+ String getValue();
+
+ /**
+ * Sets the value of the '{@link org.jboss.tools.smooks.graphical.Param#getValue <em>Value</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Value</em>' attribute.
+ * @see #getValue()
+ * @generated
+ */
+ void setValue(String value);
+
+} // Param
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Param.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Params.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Params.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Params.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,46 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Params</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.Params#getParam <em>Param</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getParams()
+ * @model
+ * @generated
+ */
+public interface Params extends EObject {
+ /**
+ * Returns the value of the '<em><b>Param</b></em>' containment reference list.
+ * The list contents are of type {@link org.jboss.tools.smooks.graphical.Param}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Param</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Param</em>' containment reference list.
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getParams_Param()
+ * @model containment="true"
+ * @generated
+ */
+ EList<Param> getParam();
+
+} // Params
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/Params.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphInformationsImpl.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphInformationsImpl.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphInformationsImpl.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,247 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.jboss.tools.smooks.graphical.GraphInformations;
+import org.jboss.tools.smooks.graphical.GraphicalPackage;
+import org.jboss.tools.smooks.graphical.MappingDataType;
+import org.jboss.tools.smooks.graphical.Params;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Graph Informations</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.impl.GraphInformationsImpl#getMappingType <em>Mapping Type</em>}</li>
+ * <li>{@link org.jboss.tools.smooks.graphical.impl.GraphInformationsImpl#getParams <em>Params</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class GraphInformationsImpl extends EObjectImpl implements GraphInformations {
+ /**
+ * The cached value of the '{@link #getMappingType() <em>Mapping Type</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getMappingType()
+ * @generated
+ * @ordered
+ */
+ protected MappingDataType mappingType;
+
+ /**
+ * The cached value of the '{@link #getParams() <em>Params</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getParams()
+ * @generated
+ * @ordered
+ */
+ protected Params params;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GraphInformationsImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return GraphicalPackage.Literals.GRAPH_INFORMATIONS;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MappingDataType getMappingType() {
+ return mappingType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetMappingType(MappingDataType newMappingType, NotificationChain msgs) {
+ MappingDataType oldMappingType = mappingType;
+ mappingType = newMappingType;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE, oldMappingType, newMappingType);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setMappingType(MappingDataType newMappingType) {
+ if (newMappingType != mappingType) {
+ NotificationChain msgs = null;
+ if (mappingType != null)
+ msgs = ((InternalEObject)mappingType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE, null, msgs);
+ if (newMappingType != null)
+ msgs = ((InternalEObject)newMappingType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE, null, msgs);
+ msgs = basicSetMappingType(newMappingType, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE, newMappingType, newMappingType));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Params getParams() {
+ return params;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetParams(Params newParams, NotificationChain msgs) {
+ Params oldParams = params;
+ params = newParams;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GraphicalPackage.GRAPH_INFORMATIONS__PARAMS, oldParams, newParams);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setParams(Params newParams) {
+ if (newParams != params) {
+ NotificationChain msgs = null;
+ if (params != null)
+ msgs = ((InternalEObject)params).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GraphicalPackage.GRAPH_INFORMATIONS__PARAMS, null, msgs);
+ if (newParams != null)
+ msgs = ((InternalEObject)newParams).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GraphicalPackage.GRAPH_INFORMATIONS__PARAMS, null, msgs);
+ msgs = basicSetParams(newParams, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphicalPackage.GRAPH_INFORMATIONS__PARAMS, newParams, newParams));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE:
+ return basicSetMappingType(null, msgs);
+ case GraphicalPackage.GRAPH_INFORMATIONS__PARAMS:
+ return basicSetParams(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE:
+ return getMappingType();
+ case GraphicalPackage.GRAPH_INFORMATIONS__PARAMS:
+ return getParams();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE:
+ setMappingType((MappingDataType)newValue);
+ return;
+ case GraphicalPackage.GRAPH_INFORMATIONS__PARAMS:
+ setParams((Params)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE:
+ setMappingType((MappingDataType)null);
+ return;
+ case GraphicalPackage.GRAPH_INFORMATIONS__PARAMS:
+ setParams((Params)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.GRAPH_INFORMATIONS__MAPPING_TYPE:
+ return mappingType != null;
+ case GraphicalPackage.GRAPH_INFORMATIONS__PARAMS:
+ return params != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //GraphInformationsImpl
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphInformationsImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalFactoryImpl.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalFactoryImpl.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalFactoryImpl.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,132 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import org.jboss.tools.smooks.graphical.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class GraphicalFactoryImpl extends EFactoryImpl implements GraphicalFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static GraphicalFactory init() {
+ try {
+ GraphicalFactory theGraphicalFactory = (GraphicalFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.jboss.org/tools/smooks");
+ if (theGraphicalFactory != null) {
+ return theGraphicalFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new GraphicalFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphicalFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case GraphicalPackage.GRAPH_INFORMATIONS: return createGraphInformations();
+ case GraphicalPackage.MAPPING_DATA_TYPE: return createMappingDataType();
+ case GraphicalPackage.PARAMS: return createParams();
+ case GraphicalPackage.PARAM: return createParam();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphInformations createGraphInformations() {
+ GraphInformationsImpl graphInformations = new GraphInformationsImpl();
+ return graphInformations;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MappingDataType createMappingDataType() {
+ MappingDataTypeImpl mappingDataType = new MappingDataTypeImpl();
+ return mappingDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Params createParams() {
+ ParamsImpl params = new ParamsImpl();
+ return params;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Param createParam() {
+ ParamImpl param = new ParamImpl();
+ return param;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphicalPackage getGraphicalPackage() {
+ return (GraphicalPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static GraphicalPackage getPackage() {
+ return GraphicalPackage.eINSTANCE;
+ }
+
+} //GraphicalFactoryImpl
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalFactoryImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalPackageImpl.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalPackageImpl.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalPackageImpl.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,318 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical.impl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.jboss.tools.smooks.graphical.GraphInformations;
+import org.jboss.tools.smooks.graphical.GraphicalFactory;
+import org.jboss.tools.smooks.graphical.GraphicalPackage;
+import org.jboss.tools.smooks.graphical.MappingDataType;
+import org.jboss.tools.smooks.graphical.Param;
+import org.jboss.tools.smooks.graphical.Params;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class GraphicalPackageImpl extends EPackageImpl implements GraphicalPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass graphInformationsEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass mappingDataTypeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass paramsEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass paramEClass = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private GraphicalPackageImpl() {
+ super(eNS_URI, GraphicalFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this
+ * model, and for any others upon which it depends. Simple
+ * dependencies are satisfied by calling this method on all
+ * dependent packages before doing anything else. This method drives
+ * initialization for interdependent packages directly, in parallel
+ * with this package, itself.
+ * <p>Of this package and its interdependencies, all packages which
+ * have not yet been registered by their URI values are first created
+ * and registered. The packages are then initialized in two steps:
+ * meta-model objects for all of the packages are created before any
+ * are initialized, since one package's meta-model objects may refer to
+ * those of another.
+ * <p>Invocation of this method will not affect any packages that have
+ * already been initialized.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static GraphicalPackage init() {
+ if (isInited) return (GraphicalPackage)EPackage.Registry.INSTANCE.getEPackage(GraphicalPackage.eNS_URI);
+
+ // Obtain or create and register package
+ GraphicalPackageImpl theGraphicalPackage = (GraphicalPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof GraphicalPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new GraphicalPackageImpl());
+
+ isInited = true;
+
+ // Create package meta-data objects
+ theGraphicalPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theGraphicalPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theGraphicalPackage.freeze();
+
+ return theGraphicalPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getGraphInformations() {
+ return graphInformationsEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getGraphInformations_MappingType() {
+ return (EReference)graphInformationsEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getGraphInformations_Params() {
+ return (EReference)graphInformationsEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getMappingDataType() {
+ return mappingDataTypeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getMappingDataType_TargetTypeID() {
+ return (EAttribute)mappingDataTypeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getMappingDataType_SourceTypeID() {
+ return (EAttribute)mappingDataTypeEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getParams() {
+ return paramsEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getParams_Param() {
+ return (EReference)paramsEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getParam() {
+ return paramEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getParam_Name() {
+ return (EAttribute)paramEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getParam_Value() {
+ return (EAttribute)paramEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphicalFactory getGraphicalFactory() {
+ return (GraphicalFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ graphInformationsEClass = createEClass(GRAPH_INFORMATIONS);
+ createEReference(graphInformationsEClass, GRAPH_INFORMATIONS__MAPPING_TYPE);
+ createEReference(graphInformationsEClass, GRAPH_INFORMATIONS__PARAMS);
+
+ mappingDataTypeEClass = createEClass(MAPPING_DATA_TYPE);
+ createEAttribute(mappingDataTypeEClass, MAPPING_DATA_TYPE__TARGET_TYPE_ID);
+ createEAttribute(mappingDataTypeEClass, MAPPING_DATA_TYPE__SOURCE_TYPE_ID);
+
+ paramsEClass = createEClass(PARAMS);
+ createEReference(paramsEClass, PARAMS__PARAM);
+
+ paramEClass = createEClass(PARAM);
+ createEAttribute(paramEClass, PARAM__NAME);
+ createEAttribute(paramEClass, PARAM__VALUE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents() {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(graphInformationsEClass, GraphInformations.class, "GraphInformations", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getGraphInformations_MappingType(), this.getMappingDataType(), null, "mappingType", null, 0, 1, GraphInformations.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getGraphInformations_Params(), this.getParams(), null, "params", null, 0, 1, GraphInformations.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(mappingDataTypeEClass, MappingDataType.class, "MappingDataType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getMappingDataType_TargetTypeID(), ecorePackage.getEString(), "targetTypeID", null, 0, 1, MappingDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getMappingDataType_SourceTypeID(), ecorePackage.getEString(), "sourceTypeID", null, 0, 1, MappingDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(paramsEClass, Params.class, "Params", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getParams_Param(), this.getParam(), null, "param", null, 0, -1, Params.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(paramEClass, Param.class, "Param", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getParam_Name(), ecorePackage.getEString(), "name", null, 0, 1, Param.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getParam_Value(), ecorePackage.getEString(), "value", null, 0, 1, Param.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //GraphicalPackageImpl
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalPackageImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/MappingDataTypeImpl.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/MappingDataTypeImpl.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/MappingDataTypeImpl.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,221 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.jboss.tools.smooks.graphical.GraphicalPackage;
+import org.jboss.tools.smooks.graphical.MappingDataType;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Mapping Data Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.impl.MappingDataTypeImpl#getTargetTypeID <em>Target Type ID</em>}</li>
+ * <li>{@link org.jboss.tools.smooks.graphical.impl.MappingDataTypeImpl#getSourceTypeID <em>Source Type ID</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class MappingDataTypeImpl extends EObjectImpl implements MappingDataType {
+ /**
+ * The default value of the '{@link #getTargetTypeID() <em>Target Type ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTargetTypeID()
+ * @generated
+ * @ordered
+ */
+ protected static final String TARGET_TYPE_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getTargetTypeID() <em>Target Type ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTargetTypeID()
+ * @generated
+ * @ordered
+ */
+ protected String targetTypeID = TARGET_TYPE_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getSourceTypeID() <em>Source Type ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSourceTypeID()
+ * @generated
+ * @ordered
+ */
+ protected static final String SOURCE_TYPE_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getSourceTypeID() <em>Source Type ID</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSourceTypeID()
+ * @generated
+ * @ordered
+ */
+ protected String sourceTypeID = SOURCE_TYPE_ID_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MappingDataTypeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return GraphicalPackage.Literals.MAPPING_DATA_TYPE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getTargetTypeID() {
+ return targetTypeID;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTargetTypeID(String newTargetTypeID) {
+ String oldTargetTypeID = targetTypeID;
+ targetTypeID = newTargetTypeID;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphicalPackage.MAPPING_DATA_TYPE__TARGET_TYPE_ID, oldTargetTypeID, targetTypeID));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getSourceTypeID() {
+ return sourceTypeID;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSourceTypeID(String newSourceTypeID) {
+ String oldSourceTypeID = sourceTypeID;
+ sourceTypeID = newSourceTypeID;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphicalPackage.MAPPING_DATA_TYPE__SOURCE_TYPE_ID, oldSourceTypeID, sourceTypeID));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case GraphicalPackage.MAPPING_DATA_TYPE__TARGET_TYPE_ID:
+ return getTargetTypeID();
+ case GraphicalPackage.MAPPING_DATA_TYPE__SOURCE_TYPE_ID:
+ return getSourceTypeID();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case GraphicalPackage.MAPPING_DATA_TYPE__TARGET_TYPE_ID:
+ setTargetTypeID((String)newValue);
+ return;
+ case GraphicalPackage.MAPPING_DATA_TYPE__SOURCE_TYPE_ID:
+ setSourceTypeID((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.MAPPING_DATA_TYPE__TARGET_TYPE_ID:
+ setTargetTypeID(TARGET_TYPE_ID_EDEFAULT);
+ return;
+ case GraphicalPackage.MAPPING_DATA_TYPE__SOURCE_TYPE_ID:
+ setSourceTypeID(SOURCE_TYPE_ID_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.MAPPING_DATA_TYPE__TARGET_TYPE_ID:
+ return TARGET_TYPE_ID_EDEFAULT == null ? targetTypeID != null : !TARGET_TYPE_ID_EDEFAULT.equals(targetTypeID);
+ case GraphicalPackage.MAPPING_DATA_TYPE__SOURCE_TYPE_ID:
+ return SOURCE_TYPE_ID_EDEFAULT == null ? sourceTypeID != null : !SOURCE_TYPE_ID_EDEFAULT.equals(sourceTypeID);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (targetTypeID: ");
+ result.append(targetTypeID);
+ result.append(", sourceTypeID: ");
+ result.append(sourceTypeID);
+ result.append(')');
+ return result.toString();
+ }
+
+} //MappingDataTypeImpl
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/MappingDataTypeImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamImpl.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamImpl.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamImpl.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,221 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.jboss.tools.smooks.graphical.GraphicalPackage;
+import org.jboss.tools.smooks.graphical.Param;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Param</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.impl.ParamImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.jboss.tools.smooks.graphical.impl.ParamImpl#getValue <em>Value</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ParamImpl extends EObjectImpl implements Param {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected static final String VALUE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected String value = VALUE_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ParamImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return GraphicalPackage.Literals.PARAM;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphicalPackage.PARAM__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setValue(String newValue) {
+ String oldValue = value;
+ value = newValue;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GraphicalPackage.PARAM__VALUE, oldValue, value));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case GraphicalPackage.PARAM__NAME:
+ return getName();
+ case GraphicalPackage.PARAM__VALUE:
+ return getValue();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case GraphicalPackage.PARAM__NAME:
+ setName((String)newValue);
+ return;
+ case GraphicalPackage.PARAM__VALUE:
+ setValue((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.PARAM__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case GraphicalPackage.PARAM__VALUE:
+ setValue(VALUE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.PARAM__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case GraphicalPackage.PARAM__VALUE:
+ return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(", value: ");
+ result.append(value);
+ result.append(')');
+ return result.toString();
+ }
+
+} //ParamImpl
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamsImpl.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamsImpl.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamsImpl.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,156 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+import org.jboss.tools.smooks.graphical.GraphicalPackage;
+import org.jboss.tools.smooks.graphical.Param;
+import org.jboss.tools.smooks.graphical.Params;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Params</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.impl.ParamsImpl#getParam <em>Param</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ParamsImpl extends EObjectImpl implements Params {
+ /**
+ * The cached value of the '{@link #getParam() <em>Param</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getParam()
+ * @generated
+ * @ordered
+ */
+ protected EList<Param> param;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ParamsImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return GraphicalPackage.Literals.PARAMS;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Param> getParam() {
+ if (param == null) {
+ param = new EObjectContainmentEList<Param>(Param.class, this, GraphicalPackage.PARAMS__PARAM);
+ }
+ return param;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case GraphicalPackage.PARAMS__PARAM:
+ return ((InternalEList<?>)getParam()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case GraphicalPackage.PARAMS__PARAM:
+ return getParam();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case GraphicalPackage.PARAMS__PARAM:
+ getParam().clear();
+ getParam().addAll((Collection<? extends Param>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.PARAMS__PARAM:
+ getParam().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.PARAMS__PARAM:
+ return param != null && !param.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //ParamsImpl
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/ParamsImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalAdapterFactory.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalAdapterFactory.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalAdapterFactory.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,178 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.jboss.tools.smooks.graphical.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage
+ * @generated
+ */
+public class GraphicalAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static GraphicalPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphicalAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = GraphicalPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch the delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GraphicalSwitch<Adapter> modelSwitch =
+ new GraphicalSwitch<Adapter>() {
+ @Override
+ public Adapter caseGraphInformations(GraphInformations object) {
+ return createGraphInformationsAdapter();
+ }
+ @Override
+ public Adapter caseMappingDataType(MappingDataType object) {
+ return createMappingDataTypeAdapter();
+ }
+ @Override
+ public Adapter caseParams(Params object) {
+ return createParamsAdapter();
+ }
+ @Override
+ public Adapter caseParam(Param object) {
+ return createParamAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.jboss.tools.smooks.graphical.GraphInformations <em>Graph Informations</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.jboss.tools.smooks.graphical.GraphInformations
+ * @generated
+ */
+ public Adapter createGraphInformationsAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.jboss.tools.smooks.graphical.MappingDataType <em>Mapping Data Type</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.jboss.tools.smooks.graphical.MappingDataType
+ * @generated
+ */
+ public Adapter createMappingDataTypeAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.jboss.tools.smooks.graphical.Params <em>Params</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.jboss.tools.smooks.graphical.Params
+ * @generated
+ */
+ public Adapter createParamsAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.jboss.tools.smooks.graphical.Param <em>Param</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.jboss.tools.smooks.graphical.Param
+ * @generated
+ */
+ public Adapter createParamAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //GraphicalAdapterFactory
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalAdapterFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalSwitch.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalSwitch.java (rev 0)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalSwitch.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -0,0 +1,193 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.graphical.util;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+
+import org.jboss.tools.smooks.graphical.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage
+ * @generated
+ */
+public class GraphicalSwitch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static GraphicalPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GraphicalSwitch() {
+ if (modelPackage == null) {
+ modelPackage = GraphicalPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ public T doSwitch(EObject theEObject) {
+ return doSwitch(theEObject.eClass(), theEObject);
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(EClass theEClass, EObject theEObject) {
+ if (theEClass.eContainer() == modelPackage) {
+ return doSwitch(theEClass.getClassifierID(), theEObject);
+ }
+ else {
+ List<EClass> eSuperTypes = theEClass.getESuperTypes();
+ return
+ eSuperTypes.isEmpty() ?
+ defaultCase(theEObject) :
+ doSwitch(eSuperTypes.get(0), theEObject);
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case GraphicalPackage.GRAPH_INFORMATIONS: {
+ GraphInformations graphInformations = (GraphInformations)theEObject;
+ T result = caseGraphInformations(graphInformations);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case GraphicalPackage.MAPPING_DATA_TYPE: {
+ MappingDataType mappingDataType = (MappingDataType)theEObject;
+ T result = caseMappingDataType(mappingDataType);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case GraphicalPackage.PARAMS: {
+ Params params = (Params)theEObject;
+ T result = caseParams(params);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case GraphicalPackage.PARAM: {
+ Param param = (Param)theEObject;
+ T result = caseParam(param);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Graph Informations</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Graph Informations</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseGraphInformations(GraphInformations object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Mapping Data Type</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Mapping Data Type</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseMappingDataType(MappingDataType object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Params</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Params</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseParams(Params object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Param</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Param</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseParam(Param object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //GraphicalSwitch
Property changes on: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalSwitch.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/jbosstools-3.0.0.Beta1/smooks/tests/org.jboss.tools.smooks.test/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/tests/org.jboss.tools.smooks.test/META-INF/MANIFEST.MF 2008-10-18 22:02:22 UTC (rev 10955)
+++ branches/jbosstools-3.0.0.Beta1/smooks/tests/org.jboss.tools.smooks.test/META-INF/MANIFEST.MF 2008-10-20 07:59:03 UTC (rev 10956)
@@ -6,21 +6,18 @@
Bundle-Activator: org.jboss.tools.smooks.test.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.jboss.tools.smooks.graphicalInfo,
org.jboss.tools.smooks.javabean,
org.jboss.tools.smooks.model,
org.jboss.tools.smooks.model.edit,
org.jboss.tools.smooks.ui,
org.jboss.tools.smooks.xml,
- org.jboss.tools.smooks.xml2java,
org.junit,
org.eclipse.core.resources,
org.eclipse.xsd,
org.eclipse.xsd.edit,
org.eclipse.emf,
org.eclipse.emf.ecore.edit,
- org.eclipse.emf.edit.ui,
- org.jboss.tools.smooks.java2xml
+ org.eclipse.emf.edit.ui
Eclipse-LazyStart: true
Bundle-ClassPath: lib/dom4j-1.6.1.jar,
.
Modified: branches/jbosstools-3.0.0.Beta1/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java2java/SmooksAnalyzerTester.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java2java/SmooksAnalyzerTester.java 2008-10-18 22:02:22 UTC (rev 10955)
+++ branches/jbosstools-3.0.0.Beta1/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java2java/SmooksAnalyzerTester.java 2008-10-20 07:59:03 UTC (rev 10956)
@@ -55,7 +55,7 @@
return new BasicCommandStack();
}
public SmooksAnalyzerTester() throws IOException {
- super();
+// super();
adapterFactory = new ComposedAdapterFactory(
ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
adapterFactory
@@ -71,7 +71,7 @@
GraphicalPackage.eINSTANCE);
Registry.INSTANCE.put(SmooksPackage.eNS_URI, SmooksPackage.eINSTANCE);
- resource = editingDomain.getResourceSet().createResource(null);
+ resource = new SmooksResourceFactoryImpl().createResource(null);
Resource gr = new XMLResourceFactoryImpl().createResource(null);
InputStream stream1 = classLoader
.getResourceAsStream("org/jboss/tools/smooks/test/java2java/Test.xml");
16 years, 2 months
JBoss Tools SVN: r10955 - branches/jbosstools-3.0.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-18 18:02:22 -0400 (Sat, 18 Oct 2008)
New Revision: 10955
Modified:
branches/jbosstools-3.0.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java
Log:
Checking the hibernate tests.
Modified: branches/jbosstools-3.0.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java 2008-10-18 15:32:18 UTC (rev 10954)
+++ branches/jbosstools-3.0.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java 2008-10-18 22:02:22 UTC (rev 10955)
@@ -175,7 +175,14 @@
}
}, new NullProgressMonitor());
}
+ if (!deleted) {
+ proj.delete(false, true,null);
+ }
waitForJobs();
+ try {
+ delete(file);
+ } catch (Throwable e) {
+ }
delete(file);
}
public void testDummy() throws JavaModelException {
@@ -212,9 +219,14 @@
buffer.append("Cannot remove the ");
buffer.append(file.getAbsolutePath());
buffer.append(" file. ");
- if (file.exists() && file.isDirectory()) {
- buffer.append("List=");
- buffer.append(file.list());
+ if (file.exists()) {
+ if (file.isDirectory()) {
+ buffer.append(" ;List=");
+ buffer.append(file.list());
+ } else {
+ buffer.append(" ;length=");
+ buffer.append(file.length());
+ }
}
return buffer.toString();
}
16 years, 2 months
JBoss Tools SVN: r10954 - branches/jbosstools-3.0.0.Beta1/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-18 11:32:18 -0400 (Sat, 18 Oct 2008)
New Revision: 10954
Modified:
branches/jbosstools-3.0.0.Beta1/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java
Log:
fix for JUnit Tests errors
Modified: branches/jbosstools-3.0.0.Beta1/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java 2008-10-18 15:23:45 UTC (rev 10953)
+++ branches/jbosstools-3.0.0.Beta1/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java 2008-10-18 15:32:18 UTC (rev 10954)
@@ -79,6 +79,7 @@
try {
oldAutoBuilding = ResourcesUtils.setBuildAutomatically(false);
JobUtils.waitForIdle();
+ project.close(null);
project.delete(true, null);
JobUtils.waitForIdle();
} finally {
16 years, 2 months