Author: DartPeng
Date: 2008-08-18 05:59:55 -0400 (Mon, 18 Aug 2008)
New Revision: 9763
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AnalyzerFactory.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksAnalyzerException.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksFileBuilder.java
Modified:
workspace/dart/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/IAnalyzer.java
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/gef/editparts/SmooksEditPartFactory.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java
Log:
Extended the Analyzer;
the Analyzer is a generator of Smooks config file
Modified:
workspace/dart/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-08-18
09:31:37 UTC (rev 9762)
+++
workspace/dart/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-08-18
09:59:55 UTC (rev 9763)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.smooks.javabean.analyzer;
+import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -25,12 +26,14 @@
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
import org.jboss.tools.smooks.analyzer.IAnalyzer;
+import org.jboss.tools.smooks.analyzer.SmooksAnalyzerException;
import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
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.RootModel;
import org.jboss.tools.smooks.ui.gef.model.StructuredDataModel;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
import org.milyn.xsd.smooks.ParamType;
import org.milyn.xsd.smooks.ResourceConfigType;
import org.milyn.xsd.smooks.ResourceType;
@@ -72,7 +75,8 @@
return new BasicCommandStack();
}
- public SmooksResourceListType analyzeGraphicalModel(RootModel root) {
+ public SmooksResourceListType analyzeGraphicalModel(
+ AbstractStructuredDataModel root) {
SmooksResourceListType resourceList = SmooksFactory.eINSTANCE
.createSmooksResourceListType();
@@ -108,7 +112,8 @@
* @param beanId
*/
protected void analyzeStructuredDataModel(
- SmooksResourceListType resourceList, RootModel root,
+ SmooksResourceListType resourceList,
+ AbstractStructuredDataModel root,
AbstractStructuredDataModel dataModel,
ResourceConfigType parentResourceConfigType, String beanId) {
if (dataModel instanceof IConnectableModel) {
@@ -151,8 +156,9 @@
.getSmooksResourceListType_AbstractResourceConfig(),
resourceConfig);
addResourceConfigCommand.execute();
-// resouceConfig.
- resourceConfig.setSelector(getSourceBeanSelectorString((AbstractStructuredDataModel)source));
+ // resouceConfig.
+ resourceConfig
+ .setSelector(getSourceBeanSelectorString((AbstractStructuredDataModel) source));
setConnectionUsed(connection);
ResourceType resource = SmooksFactory.eINSTANCE
@@ -165,8 +171,8 @@
beanIdParam.setName("beanId");
if (beanId == null)
beanId = targetJavaBean.getName();
- if(beanId.startsWith("${")){
- beanId= beanId.substring(2,beanId.indexOf("}"));
+ if (beanId.startsWith("${")) {
+ beanId = beanId.substring(2, beanId.indexOf("}"));
}
SmooksModelUtils
.appendTextToSmooksType(beanIdParam, beanId);
@@ -236,7 +242,7 @@
AbstractStructuredDataModel source,
AbstractStructuredDataModel currentRootModel) {
JavaBeanModel sourcebean = (JavaBeanModel) source
- .getReferenceEntityModel();
+ .getReferenceEntityModel();
JavaBeanModel rootbean = (JavaBeanModel) currentRootModel
.getReferenceEntityModel();
JavaBeanModel currentbean = (JavaBeanModel) target
@@ -254,10 +260,10 @@
while (parent != currentRootModel && parent != null) {
returnString = ((JavaBeanModel) parent
.getReferenceEntityModel()).getName()
- + " " +returnString;
+ + " " + returnString;
parent = parent.getParent();
}
- // if no property
+ // if no property
if (returnString.equals(sourcebean.getName())) {
returnString = ((JavaBeanModel) parent
.getReferenceEntityModel()).getBeanClassString()
@@ -266,13 +272,23 @@
return returnString;
}
}
-
- protected String getSourceBeanSelectorString(AbstractStructuredDataModel sourceModel){
- JavaBeanModel source = (JavaBeanModel) sourceModel.getReferenceEntityModel();
- if(Collection.class.isAssignableFrom(source.getBeanClass())){
+
+ protected String getSourceBeanSelectorString(
+ AbstractStructuredDataModel sourceModel) {
+ JavaBeanModel source = (JavaBeanModel) sourceModel
+ .getReferenceEntityModel();
+ if (Collection.class.isAssignableFrom(source.getBeanClass())) {
return source.getName();
}
return source.getBeanClassString();
-
+
}
+
+ public SmooksResourceListType analyzeMappingGraphModel(
+ SmooksConfigurationFileGenerateContext context)
+ throws SmooksAnalyzerException {
+ GraphRootModel root = context.getDataMappingRootModel();
+ SmooksResourceListType listType = this.analyzeGraphicalModel(root);
+ return listType;
+ }
}
Modified: workspace/dart/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2008-08-18
09:31:37 UTC (rev 9762)
+++ workspace/dart/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2008-08-18
09:59:55 UTC (rev 9763)
@@ -15,7 +15,8 @@
org.eclipse.jdt.core,
org.eclipse.jdt.ui,
org.eclipse.xsd,
- org.eclipse.ui.forms
+ org.eclipse.ui.forms,
+ org.jboss.tools.smooks.model
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AnalyzerFactory.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AnalyzerFactory.java
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AnalyzerFactory.java 2008-08-18
09:59:55 UTC (rev 9763)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * 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.analyzer;
+
+/**
+ * @author Dart Peng
+ * @Date Aug 19, 2008
+ */
+public class AnalyzerFactory {
+ protected static AnalyzerFactory instance = null;
+
+ protected AnalyzerFactory() {
+
+ }
+
+ /**
+ * @return the instance
+ */
+ public synchronized static AnalyzerFactory getInstance() {
+ if (instance == null) {
+ instance = new AnalyzerFactory();
+ }
+ return instance;
+ }
+
+ public IAnalyzer getAnalyzer(String sourceDataTypeID,String targetDataTypeID){
+ return null;
+ }
+}
Property changes on:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AnalyzerFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/IAnalyzer.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/IAnalyzer.java 2008-08-18
09:31:37 UTC (rev 9762)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/IAnalyzer.java 2008-08-18
09:59:55 UTC (rev 9763)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * 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,
@@ -10,10 +10,15 @@
******************************************************************************/
package org.jboss.tools.smooks.analyzer;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
+import org.milyn.xsd.smooks.SmooksResourceListType;
+
/**
* @author Dart Peng
- *
+ *
*/
public interface IAnalyzer {
-
+ public SmooksResourceListType analyzeMappingGraphModel(
+ SmooksConfigurationFileGenerateContext context)
+ throws SmooksAnalyzerException;
}
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksAnalyzerException.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksAnalyzerException.java
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksAnalyzerException.java 2008-08-18
09:59:55 UTC (rev 9763)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * 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.analyzer;
+
+/**
+ * @author Dart Peng
+ * @Date Aug 19, 2008
+ */
+public class SmooksAnalyzerException extends Exception {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -7107932620709349894L;
+
+
+ public SmooksAnalyzerException(String errorMessage){
+ super(errorMessage);
+ }
+}
Property changes on:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksAnalyzerException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksFileBuilder.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksFileBuilder.java
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksFileBuilder.java 2008-08-18
09:59:55 UTC (rev 9763)
@@ -0,0 +1,42 @@
+package org.jboss.tools.smooks.analyzer;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collections;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
+import org.milyn.xsd.smooks.DocumentRoot;
+import org.milyn.xsd.smooks.SmooksFactory;
+import org.milyn.xsd.smooks.SmooksResourceListType;
+import org.milyn.xsd.smooks.util.SmooksResourceFactoryImpl;
+
+public class SmooksFileBuilder {
+
+ public InputStream generateSmooksFile(
+ SmooksConfigurationFileGenerateContext context,
+ IProgressMonitor monitor) throws SmooksAnalyzerException, IOException {
+ AnalyzerFactory factory = AnalyzerFactory.getInstance();
+ IAnalyzer analyzer = factory.getAnalyzer(context.getSourceDataTypeID(),
+ context.getTargetDataTypeID());
+ if (analyzer == null)
+ throw new SmooksAnalyzerException(
+ "can't find the Analyzer for sourceID : "
+ + context.getSourceDataTypeID()
+ + " and the targetID : "
+ + context.getTargetDataTypeID());
+ SmooksResourceListType listType = analyzer
+ .analyzeMappingGraphModel(context);
+ Resource resource = new SmooksResourceFactoryImpl()
+ .createResource(null);
+ DocumentRoot dr = SmooksFactory.eINSTANCE.createDocumentRoot();
+ dr.setSmooksResourceList(listType);
+ resource.getContents().add(dr);
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ resource.save(outputStream, Collections.EMPTY_MAP);
+ return new ByteArrayInputStream(outputStream.toByteArray());
+ }
+}
Property changes on:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksFileBuilder.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-18
09:31:37 UTC (rev 9762)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-08-18
09:59:55 UTC (rev 9763)
@@ -10,6 +10,12 @@
******************************************************************************/
package org.jboss.tools.smooks.ui.editors;
+import java.io.IOException;
+import java.io.InputStream;
+
+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.draw2d.ColorConstants;
import org.eclipse.draw2d.ConnectionLayer;
@@ -30,14 +36,13 @@
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.TreeEvent;
-import org.eclipse.swt.events.TreeListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.FormPage;
@@ -47,6 +52,8 @@
import org.eclipse.ui.forms.widgets.Hyperlink;
import org.eclipse.ui.forms.widgets.ScrolledForm;
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.ui.IStrucutredDataCreationWizard;
import org.jboss.tools.smooks.ui.IViewerInitor;
import org.jboss.tools.smooks.ui.StructuredDataCreationWizardDailog;
@@ -60,6 +67,7 @@
import org.jboss.tools.smooks.ui.gef.tools.MappingPanelDropTargetListener;
import org.jboss.tools.smooks.ui.gef.tools.TargetTreeDropTargetListener;
import org.jboss.tools.smooks.ui.gef.util.GraphicsConstants;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
import org.jboss.tools.smooks.ui.wizards.TransformDataSelectionWizard;
import org.jboss.tools.smooks.utils.UIUtils;
@@ -67,7 +75,7 @@
* @author Dart Peng
* @Date Jul 28, 2008
*/
-public class SmooksGraphicalFormPage extends FormPage implements TreeListener {
+public class SmooksGraphicalFormPage extends FormPage {
protected IViewerInitor sourceViewerInitor;
protected IViewerInitor targetViewerInitor;
protected TreeViewer targetViewer;
@@ -81,22 +89,25 @@
protected int itemY = 0;
protected String sourceDataTypeID = null;
protected String targetDataTypeID = null;
+ protected SmooksFileBuilder smooksFileBuilder = null;
public SmooksGraphicalFormPage(FormEditor editor, String id, String title) {
super(editor, id, title);
editDomain = new DefaultEditDomain(this);
+ smooksFileBuilder = this.createSmooksFileBulder();
}
public SmooksGraphicalFormPage(String id, String title) {
super(id, title);
editDomain = new DefaultEditDomain(this);
+ smooksFileBuilder = this.createSmooksFileBulder();
}
@Override
protected void createFormContent(IManagedForm managedForm) {
final ScrolledForm form = managedForm.getForm();
FormToolkit toolkit = managedForm.getToolkit();
-
+
toolkit.decorateFormHeading(form.getForm());
GridLayout gridLayout = UIUtils.createGeneralFormEditorLayout(1);
gridLayout.horizontalSpacing = 0;
@@ -247,6 +258,10 @@
this.initGraphicalViewer();
}
+ protected SmooksFileBuilder createSmooksFileBulder() {
+ return new SmooksFileBuilder();
+ }
+
protected void initTargetTreeViewer() {
targetViewer.expandAll();
}
@@ -344,17 +359,52 @@
viewer.createControl(parent);
return viewer;
}
-
-
/* (non-Javadoc)
+ * @see org.eclipse.ui.forms.editor.FormPage#isDirty()
+ */
+ @Override
+ public boolean isDirty() {
+ // TODO Test
+ if(true) return true;
+ return super.isDirty();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see
org.eclipse.ui.forms.editor.FormPage#doSave(org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
public void doSave(IProgressMonitor monitor) {
+ SmooksFileBuilder builder = this.getSmooksFileBuilder();
+ SmooksConfigurationFileGenerateContext context = createContext();
+ try {
+ InputStream stream = builder.generateSmooksFile(context, monitor);
+ IFile file = ((IFileEditorInput) this.getEditorInput()).getFile();
+ if (file.exists()) {
+ file.setContents(stream, IResource.FORCE, monitor);
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ } catch (SmooksAnalyzerException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
super.doSave(monitor);
}
+ protected SmooksConfigurationFileGenerateContext createContext() {
+ SmooksConfigurationFileGenerateContext context = new
SmooksConfigurationFileGenerateContext();
+ return context;
+ }
+
+ protected void initSmooksConfigurationFileGenerateContext(
+ SmooksConfigurationFileGenerateContext context) {
+ context.setDataMappingRootModel(this.rootModel);
+ }
+
protected Composite createUISectionContainer(Composite parent, int columns) {
Composite container = getManagedForm().getToolkit().createComposite(
parent);
@@ -420,16 +470,16 @@
this.getEditDomain().addViewer(graphicalViewer);
}
- public void treeCollapsed(TreeEvent e) {
- rootModel.firePropertyChange(RootModel.P_REFRESH_PANEL, null,
- new Object());
- }
+ // public void treeCollapsed(TreeEvent e) {
+ // rootModel.firePropertyChange(RootModel.P_REFRESH_PANEL, null,
+ // new Object());
+ // }
+ //
+ // public void treeExpanded(TreeEvent e) {
+ // rootModel.firePropertyChange(RootModel.P_REFRESH_PANEL, null,
+ // new Object());
+ // }
- public void treeExpanded(TreeEvent e) {
- rootModel.firePropertyChange(RootModel.P_REFRESH_PANEL, null,
- new Object());
- }
-
public IViewerInitor getSourceViewerInitor() {
return sourceViewerInitor;
}
@@ -486,6 +536,7 @@
private class DataSelectLinkListener implements IHyperlinkListener {
TreeViewer viewer = null;
+
public DataSelectLinkListener(TreeViewer viewer) {
this.viewer = viewer;
}
@@ -519,4 +570,19 @@
}
+ /**
+ * @return the smooksFileBuilder
+ */
+ protected SmooksFileBuilder getSmooksFileBuilder() {
+ return smooksFileBuilder;
+ }
+
+ /**
+ * @param smooksFileBuilder
+ * the smooksFileBuilder to set
+ */
+ protected void setSmooksFileBuilder(SmooksFileBuilder smooksFileBuilder) {
+ this.smooksFileBuilder = smooksFileBuilder;
+ }
+
}
Modified:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/SmooksEditPartFactory.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/SmooksEditPartFactory.java 2008-08-18
09:31:37 UTC (rev 9762)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/SmooksEditPartFactory.java 2008-08-18
09:59:55 UTC (rev 9763)
@@ -30,20 +30,16 @@
*/
public EditPart createEditPart(EditPart context, Object model) {
EditPart part = getPartForElement(model);
+ if (part != null)
+ part.setModel(model);
- // l����������
- //
- part.setModel(model);
-
return part;
}
/**
- * ���ģ�ʹ���EditPart
*
* @param modelElement
- * �
- * @return EditPart
+ * @return
*/
private EditPart getPartForElement(Object modelElement) {
Modified:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java 2008-08-18
09:31:37 UTC (rev 9762)
+++
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java 2008-08-18
09:59:55 UTC (rev 9763)
@@ -10,16 +10,23 @@
******************************************************************************/
package org.jboss.tools.smooks.ui.modelparser;
-import org.jboss.tools.smooks.ui.gef.model.RootModel;
+import org.jboss.tools.smooks.ui.gef.model.GraphRootModel;
/**
* @author Dart Peng
* @Date Aug 18, 2008
*/
public class SmooksConfigurationFileGenerateContext {
+
+ public static final String TYPE_SAX = "sax";
+
+ public static final String TYPE_DOM = "sax";
+
protected String sourceDataTypeID = null;
protected String targetDataTypeID = null;
- protected RootModel dataMappingRootModel;
+ protected GraphRootModel dataMappingRootModel;
+
+ protected String smooksType = null;
/**
* @return the sourceDataTypeID
*/
@@ -47,15 +54,27 @@
/**
* @return the dataMappingRootModel
*/
- public RootModel getDataMappingRootModel() {
+ public GraphRootModel getDataMappingRootModel() {
return dataMappingRootModel;
}
/**
* @param dataMappingRootModel the dataMappingRootModel to set
*/
- public void setDataMappingRootModel(RootModel dataMappingRootModel) {
+ public void setDataMappingRootModel(GraphRootModel dataMappingRootModel) {
this.dataMappingRootModel = dataMappingRootModel;
}
+ /**
+ * @return the smooksType
+ */
+ public String getSmooksType() {
+ return smooksType;
+ }
+ /**
+ * @param smooksType the smooksType to set
+ */
+ public void setSmooksType(String smooksType) {
+ this.smooksType = smooksType;
+ }
}