Author: DartPeng
Date: 2008-08-26 02:57:37 -0400 (Tue, 26 Aug 2008)
New Revision: 9890
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/graphical/
workspace/dart/plugins/org.jboss.tools.smooks.ui/graphical/graphical.ecore
workspace/dart/plugins/org.jboss.tools.smooks.ui/graphical/graphical.genmodel
workspace/dart/plugins/org.jboss.tools.smooks.ui/plugin.properties
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalFactory.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalPackage.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/graphInfor.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalFactoryImpl.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalPackageImpl.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/graphInforImpl.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/mappingTypeImpl.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/mappingType.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalAdapterFactory.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalInformationSaver.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalSwitch.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/Test.java
Modified:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
Log:
add codes for generate the Graphical information file
Added: workspace/dart/plugins/org.jboss.tools.smooks.ui/graphical/graphical.ecore
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.ui/graphical/graphical.ecore
(rev 0)
+++ workspace/dart/plugins/org.jboss.tools.smooks.ui/graphical/graphical.ecore 2008-08-26
06:57:37 UTC (rev 9890)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0"
+
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
name="graphical"
+
nsURI="http://www.jboss.org/tools/smooks" nsPrefix="">
+ <eClassifiers xsi:type="ecore:EClass" name="graphInfor">
+ <eStructuralFeatures xsi:type="ecore:EReference"
name="mappingType" eType="#//mappingType"
+ containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="mappingType">
+ <eStructuralFeatures xsi:type="ecore:EAttribute"
name="targetTypeID" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute"
name="sourceTypeID" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+</ecore:EPackage>
Property changes on:
workspace/dart/plugins/org.jboss.tools.smooks.ui/graphical/graphical.ecore
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/dart/plugins/org.jboss.tools.smooks.ui/graphical/graphical.genmodel
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.ui/graphical/graphical.genmodel
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/graphical/graphical.genmodel 2008-08-26
06:57:37 UTC (rev 9890)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0"
+
xmlns:xmi="http://www.omg.org/XMI"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel"
modelDirectory="/org.jboss.tools.smooks.ui/src"
+ modelPluginID="org.jboss.tools.smooks.ui" modelName="Graphical"
importerID="org.eclipse.emf.importer.ecore"
+ complianceLevel="5.0" copyrightFields="false">
+ <foreignModel>graphical.ecore</foreignModel>
+ <genPackages prefix="Graphical"
basePackage="org.jboss.tools.smooks" disposableProviderFactory="true"
+ ecorePackage="graphical.ecore#/">
+ <genClasses ecoreClass="graphical.ecore#//graphInfor">
+ <genFeatures property="None" children="true"
createChild="true" ecoreFeature="ecore:EReference
graphical.ecore#//graphInfor/mappingType"/>
+ </genClasses>
+ <genClasses ecoreClass="graphical.ecore#//mappingType">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
graphical.ecore#//mappingType/targetTypeID"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
graphical.ecore#//mappingType/sourceTypeID"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
Property changes on:
workspace/dart/plugins/org.jboss.tools.smooks.ui/graphical/graphical.genmodel
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/dart/plugins/org.jboss.tools.smooks.ui/plugin.properties
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.ui/plugin.properties
(rev 0)
+++ workspace/dart/plugins/org.jboss.tools.smooks.ui/plugin.properties 2008-08-26 06:57:37
UTC (rev 9890)
@@ -0,0 +1,20 @@
+
+# <copyright>
+# </copyright>
+#
+# $Id$
+
+# ====================================================================
+# To code developer:
+# Do NOT change the properties between this line and the
+# "%%% END OF TRANSLATED PROPERTIES %%%" line.
+# Make a new property name, append to the end of the file and change
+# the code to use the new property.
+# ====================================================================
+
+# ====================================================================
+# %%% END OF TRANSLATED PROPERTIES %%%
+# ====================================================================
+
+pluginName = Graphical Model
+providerName =
www.example.org
Property changes on: workspace/dart/plugins/org.jboss.tools.smooks.ui/plugin.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalFactory.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalFactory.java
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalFactory.java 2008-08-26
06:57:37 UTC (rev 9890)
@@ -0,0 +1,55 @@
+/**
+ * <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 Infor</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>graph Infor</em>'.
+ * @generated
+ */
+ graphInfor creategraphInfor();
+
+ /**
+ * Returns a new object of class '<em>mapping Type</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>mapping Type</em>'.
+ * @generated
+ */
+ mappingType createmappingType();
+
+ /**
+ * 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:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalPackage.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalPackage.java
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalPackage.java 2008-08-26
06:57:37 UTC (rev 9890)
@@ -0,0 +1,249 @@
+/**
+ * <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";
+
+ /**
+ * 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.graphInforImpl <em>graph
Infor</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.graphInforImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getgraphInfor()
+ * @generated
+ */
+ int GRAPH_INFOR = 0;
+
+ /**
+ * The feature id for the '<em><b>Mapping Type</b></em>'
containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_INFOR__MAPPING_TYPE = 0;
+
+ /**
+ * The number of structural features of the '<em>graph Infor</em>'
class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH_INFOR_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link
org.jboss.tools.smooks.graphical.impl.mappingTypeImpl <em>mapping
Type</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.mappingTypeImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getmappingType()
+ * @generated
+ */
+ int MAPPING_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_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_TYPE__SOURCE_TYPE_ID = 1;
+
+ /**
+ * The number of structural features of the '<em>mapping Type</em>'
class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MAPPING_TYPE_FEATURE_COUNT = 2;
+
+
+ /**
+ * Returns the meta object for class '{@link
org.jboss.tools.smooks.graphical.graphInfor <em>graph Infor</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>graph Infor</em>'.
+ * @see org.jboss.tools.smooks.graphical.graphInfor
+ * @generated
+ */
+ EClass getgraphInfor();
+
+ /**
+ * Returns the meta object for the containment reference '{@link
org.jboss.tools.smooks.graphical.graphInfor#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.graphInfor#getMappingType()
+ * @see #getgraphInfor()
+ * @generated
+ */
+ EReference getgraphInfor_MappingType();
+
+ /**
+ * Returns the meta object for class '{@link
org.jboss.tools.smooks.graphical.mappingType <em>mapping Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>mapping Type</em>'.
+ * @see org.jboss.tools.smooks.graphical.mappingType
+ * @generated
+ */
+ EClass getmappingType();
+
+ /**
+ * Returns the meta object for the attribute '{@link
org.jboss.tools.smooks.graphical.mappingType#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.mappingType#getTargetTypeID()
+ * @see #getmappingType()
+ * @generated
+ */
+ EAttribute getmappingType_TargetTypeID();
+
+ /**
+ * Returns the meta object for the attribute '{@link
org.jboss.tools.smooks.graphical.mappingType#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.mappingType#getSourceTypeID()
+ * @see #getmappingType()
+ * @generated
+ */
+ EAttribute getmappingType_SourceTypeID();
+
+ /**
+ * 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.graphInforImpl <em>graph
Infor</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.graphInforImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getgraphInfor()
+ * @generated
+ */
+ EClass GRAPH_INFOR = eINSTANCE.getgraphInfor();
+
+ /**
+ * The meta object literal for the '<em><b>Mapping
Type</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference GRAPH_INFOR__MAPPING_TYPE = eINSTANCE.getgraphInfor_MappingType();
+
+ /**
+ * The meta object literal for the '{@link
org.jboss.tools.smooks.graphical.impl.mappingTypeImpl <em>mapping
Type</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.jboss.tools.smooks.graphical.impl.mappingTypeImpl
+ * @see org.jboss.tools.smooks.graphical.impl.GraphicalPackageImpl#getmappingType()
+ * @generated
+ */
+ EClass MAPPING_TYPE = eINSTANCE.getmappingType();
+
+ /**
+ * The meta object literal for the '<em><b>Target Type
ID</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MAPPING_TYPE__TARGET_TYPE_ID = eINSTANCE.getmappingType_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_TYPE__SOURCE_TYPE_ID = eINSTANCE.getmappingType_SourceTypeID();
+
+ }
+
+} //GraphicalPackage
Property changes on:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/GraphicalPackage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/graphInfor.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/graphInfor.java
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/graphInfor.java 2008-08-26
06:57:37 UTC (rev 9890)
@@ -0,0 +1,54 @@
+/**
+ * <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
Infor</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.graphInfor#getMappingType
<em>Mapping Type</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getgraphInfor()
+ * @model
+ * @generated
+ */
+public interface graphInfor 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(mappingType)
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getgraphInfor_MappingType()
+ * @model containment="true"
+ * @generated
+ */
+ mappingType getMappingType();
+
+ /**
+ * Sets the value of the '{@link
org.jboss.tools.smooks.graphical.graphInfor#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(mappingType value);
+
+} // graphInfor
Property changes on:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/graphInfor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalFactoryImpl.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalFactoryImpl.java
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalFactoryImpl.java 2008-08-26
06:57:37 UTC (rev 9890)
@@ -0,0 +1,110 @@
+/**
+ * <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....);
+ 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_INFOR: return creategraphInfor();
+ case GraphicalPackage.MAPPING_TYPE: return createmappingType();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() +
"' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public graphInfor creategraphInfor() {
+ graphInforImpl graphInfor = new graphInforImpl();
+ return graphInfor;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public mappingType createmappingType() {
+ mappingTypeImpl mappingType = new mappingTypeImpl();
+ return mappingType;
+ }
+
+ /**
+ * <!-- 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:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalFactoryImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalPackageImpl.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalPackageImpl.java
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalPackageImpl.java 2008-08-26
06:57:37 UTC (rev 9890)
@@ -0,0 +1,232 @@
+/**
+ * <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.GraphicalFactory;
+import org.jboss.tools.smooks.graphical.GraphicalPackage;
+import org.jboss.tools.smooks.graphical.graphInfor;
+import org.jboss.tools.smooks.graphical.mappingType;
+
+/**
+ * <!-- 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 graphInforEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass mappingTypeEClass = 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 getgraphInfor() {
+ return graphInforEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getgraphInfor_MappingType() {
+ return (EReference)graphInforEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getmappingType() {
+ return mappingTypeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getmappingType_TargetTypeID() {
+ return (EAttribute)mappingTypeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getmappingType_SourceTypeID() {
+ return (EAttribute)mappingTypeEClass.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
+ graphInforEClass = createEClass(GRAPH_INFOR);
+ createEReference(graphInforEClass, GRAPH_INFOR__MAPPING_TYPE);
+
+ mappingTypeEClass = createEClass(MAPPING_TYPE);
+ createEAttribute(mappingTypeEClass, MAPPING_TYPE__TARGET_TYPE_ID);
+ createEAttribute(mappingTypeEClass, MAPPING_TYPE__SOURCE_TYPE_ID);
+ }
+
+ /**
+ * <!-- 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(graphInforEClass, graphInfor.class, "graphInfor", !IS_ABSTRACT,
!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getgraphInfor_MappingType(), this.getmappingType(), null,
"mappingType", null, 0, 1, graphInfor.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
IS_ORDERED);
+
+ initEClass(mappingTypeEClass, mappingType.class, "mappingType", !IS_ABSTRACT,
!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getmappingType_TargetTypeID(), ecorePackage.getEString(),
"targetTypeID", null, 0, 1, mappingType.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getmappingType_SourceTypeID(), ecorePackage.getEString(),
"sourceTypeID", null, 0, 1, mappingType.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:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/GraphicalPackageImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/graphInforImpl.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/graphInforImpl.java
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/graphInforImpl.java 2008-08-26
06:57:37 UTC (rev 9890)
@@ -0,0 +1,180 @@
+/**
+ * <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.GraphicalPackage;
+import org.jboss.tools.smooks.graphical.graphInfor;
+import org.jboss.tools.smooks.graphical.mappingType;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>graph
Infor</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.impl.graphInforImpl#getMappingType
<em>Mapping Type</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class graphInforImpl extends EObjectImpl implements graphInfor {
+ /**
+ * The cached value of the '{@link #getMappingType() <em>Mapping
Type</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getMappingType()
+ * @generated
+ * @ordered
+ */
+ protected mappingType mappingType;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected graphInforImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return GraphicalPackage.Literals.GRAPH_INFOR;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public mappingType getMappingType() {
+ return mappingType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetMappingType(mappingType newMappingType,
NotificationChain msgs) {
+ mappingType oldMappingType = mappingType;
+ mappingType = newMappingType;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
GraphicalPackage.GRAPH_INFOR__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(mappingType newMappingType) {
+ if (newMappingType != mappingType) {
+ NotificationChain msgs = null;
+ if (mappingType != null)
+ msgs = ((InternalEObject)mappingType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE -
GraphicalPackage.GRAPH_INFOR__MAPPING_TYPE, null, msgs);
+ if (newMappingType != null)
+ msgs = ((InternalEObject)newMappingType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE -
GraphicalPackage.GRAPH_INFOR__MAPPING_TYPE, null, msgs);
+ msgs = basicSetMappingType(newMappingType, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
GraphicalPackage.GRAPH_INFOR__MAPPING_TYPE, newMappingType, newMappingType));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID,
NotificationChain msgs) {
+ switch (featureID) {
+ case GraphicalPackage.GRAPH_INFOR__MAPPING_TYPE:
+ return basicSetMappingType(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_INFOR__MAPPING_TYPE:
+ return getMappingType();
+ }
+ 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_INFOR__MAPPING_TYPE:
+ setMappingType((mappingType)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.GRAPH_INFOR__MAPPING_TYPE:
+ setMappingType((mappingType)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case GraphicalPackage.GRAPH_INFOR__MAPPING_TYPE:
+ return mappingType != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //graphInforImpl
Property changes on:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/graphInforImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/mappingTypeImpl.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/mappingTypeImpl.java
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/mappingTypeImpl.java 2008-08-26
06:57:37 UTC (rev 9890)
@@ -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.mappingType;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>mapping
Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link
org.jboss.tools.smooks.graphical.impl.mappingTypeImpl#getTargetTypeID <em>Target
Type ID</em>}</li>
+ * <li>{@link
org.jboss.tools.smooks.graphical.impl.mappingTypeImpl#getSourceTypeID <em>Source
Type ID</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class mappingTypeImpl extends EObjectImpl implements mappingType {
+ /**
+ * 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 mappingTypeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return GraphicalPackage.Literals.MAPPING_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_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_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_TYPE__TARGET_TYPE_ID:
+ return getTargetTypeID();
+ case GraphicalPackage.MAPPING_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_TYPE__TARGET_TYPE_ID:
+ setTargetTypeID((String)newValue);
+ return;
+ case GraphicalPackage.MAPPING_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_TYPE__TARGET_TYPE_ID:
+ setTargetTypeID(TARGET_TYPE_ID_EDEFAULT);
+ return;
+ case GraphicalPackage.MAPPING_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_TYPE__TARGET_TYPE_ID:
+ return TARGET_TYPE_ID_EDEFAULT == null ? targetTypeID != null :
!TARGET_TYPE_ID_EDEFAULT.equals(targetTypeID);
+ case GraphicalPackage.MAPPING_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();
+ }
+
+} //mappingTypeImpl
Property changes on:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/impl/mappingTypeImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/mappingType.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/mappingType.java
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/mappingType.java 2008-08-26
06:57:37 UTC (rev 9890)
@@ -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
Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.jboss.tools.smooks.graphical.mappingType#getTargetTypeID
<em>Target Type ID</em>}</li>
+ * <li>{@link org.jboss.tools.smooks.graphical.mappingType#getSourceTypeID
<em>Source Type ID</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.jboss.tools.smooks.graphical.GraphicalPackage#getmappingType()
+ * @model
+ * @generated
+ */
+public interface mappingType 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#getmappingType_TargetTypeID()
+ * @model
+ * @generated
+ */
+ String getTargetTypeID();
+
+ /**
+ * Sets the value of the '{@link
org.jboss.tools.smooks.graphical.mappingType#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#getmappingType_SourceTypeID()
+ * @model
+ * @generated
+ */
+ String getSourceTypeID();
+
+ /**
+ * Sets the value of the '{@link
org.jboss.tools.smooks.graphical.mappingType#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);
+
+} // mappingType
Property changes on:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/mappingType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalAdapterFactory.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalAdapterFactory.java
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalAdapterFactory.java 2008-08-26
06:57:37 UTC (rev 9890)
@@ -0,0 +1,142 @@
+/**
+ * <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 casegraphInfor(graphInfor object) {
+ return creategraphInforAdapter();
+ }
+ @Override
+ public Adapter casemappingType(mappingType object) {
+ return createmappingTypeAdapter();
+ }
+ @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.graphInfor <em>graph Infor</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.graphInfor
+ * @generated
+ */
+ public Adapter creategraphInforAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link
org.jboss.tools.smooks.graphical.mappingType <em>mapping 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.mappingType
+ * @generated
+ */
+ public Adapter createmappingTypeAdapter() {
+ 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:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalAdapterFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalInformationSaver.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalInformationSaver.java
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalInformationSaver.java 2008-08-26
06:57:37 UTC (rev 9890)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * 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.graphical.util;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Collections;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IFileEditorInput;
+import org.jboss.tools.smooks.graphical.GraphicalFactory;
+import org.jboss.tools.smooks.graphical.graphInfor;
+import org.jboss.tools.smooks.graphical.mappingType;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
+
+/**
+ * @author Dart Peng
+ * @Date Aug 25, 2008
+ */
+public class GraphicalInformationSaver {
+ private IFile graphicalFile = null;
+ private IEditorInput input;
+
+ /**
+ * Create the instance during init step
+ *
+ * @param input
+ * EditorInput of Smooks graphical editor
+ */
+ public GraphicalInformationSaver(IEditorInput input) {
+ if (input instanceof IFileEditorInput) {
+ IFile file = ((IFileEditorInput) input).getFile();
+ IContainer container = file.getParent();
+ String fileName = file.getName();
+ if (fileName.endsWith(".smooks")) {
+ String gfileName = fileName + ".graph";
+ if (container != null) {
+ IFile gfile = container.getFile(new Path(gfileName));
+ graphicalFile = gfile;
+ }
+ }
+ }
+ }
+
+ public void doSave(IProgressMonitor monitor,
+ SmooksConfigurationFileGenerateContext context) throws IOException,
+ CoreException {
+ if (graphicalFile == null)
+ throw new IOException("can't find the file");
+ String sourceID = context.getSourceDataTypeID();
+ String targetID = context.getTargetDataTypeID();
+
+ graphInfor infor = GraphicalFactory.eINSTANCE.creategraphInfor();
+ initMappingTypes(infor, sourceID, targetID);
+ XMLResource re = new XMLResourceImpl();
+ re.getContents().add(infor);
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ re.save(outputStream, Collections.EMPTY_MAP);
+
+ if (graphicalFile.exists()) {
+ graphicalFile.setContents(new ByteArrayInputStream(outputStream
+ .toByteArray()), IResource.FORCE, monitor);
+ } else {
+ graphicalFile.create(new ByteArrayInputStream(outputStream
+ .toByteArray()), IResource.FORCE, monitor);
+ }
+ }
+
+ protected void initMappingTypes(graphInfor infor, String sourceID,
+ String targetID) {
+ mappingType mapping = GraphicalFactory.eINSTANCE.createmappingType();
+ mapping.setSourceTypeID(sourceID);
+ mapping.setTargetTypeID(targetID);
+
+ infor.setMappingType(mapping);
+ }
+
+}
Property changes on:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalInformationSaver.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalSwitch.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalSwitch.java
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalSwitch.java 2008-08-26
06:57:37 UTC (rev 9890)
@@ -0,0 +1,151 @@
+/**
+ * <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_INFOR: {
+ graphInfor graphInfor = (graphInfor)theEObject;
+ T result = casegraphInfor(graphInfor);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case GraphicalPackage.MAPPING_TYPE: {
+ mappingType mappingType = (mappingType)theEObject;
+ T result = casemappingType(mappingType);
+ 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
Infor</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
Infor</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casegraphInfor(graphInfor object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of
'<em>mapping 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 Type</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casemappingType(mappingType 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:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalSwitch.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/Test.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/Test.java
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/Test.java 2008-08-26
06:57:37 UTC (rev 9890)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * 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.graphical.util;
+
+import java.io.IOException;
+import java.util.Collections;
+
+import org.eclipse.emf.ecore.EPackage.Registry;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
+import org.jboss.tools.smooks.graphical.GraphicalFactory;
+import org.jboss.tools.smooks.graphical.GraphicalPackage;
+import org.jboss.tools.smooks.graphical.graphInfor;
+import org.jboss.tools.smooks.graphical.mappingType;
+
+/**
+ * @author Dart Peng
+ * @Date Aug 25, 2008
+ */
+public class Test {
+ public static void main(String[] args) {
+
+ Registry.INSTANCE.put(GraphicalPackage.eNS_URI, GraphicalPackage.eINSTANCE);
+
+ graphInfor graph = GraphicalFactory.eINSTANCE.creategraphInfor();
+ mappingType t = GraphicalFactory.eINSTANCE.createmappingType();
+
+ t.setSourceTypeID("adfada");
+
+ graph.setMappingType(t);
+
+
+ XMLResource resource= new XMLResourceImpl();
+ resource.getContents().add(graph);
+
+ try {
+ resource.save(System.out,Collections.EMPTY_MAP);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+}
Property changes on:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/Test.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-08-26
06:56:47 UTC (rev 9889)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-08-26
06:57:37 UTC (rev 9890)
@@ -61,6 +61,8 @@
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPart;
@@ -75,6 +77,7 @@
import org.eclipse.ui.forms.widgets.Section;
import org.jboss.tools.smooks.analyzer.SmooksAnalyzerException;
import org.jboss.tools.smooks.analyzer.SmooksFileBuilder;
+import org.jboss.tools.smooks.graphical.util.GraphicalInformationSaver;
import org.jboss.tools.smooks.ui.IStrucutredDataCreationWizard;
import org.jboss.tools.smooks.ui.IViewerInitor;
import org.jboss.tools.smooks.ui.StructuredDataCreationWizardDailog;
@@ -113,6 +116,7 @@
protected String sourceDataTypeID = null;
protected String targetDataTypeID = null;
protected SmooksFileBuilder smooksFileBuilder = null;
+ protected GraphicalInformationSaver graphicalInformationSaver = null;
protected boolean commandStackChanged = false;
protected ActionRegistry actionRegistry;
@@ -417,11 +421,17 @@
SmooksConfigurationFileGenerateContext context = createContext();
Exception exp = null;
try {
+ // generate smooks configuration file
InputStream stream = builder.generateSmooksFile(context, monitor);
IFile file = ((IFileEditorInput) this.getEditorInput()).getFile();
if (file.exists()) {
file.setContents(stream, IResource.FORCE, monitor);
}
+
+ // save graphical informations
+ if(this.graphicalInformationSaver != null){
+ graphicalInformationSaver.doSave(monitor, context);
+ }
} catch (CoreException e) {
exp = e;
} catch (SmooksAnalyzerException e) {
@@ -429,8 +439,9 @@
} catch (IOException e) {
exp = e;
}
- if(exp != null){
- MessageDialog.openError(getSite().getShell(), "Save Error", "Error!
\n" + exp.getMessage());
+ if (exp != null) {
+ MessageDialog.openError(getSite().getShell(), "Save Error",
+ "Error! \n" + exp.getMessage());
}
super.doSave(monitor);
commandStackChanged = false;
@@ -561,6 +572,21 @@
this.targetViewerInitor = targetViewerInitor;
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormPage#init(org.eclipse.ui.IEditorSite,
+ * org.eclipse.ui.IEditorInput)
+ */
+ public void init(IEditorSite site, IEditorInput input) {
+ super.init(site, input);
+ graphicalInformationSaver = new GraphicalInformationSaver(input);
+ }
+
+ /**
+ *
+ * @param viewer
+ */
protected void showCreationWizard(TreeViewer viewer) {
TransformDataSelectionWizard wizard = new TransformDataSelectionWizard();
wizard.setInput(getEditorInput());
Modified:
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-08-26
06:56:47 UTC (rev 9889)
+++
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-08-26
06:57:37 UTC (rev 9890)
@@ -50,7 +50,6 @@
super(pageName);
// TODO Auto-generated constructor stub
}
-
public Object getReturnValue() {
return returnObject;
}
@@ -60,7 +59,6 @@
*
* @see
org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
- @Override
public void createControl(Composite parent) {
Composite mainComposite = new Composite(parent, SWT.NONE);