JBoss Tools SVN: r9890 - in workspace/dart/plugins: org.jboss.tools.smooks.ui/graphical and 6 other directories.
by jbosstools-commits@lists.jboss.org
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.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_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);
16 years, 4 months
JBoss Tools SVN: r9888 - in workspace/Denny/org.jboss.tools.esb.project: META-INF and 12 other directories.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-08-25 22:02:04 -0400 (Mon, 25 Aug 2008)
New Revision: 9888
Added:
workspace/Denny/org.jboss.tools.esb.project/.classpath
workspace/Denny/org.jboss.tools.esb.project/.project
workspace/Denny/org.jboss.tools.esb.project/META-INF/
workspace/Denny/org.jboss.tools.esb.project/META-INF/MANIFEST.MF
workspace/Denny/org.jboss.tools.esb.project/bin/
workspace/Denny/org.jboss.tools.esb.project/build.properties
workspace/Denny/org.jboss.tools.esb.project/plugin.properties
workspace/Denny/org.jboss.tools.esb.project/plugin.xml
workspace/Denny/org.jboss.tools.esb.project/src/
workspace/Denny/org.jboss.tools.esb.project/src/org/
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/JBossWSCorePlugin.java
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/JBossRuntime.java
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/JBossRuntimeClassPathInitializer.java
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/JBossRuntimeListConverter.java
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/JBossRuntimeManager.java
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/command/
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/command/JBossClassPathCommand.java
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/command/UninstallJBossClassPathCommand.java
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/IJBossESBFacetDataModelProperties.java
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/JBossESBFacetInstallationConfig.java
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/JBossESBFacetInstallationDelegate.java
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/UnInstallJBossRuntimeDelegate.java
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/messages/
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/messages/JBossFacetCore.properties
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/messages/JBossFacetCoreMessages.java
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/nature/
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/nature/JBossESBProjectNature.java
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/utils/
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/utils/JBossRuntimeCoreUtils.java
workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/utils/StatusUtils.java
Log:
esb facet definition
Added: workspace/Denny/org.jboss.tools.esb.project/.classpath
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/.classpath (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/.classpath 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <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="output" path="bin"/>
+</classpath>
Added: workspace/Denny/org.jboss.tools.esb.project/.project
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/.project (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/.project 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.esb.project</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: workspace/Denny/org.jboss.tools.esb.project/META-INF/MANIFEST.MF
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/META-INF/MANIFEST.MF (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/META-INF/MANIFEST.MF 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,32 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %PLUGIN_NAME
+Bundle-SymbolicName: org.jboss.tools.esb.project;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Localization: plugin
+Bundle-Activator: org.jboss.tools.esb.project.JBossWSCorePlugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.wst.common.frameworks,
+ org.eclipse.core.resources,
+ org.eclipse.jst.ws,
+ org.eclipse.jdt.core,
+ org.eclipse.jdt.launching,
+ org.eclipse.jst.jsf.core,
+ org.eclipse.jst.jsf.ui,
+ org.eclipse.wst.common.modulecore,
+ org.eclipse.jdt.launching,
+ org.eclipse.jst.jsf.core,
+ org.eclipse.jst.jsf.ui,
+ org.eclipse.jdt.launching,
+ org.eclipse.jst.j2ee,
+ org.eclipse.jst.ws.consumption.ui
+Bundle-ActivationPolicy: lazy
+Bundle-Vendor: %PLUGIN_PROVIDER
+Export-Package: org.jboss.tools.esb.project,
+ org.jboss.tools.esb.project.classpath,
+ org.jboss.tools.esb.project.command,
+ org.jboss.tools.esb.project.facet,
+ org.jboss.tools.esb.project.messages,
+ org.jboss.tools.esb.project.utils
Added: workspace/Denny/org.jboss.tools.esb.project/build.properties
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/build.properties (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/build.properties 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties
Added: workspace/Denny/org.jboss.tools.esb.project/plugin.properties
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/plugin.properties (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/plugin.properties 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,12 @@
+PLUGIN_NAME=JBossWS Core
+PLUGIN_PROVIDER=Red Hat, Inc.
+
+JBOSSWS_CATOGERY_LABEL=JBoss Web Services
+JBOSSWS_CATOGERY_DISCRIPTION=Enables Web services generation through the JBoss Web services engine.
+
+JBOSSWS_FACET_CORE_LABEL=JBoss Web Services Core
+JBOSSWS_FACET_CORE_DISCRIPTION=Prepares the project for Web services generation through the JBoss Web services engine.
+
+
+JBOSSWS_FACET_EXT_LABEL=JBoss Web Services Extensions
+JBOSSWS_FACET_EXT_DISCRIPTION=Prepares the project for additional Web services support with the JBoss Web services runtime.
\ No newline at end of file
Added: workspace/Denny/org.jboss.tools.esb.project/plugin.xml
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/plugin.xml (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/plugin.xml 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,104 @@
+<plugin>
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.facets">
+ <project-facet
+ id="jboss.esb">
+ <label>
+ JBoss ESB
+ </label>
+ </project-facet>
+ <project-facet-version
+ facet="jboss.esb"
+ version="4.2">
+ <action
+ facet="jboss.esb"
+ type="install"
+ version="4.2">
+ <delegate
+ class="org.jboss.tools.esb.project.facet.JBossESBFacetInstallationDelegate">
+ </delegate>
+ <config-factory
+ class="org.jboss.tools.esb.project.facet.JBossESBFacetInstallationConfig">
+ </config-factory>
+ </action>
+ </project-facet-version>
+ <project-facet-version
+ facet="jboss.esb"
+ version="4.3">
+ <action
+ facet="jboss.esb"
+ id="jboss.esb.install"
+ type="install"
+ version="4.3">
+ <delegate
+ class="org.jboss.tools.esb.project.facet.JBossESBFacetInstallationDelegate">
+ </delegate>
+ <config-factory
+ class="org.jboss.tools.esb.project.facet.JBossESBFacetInstallationConfig">
+ </config-factory>
+ </action>
+ </project-facet-version>
+ <template
+ id="template.jboss.esb">
+ <label>
+ label body text
+ </label>
+ <fixed
+ facet="jboss.esb">
+ </fixed>
+ <fixed
+ facet="jst.java">
+ </fixed>
+ </template>
+ </extension>
+ <extension
+ id="ESBNature"
+ name="JBoss ESB Nature"
+ point="org.eclipse.core.resources.natures">
+ <runtime>
+ <run
+ class="org.jboss.tools.esb.projects.nature.JBossESBProjectNature">
+ </run>
+ </runtime>
+ <requires-nature
+ id="org.eclipse.wst.common.project.facet.core.nature">
+ </requires-nature>
+ </extension>
+ <extension
+ point="org.eclipse.ui.ide.projectNatureImages">
+ <image
+ icon="esbproject.image3"
+ id="org.jboss.esb.project.esbnature.image"
+ natureId="org.jboss.esb.project.esbnature">
+ </image>
+ </extension>
+ <extension
+ point="org.eclipse.wst.server.core.moduleTypes">
+ <moduleType
+ id="jboss.esb"
+ name="JBoss ESB Module">
+ </moduleType>
+ </extension>
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.runtimes">
+ <supported>
+ <facet
+ id="jboss.esb"
+ version="4.2,4.3">
+ </facet>
+ <runtime-component
+ id="org.jboss.ide.eclipse.as.runtime.component"
+ version="4.2">
+ </runtime-component>
+ </supported>
+ </extension>
+ <extension
+ point="org.eclipse.jdt.core.classpathContainerInitializer">
+ <classpathContainerInitializer
+ class="org.jboss.tools.esb.project.classpath.JBossRuntimeClassPathInitializer"
+ id="JBoss_ESB_Runtime">
+ </classpathContainerInitializer>
+ </extension>
+
+
+</plugin>
Added: workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/JBossWSCorePlugin.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/JBossWSCorePlugin.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/JBossWSCorePlugin.java 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * 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.esb.project;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class JBossWSCorePlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.ws.core";
+
+ // The shared instance
+ private static JBossWSCorePlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public JBossWSCorePlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static JBossWSCorePlugin getDefault() {
+ return plugin;
+ }
+
+}
Added: workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/JBossRuntime.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/JBossRuntime.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/JBossRuntime.java 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * 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.esb.project.classpath;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Grid Qian
+ */
+public class JBossRuntime {
+
+ String name = null;
+
+ String homeDir = null;
+
+ String version = null;
+
+ boolean defaultRt = false;
+
+ List<String> libraries;
+
+ private boolean userConfigClasspath;
+
+ /**
+ * Default constructor
+ */
+ public JBossRuntime() {
+ libraries = new ArrayList<String>();
+ }
+
+ /**
+ * Get JBossWSRuntime name
+ *
+ * @return name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Get path to home directory
+ *
+ * @return home directory path as string
+ */
+ public String getHomeDir() {
+ return homeDir;
+ }
+
+ /**
+ * Set JBossWSRuntime name
+ *
+ * @param name
+ * new JBossWSRuntime name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Set home directory
+ *
+ * @param homeDir
+ * new JBossWSRuntime's home directory
+ */
+ public void setHomeDir(String homeDir) {
+ this.homeDir = homeDir;
+ }
+
+ /**
+ * Mark runtime as default
+ *
+ * @param b
+ * new value for default property
+ */
+ public void setDefault(boolean b) {
+ this.defaultRt = b;
+ }
+
+ /**
+ * Get default flag
+ *
+ * @return default property
+ */
+ public boolean isDefault() {
+ return defaultRt;
+ }
+
+ public List<String> getLibraries(){
+
+ return this.libraries;
+ }
+
+ public void setLibraries(List<String> libraries){
+ this.libraries = libraries;
+ }
+
+ public boolean isUserConfigClasspath(){
+ return this.userConfigClasspath;
+ }
+
+ public void setUserConfigClasspath(boolean userConfigClasspath){
+ this.userConfigClasspath = userConfigClasspath;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+}
Added: workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/JBossRuntimeClassPathInitializer.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/JBossRuntimeClassPathInitializer.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/JBossRuntimeClassPathInitializer.java 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * 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.esb.project.classpath;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.ClasspathContainerInitializer;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.jboss.tools.esb.project.messages.JBossFacetCoreMessages;
+
+/**
+ * @author Grid Qian
+ */
+public class JBossRuntimeClassPathInitializer extends
+ ClasspathContainerInitializer {
+
+ public JBossRuntimeClassPathInitializer() {
+ }
+
+ private String segment;
+
+ @Override
+ public void initialize(IPath containerPath, IJavaProject project)
+ throws CoreException {
+
+ if (containerPath.segment(0).equals(
+ JBossFacetCoreMessages.JBossWS_Runtime_Lib)) {
+ JBossWSRuntimeClasspathContainer container = new JBossWSRuntimeClasspathContainer(
+ containerPath);
+ segment = containerPath.segment(1);
+ JavaCore.setClasspathContainer(containerPath,
+ new IJavaProject[] { project },
+ new IClasspathContainer[] { container }, null);
+ }
+ }
+
+ public IClasspathEntry[] getEntries(IPath path) {
+ return new JBossWSRuntimeClasspathContainer(path).getClasspathEntries();
+ }
+
+ public class JBossWSRuntimeClasspathContainer implements
+ IClasspathContainer {
+ private IPath path;
+ private IClasspathEntry[] entries = null;
+
+ public JBossWSRuntimeClasspathContainer(IPath path) {
+ this.path = path;
+ }
+
+ public String getDescription() {
+ return JBossFacetCoreMessages.JBossWS_Runtime;
+ }
+
+ public int getKind() {
+ return IClasspathContainer.K_APPLICATION;
+ }
+
+ public IPath getPath() {
+ return path;
+ }
+
+ public IClasspathEntry[] getClasspathEntries() {
+ if (entries == null) {
+ ArrayList<IClasspathEntry> entryList = new ArrayList<IClasspathEntry>();
+ JBossRuntime jbws = JBossRuntimeManager.getInstance()
+ .findRuntimeByName(segment);
+ if (jbws != null) {
+
+ List<String> jars = JBossRuntimeManager.getInstance().getAllRuntimeJars(jbws);
+ for (String jar : jars) {
+ entryList.add(getEntry(new Path(jar)));
+ }
+ entries = entryList.toArray(new IClasspathEntry[entryList.size()]);
+ if (entries == null)
+ return new IClasspathEntry[0];
+ }
+ }
+ return entries;
+ }
+
+ protected IClasspathEntry getEntry(IPath path) {
+ return JavaRuntime.newArchiveRuntimeClasspathEntry(path)
+ .getClasspathEntry();
+ }
+
+ public void removeEntry(String jarName) {
+ if (entries == null) {
+ return;
+ }
+ IClasspathEntry[] newEntries = new IClasspathEntry[entries.length - 1];
+ int i = 0;
+ for (IClasspathEntry entry : entries) {
+ if (!entry.toString().contains(jarName)) {
+ newEntries[i++] = entry;
+ }
+ }
+ entries = newEntries;
+ }
+
+ }
+
+ public boolean filterJars(String jarName, ArrayList<IClasspathEntry> list) {
+ for (IClasspathEntry entry : list) {
+ if (entry.getPath().lastSegment().equals(jarName)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+}
Added: workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/JBossRuntimeListConverter.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/JBossRuntimeListConverter.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/JBossRuntimeListConverter.java 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,141 @@
+package org.jboss.tools.esb.project.classpath;
+
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+
+/**
+ *
+ * @author Grid Qian
+ *
+ */
+public class JBossRuntimeListConverter {
+
+ /*
+ * Constants definitions
+ */
+ private static final String REGEXP_ESCAPE = "\\";
+ private static final String COMMA = ",";
+ private static final String LIBRARY_SEPARATOR = ";";
+ private static final String EMPTY_STRING = "";
+ private static final String FIELD_SEPARATOR = "|";
+ private static final String DEFAULT = "default";
+ private static final String HOME_DIR = "homeDir";
+ private static final String VERSION = "version";
+ private static final String NAME = "name";
+ private static final String USER_CONFIG_CLASSPATH = "userConfig";
+ private static final String LIBRARY = "libraries";
+
+ /**
+ * Load String to JBossWSRuntime map from String
+ * @param input
+ * String representation of map
+ * @return
+ * Map<String, JBossWSRuntime> loaded from string
+ * TODO - switch to XML?
+ * TODO - write converter from old serialization format to XML?
+ * TODO - handle errors in string format
+ */
+ public Map<String, JBossRuntime> getMap(String input) {
+
+ Map<String, JBossRuntime> result = new HashMap<String, JBossRuntime>();
+ if (input == null || EMPTY_STRING.equals(input.trim())) {
+ return result;
+ }
+ StringTokenizer runtimes = new StringTokenizer(input, COMMA);
+ while (runtimes.hasMoreTokens()) {
+ String runtime = runtimes.nextToken();
+ String[] map = runtime.split(REGEXP_ESCAPE + FIELD_SEPARATOR);
+ JBossRuntime rt = new JBossRuntime();
+ final int step = 2;
+ for (int i = 0; i < map.length; i += step) {
+ String name = map[i];
+ String value = i + 1 < map.length ? map[i + 1] : EMPTY_STRING;
+ if (NAME.equals(name)) {
+ rt.setName(value);
+ } else if (HOME_DIR.equals(name)) {
+ rt.setHomeDir(value);
+ } else if (VERSION.equals(name)) {
+ rt.setVersion(value);
+ } else if (DEFAULT.equals(name)) {
+ rt.setDefault(Boolean.parseBoolean(value));
+ }else if(USER_CONFIG_CLASSPATH.equals(name)){
+ rt.setUserConfigClasspath(Boolean.parseBoolean(value));
+ }else if(LIBRARY.equals(name)){
+ if(value != null && !EMPTY_STRING.equals(value)){
+ rt.setLibraries(getLibrariesFromString(value));
+ }
+ }
+
+ }
+ result.put(rt.getName(), rt);
+ }
+
+ return result;
+ }
+
+ private List<String> getLibrariesFromString(String strLibraries){
+ List<String> libraries = new ArrayList<String>();
+ StringTokenizer st = new StringTokenizer(strLibraries, LIBRARY_SEPARATOR);
+ while(st.hasMoreTokens()){
+ String library = st.nextToken();
+ if(!libraries.contains(library)){
+ libraries.add(library);
+ }
+ }
+ return libraries;
+
+ }
+
+ private String convertListToString(List<String> libraries){
+ String strLib = "";
+ for(String library: libraries){
+ if("".equals(strLib)){
+ strLib = library;
+ }else{
+ strLib = strLib + LIBRARY_SEPARATOR + library;
+ }
+ }
+ return strLib;
+ }
+
+ /**
+ * Convert map String to JBossWSRUntime to string representation
+ * @param runtimeMap
+ * Map<String, JBossWSRuntime> - map of String to JBossWS Runtime to convert
+ * in String
+ * @return
+ * String representation of String to JBossWS Runtime map
+ */
+ public String getString(Map<String, JBossRuntime> runtimeMap) {
+ StringBuffer buffer = new StringBuffer();
+ JBossRuntime[] runtimes = runtimeMap.values().toArray(
+ new JBossRuntime[runtimeMap.size()]);
+ for (int i = 0; i < runtimes.length; i++) {
+ buffer.append(NAME).append(FIELD_SEPARATOR);
+ buffer.append(runtimes[i].getName());
+ buffer.append(FIELD_SEPARATOR).append(VERSION).append(
+ FIELD_SEPARATOR);
+ buffer.append(runtimes[i].getVersion());
+ buffer.append(FIELD_SEPARATOR).append(HOME_DIR).append(
+ FIELD_SEPARATOR);
+ buffer.append(runtimes[i].getHomeDir());
+ buffer.append(FIELD_SEPARATOR).append(DEFAULT).append(
+ FIELD_SEPARATOR);
+ buffer.append(runtimes[i].isDefault());
+ buffer.append(FIELD_SEPARATOR).append(USER_CONFIG_CLASSPATH).append(FIELD_SEPARATOR);
+ buffer.append(runtimes[i].isUserConfigClasspath());
+ buffer.append(FIELD_SEPARATOR).append(LIBRARY).append(FIELD_SEPARATOR);
+ buffer.append(convertListToString(runtimes[i].getLibraries()));
+ if (i != runtimes.length - 1) {
+ buffer.append(COMMA);
+ }
+ }
+ return buffer.toString();
+ }
+ }
+
Added: workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/JBossRuntimeManager.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/JBossRuntimeManager.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/classpath/JBossRuntimeManager.java 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,359 @@
+/*******************************************************************************
+ * 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.esb.project.classpath;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.jface.preference.IPersistentPreferenceStore;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.jboss.tools.esb.project.JBossWSCorePlugin;
+import org.jboss.tools.esb.project.facet.IJBossESBFacetDataModelProperties;
+import org.jboss.tools.esb.project.messages.JBossFacetCoreMessages;
+
+/**
+ * @author Grid Qian
+ */
+public class JBossRuntimeManager {
+
+ private static JBossRuntimeListConverter converter = new JBossRuntimeListConverter();
+
+ private Map<String, JBossRuntime> runtimes = new HashMap<String, JBossRuntime>();
+
+ /**
+ * Private constructor
+ */
+ private JBossRuntimeManager() {
+ load();
+ }
+
+ /**
+ * This class make Java Runtime responsible for solving synchronization
+ * problems during initialization if there is any
+ *
+ */
+ static class JBossRuntimeManagerHolder {
+ private static final JBossRuntimeManager INSTANCE = new JBossRuntimeManager();
+ }
+
+ /**
+ * Return JBossWSRuntimeManaher instance
+ *
+ * @return JBossWSRuntimeManager instance
+ */
+ public static JBossRuntimeManager getInstance() {
+ return JBossRuntimeManagerHolder.INSTANCE;
+ }
+
+ /**
+ * Return Array of configured JBossWSRuntimes
+ *
+ * @return JBossWSRuntime[]
+ */
+ public JBossRuntime[] getRuntimes() {
+ Collection<JBossRuntime> c = runtimes.values();
+ return c.toArray(new JBossRuntime[runtimes.size()]);
+ }
+
+ /**
+ * Add new JBossWSRuntime
+ *
+ * @param runtime
+ * JBossWSRuntime
+ */
+ public void addRuntime(JBossRuntime runtime) {
+ if (runtimes.size() == 0) {
+ runtime.setDefault(true);
+ }
+
+ JBossRuntime oldDefaultRuntime = getDefaultRuntime();
+ if (oldDefaultRuntime != null && runtime.isDefault()) {
+ oldDefaultRuntime.setDefault(false);
+ }
+ runtimes.put(runtime.getName(), runtime);
+ save();
+ }
+
+ /**
+ * Add new JBossWSRuntime with given parameters
+ *
+ * @param name
+ * String - runtime name
+ * @param path
+ * String - runtime home folder
+ * @param version
+ * String - string representation of version number
+ * @param defaultRt
+ * boolean - default flag
+ */
+ public void addRuntime(String name, String path, String version,
+ boolean defaultRt) {
+ JBossRuntime jbossWSRt = new JBossRuntime();
+ jbossWSRt.setHomeDir(path);
+ jbossWSRt.setName(name);
+ jbossWSRt.setVersion(version);
+ jbossWSRt.setDefault(defaultRt);
+ addRuntime(jbossWSRt);
+ }
+
+ /**
+ * Return JBossWSRuntime by given name
+ *
+ * @param name
+ * String - JBossWSRuntime name
+ * @return JBossWSRuntime - found JBossWSRuntime instance or null
+ */
+ public JBossRuntime findRuntimeByName(String name) {
+ for (JBossRuntime jbossWSRuntime : runtimes.values()) {
+ if (jbossWSRuntime.getName().equals(name)) {
+ return jbossWSRuntime;
+ }
+ }
+ return null;
+ }
+
+ public List<String> getAllRuntimeJars(JBossRuntime rt){
+ List<String> jarList = new ArrayList<String>();
+ if (rt != null) {
+ if (rt.isUserConfigClasspath()) {
+ jarList.addAll(rt.getLibraries());
+
+ } else {
+ IPath wsPath = new Path(rt.getHomeDir());
+ if (wsPath != null) {
+ IPath libPath = wsPath
+ .append(JBossFacetCoreMessages.Dir_Lib);
+ List<File> libs = getJarsOfFolder(libPath.toFile());
+ libPath = wsPath
+ .append(JBossFacetCoreMessages.Dir_Client);
+ List<File> clientJars = getJarsOfFolder(libPath.toFile());
+
+ jarList = mergeTwoList(libs, clientJars);
+ }
+ }
+
+ }
+ return jarList;
+ }
+
+
+
+ private List<File> getJarsOfFolder(File folder){
+ List<File> jars = new ArrayList<File>();
+ if(folder.isDirectory()){
+ for(File file: folder.listFiles()){
+ if(file.isFile() && (file.getName().endsWith(".jar") || file.getName().endsWith(".zip"))){
+ jars.add(file);
+ }else if (folder.isDirectory()){
+ jars.addAll(getJarsOfFolder(file));
+ }
+ }
+ }
+
+ return jars;
+ }
+
+ // if two folders have the same jar file, one of them will be ignored.
+ private List<String> mergeTwoList(List<File> jarList1, List<File> jarList2){
+ List<String> rtList = new ArrayList<String>();
+ List<String> distinctFileNames = new ArrayList<String>();
+
+ for(File jarFile: jarList1){
+ distinctFileNames.add(jarFile.getName());
+ rtList.add(jarFile.getAbsolutePath());
+ }
+ for(File jarFile: jarList2){
+ if(!distinctFileNames.contains(jarFile.getName())){
+ rtList.add(jarFile.getAbsolutePath());
+ }
+ }
+
+ return rtList;
+
+ }
+
+ /**
+ * Remove given JBossWSRuntime from manager
+ *
+ * @param rt
+ * JBossWSRuntime
+ */
+ public void removeRuntime(JBossRuntime rt) {
+ runtimes.remove(rt.getName());
+ }
+
+ /**
+ * Save preference value and force save changes to disk
+ */
+ public void save() {
+ JBossWSCorePlugin.getDefault().getPreferenceStore().setValue(
+ JBossFacetCoreMessages.WS_Location, converter.getString(runtimes));
+ IPreferenceStore store = JBossWSCorePlugin.getDefault()
+ .getPreferenceStore();
+ if (store instanceof IPersistentPreferenceStore) {
+ try {
+ ((IPersistentPreferenceStore) store).save();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * Marks this runtime as default. Marks other runtimes with the same version
+ * as not default.
+ *
+ * @param runtime
+ */
+ public void setDefaultRuntime(JBossRuntime runtime) {
+ JBossRuntime[] runtimes = getRuntimes();
+ for (int i = 0; i < runtimes.length; i++) {
+ runtimes[i].setDefault(false);
+ }
+ runtime.setDefault(true);
+ }
+
+ /**
+ * Return first default JBossWSRuntime
+ *
+ * @return JBossWSRuntime
+ */
+ public JBossRuntime getDefaultRuntime() {
+ for (JBossRuntime rt : runtimes.values()) {
+ if (rt.isDefault()) {
+ return rt;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Return list of available JBossWSRuntime names
+ *
+ * @return List<String>
+ */
+ public List<String> getRuntimeNames() {
+ JBossRuntime[] rts = getRuntimes();
+ List<String> result = new ArrayList<String>();
+ for (JBossRuntime jbossWSRuntime : rts) {
+ result.add(jbossWSRuntime.getName());
+ }
+ return result;
+ }
+
+ /**
+ * Return a list of all runtime names
+ *
+ * @return List of all runtime names
+ */
+ public List<String> getAllRuntimeNames() {
+ JBossRuntime[] rts = getRuntimes();
+ List<String> result = new ArrayList<String>();
+ for (JBossRuntime jbossWSRuntime : rts) {
+ result.add(jbossWSRuntime.getName());
+ }
+ return result;
+ }
+
+ /**
+ * TBD
+ *
+ * @param oldName
+ * old runtime name
+ * @param newName
+ * new runtime name
+ */
+ public void changeRuntimeName(String oldName, String newName) {
+ JBossRuntime o = findRuntimeByName(oldName);
+ if (o == null) {
+ return;
+ }
+ o.setName(newName);
+ onRuntimeNameChanged(oldName, newName);
+ }
+
+ private void onRuntimeNameChanged(String oldName, String newName) {
+ IProjectFacet facet = ProjectFacetsManager
+ .getProjectFacet("jbossws.core");
+ Set<IFacetedProject> facetedProjects = null;
+ try {
+ facetedProjects = ProjectFacetsManager.getFacetedProjects(facet);
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ for (IFacetedProject facetedProject : facetedProjects) {
+ QualifiedName qRuntimeName = IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME;
+ String name = null;
+ try {
+ name = facetedProject.getProject().getPersistentProperty(
+ qRuntimeName);
+ if (name != null && name.equals(oldName)) {
+ facetedProject.getProject().setPersistentProperty(
+ qRuntimeName, newName);
+ }
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+ }
+
+ public static boolean isRuntimeUsed(String name) {
+ IProjectFacet facet = ProjectFacetsManager
+ .getProjectFacet("jbossws.core");
+ Set<IFacetedProject> facetedProjects = null;
+ try {
+ facetedProjects = ProjectFacetsManager.getFacetedProjects(facet);
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ for (IFacetedProject facetedProject : facetedProjects) {
+ QualifiedName qRuntimeName = IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME;
+ try {
+ if (name.equals(facetedProject.getProject()
+ .getPersistentProperty(qRuntimeName))) {
+ return true;
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+ return false;
+ }
+
+ public void load() {
+ IPreferenceStore ps = JBossWSCorePlugin.getDefault()
+ .getPreferenceStore();
+
+ String runtimeListString = ps
+ .getString(JBossFacetCoreMessages.WS_Location);
+
+ runtimes = converter.getMap(runtimeListString);
+ }
+
+}
\ No newline at end of file
Added: workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/command/JBossClassPathCommand.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/command/JBossClassPathCommand.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/command/JBossClassPathCommand.java 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * 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.esb.project.command;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IClasspathAttribute;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil;
+import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.jboss.tools.esb.project.facet.IJBossESBFacetDataModelProperties;
+import org.jboss.tools.esb.project.messages.JBossFacetCoreMessages;
+import org.jboss.tools.esb.project.utils.StatusUtils;
+
+/**
+ * @author Grid Qian
+ */
+public class JBossClassPathCommand extends AbstractDataModelOperation {
+
+ IProject project;
+ private IDataModel model;
+
+ public JBossClassPathCommand(IProject project, IDataModel model) {
+ this.project = project;
+ this.model = model;
+ }
+
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+ return executeOverride(monitor);
+ }
+
+ public IStatus executeOverride(IProgressMonitor monitor) {
+ IStatus status = Status.OK_STATUS;
+ try {
+ boolean isServerSupplied = model
+ .getBooleanProperty(IJBossESBFacetDataModelProperties.RUNTIME_IS_SERVER_SUPPLIED);
+ if (isServerSupplied) {
+ project
+ .setPersistentProperty(
+ IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_SERVER_SUPPLIED_RUNTIME,
+ IJBossESBFacetDataModelProperties.DEFAULT_VALUE_IS_SERVER_SUPPLIED);
+ } else {
+ // store runtime name and runtime location to the project
+
+ String runtimeName = model
+ .getStringProperty(IJBossESBFacetDataModelProperties.RUNTIME_ID);
+ String runtimeLocation = model
+ .getStringProperty(IJBossESBFacetDataModelProperties.RUNTIME_HOME);
+ project
+ .setPersistentProperty(
+ IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME,
+ runtimeName);
+ project
+ .setPersistentProperty(
+ IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_RNTIME_LOCATION,
+ runtimeLocation);
+ boolean isDeployed = model
+ .getBooleanProperty(IJBossESBFacetDataModelProperties.RUNTIME_DEPLOY);
+
+ status = addClassPath(project, runtimeName, isDeployed);
+ }
+
+ } catch (CoreException e) {
+ status = StatusUtils.errorStatus(
+ JBossFacetCoreMessages.Error_Add_Facet_JBossWS, e);
+ }
+ return status;
+ }
+
+ public IStatus addClassPath(IProject project, String segment,
+ boolean isDeployed) {
+ IStatus status = Status.OK_STATUS;
+ try {
+
+ IClasspathEntry newClasspath;
+ IJavaProject javaProject = JavaCore.create(project);
+
+ if (isDeployed) {
+ IClasspathAttribute depAttrib = JavaCore
+ .newClasspathAttribute(
+ IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY,
+ ClasspathDependencyUtil.getDefaultRuntimePath(
+ true).toString());
+ newClasspath = JavaCore.newContainerEntry(new Path(
+ JBossFacetCoreMessages.JBossWS_Runtime_Lib)
+ .append(segment), null,
+ new IClasspathAttribute[] { depAttrib }, true);
+ } else {
+ newClasspath = JavaCore.newContainerEntry(new Path(
+ JBossFacetCoreMessages.JBossWS_Runtime_Lib)
+ .append(segment));
+ }
+
+ IClasspathEntry[] oldClasspathEntries = javaProject
+ .readRawClasspath();
+
+ boolean isFolderInClassPathAlready = false;
+ for (int i = 0; i < oldClasspathEntries.length
+ && !isFolderInClassPathAlready; i++) {
+ if (oldClasspathEntries[i].getPath().equals(
+ newClasspath.getPath())) {
+ isFolderInClassPathAlready = true;
+ break;
+ }
+ }
+
+ if (!isFolderInClassPathAlready) {
+
+ IClasspathEntry[] newClasspathEntries = new IClasspathEntry[oldClasspathEntries.length + 1];
+ for (int i = 0; i < oldClasspathEntries.length; i++) {
+ newClasspathEntries[i] = oldClasspathEntries[i];
+ }
+ newClasspathEntries[oldClasspathEntries.length] = newClasspath;
+
+ javaProject.setRawClasspath(newClasspathEntries,
+ new NullProgressMonitor());
+ }
+ } catch (JavaModelException e) {
+ status = StatusUtils.errorStatus(NLS.bind(
+ JBossFacetCoreMessages.Error_Copy, new String[] { e
+ .getLocalizedMessage() }), e);
+ return status;
+ }
+
+ return status;
+ }
+
+}
\ No newline at end of file
Added: workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/command/UninstallJBossClassPathCommand.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/command/UninstallJBossClassPathCommand.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/command/UninstallJBossClassPathCommand.java 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,102 @@
+package org.jboss.tools.esb.project.command;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.jboss.tools.esb.project.facet.IJBossESBFacetDataModelProperties;
+import org.jboss.tools.esb.project.messages.JBossFacetCoreMessages;
+import org.jboss.tools.esb.project.utils.StatusUtils;
+
+public class UninstallJBossClassPathCommand {
+ IProject project;
+
+ public UninstallJBossClassPathCommand(IProject project, IDataModel model) {
+ this.project = project;
+ }
+
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+ return executeOverride(monitor);
+ }
+
+ public IStatus executeOverride(IProgressMonitor monitor) {
+ IStatus status = Status.OK_STATUS;
+ try {
+ boolean isServerSupplied = Boolean
+ .getBoolean(project
+ .getPersistentProperty(IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_SERVER_SUPPLIED_RUNTIME));
+ if (isServerSupplied) {
+// project
+// .getPersistentProperties()
+// .remove(
+// IJBossWSFacetDataModelProperties.PERSISTENCE_PROPERTY_SERVER_SUPPLIED_RUNTIME);
+ } else {
+// project
+// .getPersistentProperties()
+// .remove(
+// IJBossWSFacetDataModelProperties.PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME);
+// project
+// .getPersistentProperties()
+// .remove(
+// IJBossWSFacetDataModelProperties.PERSISTENCE_PROPERTY_RNTIME_LOCATION);
+ String runtimeName = project
+ .getPersistentProperty(IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME);
+
+ status = removeClassPath(project, runtimeName);
+ }
+
+ } catch (CoreException e) {
+ status = StatusUtils.errorStatus(
+ JBossFacetCoreMessages.Error_Remove_Facet_JBossWS, e);
+ }
+ return status;
+ }
+
+ public IStatus removeClassPath(IProject project, String segment) {
+ IStatus status = Status.OK_STATUS;
+ try {
+ IJavaProject javaProject = JavaCore.create(project);
+ IClasspathEntry[] oldClasspathEntries = javaProject
+ .readRawClasspath();
+
+ boolean isFolderInClassPathAlready = false;
+ List<IClasspathEntry> classpathEntries = new ArrayList<IClasspathEntry>();
+ for (int i = 0; i < oldClasspathEntries.length
+ && !isFolderInClassPathAlready; i++) {
+ if (!oldClasspathEntries[i].getPath().equals(
+ new Path(JBossFacetCoreMessages.JBossWS_Runtime_Lib)
+ .append(segment))) {
+ classpathEntries.add(oldClasspathEntries[i]);
+ }
+ }
+ if (classpathEntries.size() < oldClasspathEntries.length) {
+ javaProject.setRawClasspath(classpathEntries
+ .toArray(new IClasspathEntry[classpathEntries.size()]),
+ new NullProgressMonitor());
+ }
+ } catch (JavaModelException e) {
+ status = StatusUtils.errorStatus(NLS.bind(
+ JBossFacetCoreMessages.Error_Remove_Facet_JBossWS,
+ new String[] { e.getLocalizedMessage() }), e);
+ return status;
+ }
+
+ return status;
+ }
+
+}
Added: workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/IJBossESBFacetDataModelProperties.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/IJBossESBFacetDataModelProperties.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/IJBossESBFacetDataModelProperties.java 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,37 @@
+package org.jboss.tools.esb.project.facet;
+
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
+
+public interface IJBossESBFacetDataModelProperties extends IFacetProjectCreationDataModelProperties {
+
+ public static final String USER_DEFINED_LOCATION = "IProjectCreationPropertiesNew.USER_DEFINED_LOCATION"; //$NON-NLS-1$
+ public static final String DEFAULT_LOCATION = "IProjectCreationPropertiesNew.DEFAULT_LOCATION"; //$NON-NLS-1$
+ public static final String USE_DEFAULT_LOCATION = "IProjectCreationPropertiesNew.USE_DEFAULT_LOCATION"; //$NON-NLS-1$
+ public static final String PROJECT_LOCATION = "IProjectCreationPropertiesNew.PROJECT_LOCATION";
+
+ public static final String ESB_CONTENT_FOLDER = "JBoss.Project.Content_Folder";
+ public static final String ESB_SRC_FOLDER = "JBoss.Project.Src_Folder";
+
+ public static final QualifiedName QNAME_ESB_CONTENT_FOLDER = new QualifiedName("jboss", ESB_CONTENT_FOLDER);
+ public static final QualifiedName QNAME_ESB_SRC_FOLDER = new QualifiedName("jboss", ESB_SRC_FOLDER);
+
+
+
+ public static final String JBOSS_WS_FACET_ID = "jboss.esb";
+ public static final String RUNTIME_DEPLOY = "jboss.deploy";
+ public static final String QUALIFIEDNAME_IDENTIFIER = "jboss.tools";
+ public static final String RUNTIME_IS_SERVER_SUPPLIED = "jboss.is.server.supplied";
+ public static final String RUNTIME_ID = "jboss.runtime_id";
+
+ public static final String PERSISTENT_PROPERTY_IS_SERVER_SUPPLIED_RUNTIME = "is.server.supplied.runtime";
+ public static final String RUNTIME_HOME = "jboss.runtime.home";
+ public static final String DEFAULT_VALUE_IS_SERVER_SUPPLIED = "1";
+ static QualifiedName PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME = new QualifiedName(QUALIFIEDNAME_IDENTIFIER,
+ RUNTIME_ID);
+ static QualifiedName PERSISTENCE_PROPERTY_RNTIME_LOCATION = new QualifiedName(QUALIFIEDNAME_IDENTIFIER,
+ RUNTIME_HOME);
+ static QualifiedName PERSISTENCE_PROPERTY_SERVER_SUPPLIED_RUNTIME = new QualifiedName(
+ QUALIFIEDNAME_IDENTIFIER,
+ PERSISTENT_PROPERTY_IS_SERVER_SUPPLIED_RUNTIME);
+}
Added: workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/JBossESBFacetInstallationConfig.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/JBossESBFacetInstallationConfig.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/JBossESBFacetInstallationConfig.java 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,67 @@
+package org.jboss.tools.esb.project.facet;
+
+import java.util.Set;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
+import org.jboss.tools.esb.project.utils.StatusUtils;
+
+public class JBossESBFacetInstallationConfig extends
+ FacetInstallDataModelProvider implements
+ IJBossESBFacetDataModelProperties, IActionConfigFactory{
+
+ public Object create() {
+ // TODO Auto-generated method stub
+ return DataModelFactory.createDataModel(this);
+
+ }
+
+ public Object getDefaultProperty(String propertyName) {
+ if (IFacetDataModelProperties.FACET_ID.equals(propertyName)) {
+
+ return "jboss.esb";
+ }
+ else if(IJBossESBFacetDataModelProperties.ESB_CONTENT_FOLDER.equals(propertyName)){
+ return "esbcontent";
+ }
+ else if(IJBossESBFacetDataModelProperties.ESB_SRC_FOLDER.equals(propertyName)){
+ return "src";
+ }
+ else if(propertyName.equals(RUNTIME_DEPLOY)){
+ return false;
+ }else if(propertyName.equals(RUNTIME_ID)){
+ return "";
+ }else if(propertyName.equals(FACET_ID)){
+ return IJBossESBFacetDataModelProperties.JBOSS_WS_FACET_ID;
+ }
+ return super.getDefaultProperty(propertyName);
+ }
+
+ @Override
+ public Set getPropertyNames() {
+ Set names = super.getPropertyNames();
+ names.add(IJBossESBFacetDataModelProperties.ESB_CONTENT_FOLDER);
+ names.add(IJBossESBFacetDataModelProperties.ESB_SRC_FOLDER);
+ names.add(RUNTIME_DEPLOY);
+ names.add(RUNTIME_ID);
+ names.add(RUNTIME_IS_SERVER_SUPPLIED);
+ names.add(RUNTIME_HOME);
+ return names;
+ }
+
+ @Override
+ public IStatus validate(String name) {
+ boolean serverSupplied = getBooleanProperty(RUNTIME_IS_SERVER_SUPPLIED);
+ String runtimeName = getStringProperty(RUNTIME_ID);
+ if (!serverSupplied
+ && (runtimeName == null || runtimeName.equals(""))) {
+ return StatusUtils.errorStatus("");
+ }
+ return super.validate(name);
+ }
+
+
+}
Added: workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/JBossESBFacetInstallationDelegate.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/JBossESBFacetInstallationDelegate.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/JBossESBFacetInstallationDelegate.java 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,97 @@
+package org.jboss.tools.esb.project.facet;
+
+import java.io.ByteArrayInputStream;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jst.ws.internal.common.ResourceUtils;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.jboss.tools.esb.project.command.JBossClassPathCommand;
+import org.jboss.tools.esb.project.messages.JBossFacetCoreMessages;
+
+public class JBossESBFacetInstallationDelegate implements IDelegate {
+
+
+ private IDataModel model;
+ public static final String ESB_NATURE = "org.jboss.tools.esb.project.ESBNature";
+
+ public void execute(IProject project, IProjectFacetVersion fv,
+ Object config, IProgressMonitor monitor) throws CoreException {
+ model = (IDataModel)config;
+
+ createProjectStructure(project);
+
+ addESBNature(project);
+
+ monitor.beginTask(JBossFacetCoreMessages.Progress_Install_JBossWS_Runtime,
+ 2);
+
+ JBossClassPathCommand command = new JBossClassPathCommand(project,
+ model);
+ IStatus status = command.executeOverride(monitor);
+ if(!status.equals(Status.OK_STATUS)){
+ throw new CoreException(status);
+ }
+ monitor.worked(1);
+ monitor.done();
+
+
+
+ //String prjName = model.getStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME);
+ //IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(prjName);
+
+
+ }
+
+ private IFile createJBossESBXML(IFolder folder) throws CoreException{
+ StringBuffer emptyESB = new StringBuffer();
+ emptyESB.append("<?xml version = \"1.0\" encoding = \"UTF-8\"?>");
+ emptyESB.append("\n");
+ emptyESB.append("<jbossesb xmlns=\"http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml..." parameterReloadSecs=\"5\">");
+ emptyESB.append("\n");
+ emptyESB.append("</jbossesb>");
+ IFile esbfile = folder.getFile("jboss-esb.xml");
+ esbfile.create(new ByteArrayInputStream(emptyESB.toString().getBytes()), true, null);
+
+ return esbfile;
+ }
+
+
+
+
+ private void createProjectStructure(IProject project) throws CoreException{
+ IFile esbFile = null;
+ String strContentFolder = model.getStringProperty(IJBossESBFacetDataModelProperties.ESB_CONTENT_FOLDER);
+ project.setPersistentProperty(IJBossESBFacetDataModelProperties.QNAME_ESB_CONTENT_FOLDER, strContentFolder);
+ IFolder esbContent = project.getFolder(strContentFolder);
+ if(!esbContent.exists()) {
+ esbContent.create(true, true, null);
+ }
+
+ esbContent.getFolder("lib").create(true, true, null);
+ esbContent.getFolder("META-INF").create(true, true, null);
+ esbFile = createJBossESBXML(esbContent.getFolder("META-INF"));
+
+ project.refreshLocal(IResource.DEPTH_ZERO, null);
+ }
+
+ private static void addESBNature(IProject project) throws CoreException{
+ IProjectDescription desc = project.getDescription();
+ final String[] current = desc.getNatureIds();
+ final String[] replacement = new String[ current.length + 1 ];
+ System.arraycopy( current, 0, replacement, 1, current.length );
+ replacement[ 0 ] = ESB_NATURE;
+ desc.setNatureIds( replacement );
+ project.setDescription( desc, null );
+
+ }
+}
Added: workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/UnInstallJBossRuntimeDelegate.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/UnInstallJBossRuntimeDelegate.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/facet/UnInstallJBossRuntimeDelegate.java 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * 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.esb.project.facet;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.jboss.tools.esb.project.command.UninstallJBossClassPathCommand;
+import org.jboss.tools.esb.project.messages.JBossFacetCoreMessages;
+
+/**
+ * @author Grid Qian
+ */
+public class UnInstallJBossRuntimeDelegate implements IDelegate {
+
+ public void execute(IProject project, IProjectFacetVersion arg1,
+ Object arg2, IProgressMonitor monitor) throws CoreException {
+ monitor.beginTask(
+ JBossFacetCoreMessages.Progress_UnInstall_JBossWS_Runtime, 2);
+
+ IDataModel model = (IDataModel) arg2;
+
+ UninstallJBossClassPathCommand command = new UninstallJBossClassPathCommand(
+ project, model);
+ command.executeOverride(monitor);
+ monitor.worked(1);
+ monitor.done();
+ }
+
+}
Added: workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/messages/JBossFacetCore.properties
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/messages/JBossFacetCore.properties (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/messages/JBossFacetCore.properties 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,15 @@
+Progress_Install_JBossWS_Runtime=JBoss ESB Runtime
+Progress_UnInstall_JBossWS_Runtime=Uninstall JBoss ESB Runtime
+Dir_Lib=lib
+Dir_Client=client
+Dir_Web_Inf=WEB-INF
+Dir_Web_Content=WebContent
+Error_Copy=Exception while copy runtime jars
+WS_Location=jbossesbruntimelocation
+JBossWS_Runtime_Lib=JBoss_ESB_Runtime
+JBossWS_Runtime=JBoss ESB Runtime
+JBossAS=JBOSS
+Error_WS_Location=The JBoss ESB Runtime Location is NULL
+Error_WS_Classpath=A error comes up when create JBoss ESB runtime Classpath
+Error_Add_Facet_JBossWS=Exception while install JBoss ESB facet
+Error_Remove_Facet_JBossWS=Exception while uninstall JBoss ESB facet
Added: workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/messages/JBossFacetCoreMessages.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/messages/JBossFacetCoreMessages.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/messages/JBossFacetCoreMessages.java 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * 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.esb.project.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Grid Qian
+ */
+public class JBossFacetCoreMessages {
+
+ private static final String BUNDLE_NAME = "org.jboss.tools.esb.project.messages.JBossFacetCore"; //$NON-NLS-1$
+
+ private JBossFacetCoreMessages() {
+ // Do not instantiate
+ }
+
+ public static String Progress_Install_JBossWS_Runtime;
+ public static String Progress_UnInstall_JBossWS_Runtime;
+ public static String Dir_Lib;
+ public static String Dir_Client;
+ public static String Dir_Web_Inf;
+ public static String Dir_Web_Content;
+ public static String Error_Copy;
+ public static String WS_Location;
+ public static String JBossWS_Runtime_Lib;
+ public static String JBossWS_Runtime;
+ public static String JBossAS;
+ public static String Error_WS_Location;
+ public static String Error_WS_Classpath;
+ public static String Error_Add_Facet_JBossWS;
+ public static String Error_Remove_Facet_JBossWS;
+
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, JBossFacetCoreMessages.class);
+ }
+}
\ No newline at end of file
Added: workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/nature/JBossESBProjectNature.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/nature/JBossESBProjectNature.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/nature/JBossESBProjectNature.java 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,28 @@
+package org.jboss.tools.esb.project.nature;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.runtime.CoreException;
+
+public class JBossESBProjectNature implements IProjectNature {
+
+ IProject project;
+ public void configure() throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void deconfigure() throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public IProject getProject() {
+ return project;
+ }
+
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+}
Added: workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/utils/JBossRuntimeCoreUtils.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/utils/JBossRuntimeCoreUtils.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/utils/JBossRuntimeCoreUtils.java 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,218 @@
+/*******************************************************************************
+ * 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.esb.project.utils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.esb.project.messages.JBossFacetCoreMessages;
+
+/**
+ * @author Grid Qian
+ */
+public class JBossRuntimeCoreUtils {
+
+/* public static IPath pathToWebProjectContainer(String project) {
+ IPath projectRoot = getProjectRoot(project);
+ IPath currentDynamicWebProjectDir = J2EEUtils
+ .getWebContentPath(getProjectName(project));
+ IPath currentDynamicWebProjectDirWithoutProjectRoot = J2EEUtils
+ .getWebContentPath(getProjectName(project))
+ .removeFirstSegments(1).makeAbsolute();
+ if (projectRoot.toOSString().contains(getWorkspace().toOSString())) {
+ return getWorkspace().append(currentDynamicWebProjectDir);
+ } else {
+ return projectRoot
+ .append(currentDynamicWebProjectDirWithoutProjectRoot);
+ }
+
+ }*/
+
+ public static IPath getProjectRoot(String project) {
+ String projectString = replaceEscapecharactors(project.toString());
+ return ResourcesPlugin.getWorkspace().getRoot().getProject(
+ getProjectNameFromFramewokNameString(projectString))
+ .getLocation();
+ }
+
+ // Fix for the windows build not working
+ private static String replaceEscapecharactors(String vulnarableString) {
+ if (vulnarableString.indexOf("/") != -1) {
+ vulnarableString = vulnarableString.replace('/', File.separator
+ .charAt(0));
+ }
+ return vulnarableString;
+ }
+
+ private static String getProjectNameFromFramewokNameString(
+ String frameworkProjectString) {
+ if (frameworkProjectString.indexOf(getSplitCharactor()) == -1) {
+ return frameworkProjectString;
+ } else {
+ return frameworkProjectString.split(getSplitCharactors())[1];
+ }
+ }
+
+ private static String getSplitCharactor() {
+ // Windows check (because from inside wtp in return I received a hard
+ // coded path)
+ if (File.separatorChar == '\\') {
+ return "\\";
+ } else {
+ return File.separator;
+ }
+ }
+
+ private static String getSplitCharactors() {
+ // Windows check (because from inside wtp in return I received a hard
+ // coded path)
+ if (File.separatorChar == '\\') {
+ return "\\" + File.separator;
+ } else {
+ return File.separator;
+ }
+ }
+
+ public static IPath getWorkspace() {
+ return ResourcesPlugin.getWorkspace().getRoot().getLocation();
+ }
+
+ public static IWorkspaceRoot getWorkspaceRoot() {
+ return ResourcesPlugin.getWorkspace().getRoot();
+ }
+
+ public static IProject getProjectName(String project) {
+ String projectString = replaceEscapecharactors(project.toString());
+ return ResourcesPlugin.getWorkspace().getRoot().getProject(
+ getProjectNameFromFramewokNameString(projectString));
+ }
+
+ public static IStatus copy(IPath sourcePath, IPath targetPath) {
+
+ IStatus status = Status.OK_STATUS;
+ File sourceDir = sourcePath.toFile();
+ File[] children = sourceDir.listFiles();
+
+ FileInputStream finStream = null;
+ for (int i = 0; i < children.length; i++) {
+ if (children[i].isFile()) {
+ try {
+ finStream = new FileInputStream(children[i]);
+ } catch (FileNotFoundException e) {
+ status = StatusUtils.errorStatus(NLS.bind(
+ JBossFacetCoreMessages.Error_Copy, new String[] { e
+ .getLocalizedMessage() }), e);
+ }
+ try {
+ makeFile(getWorkspaceRoot().getContainerForLocation(
+ targetPath), children[i].getName(), finStream);
+ } catch (CoreException e) {
+ status = StatusUtils.errorStatus(NLS.bind(
+ JBossFacetCoreMessages.Error_Copy, new String[] { e
+ .getLocalizedMessage() }), e);
+ }
+ } else {
+ try {
+ IFolder temp = makeFolder(getWorkspaceRoot()
+ .getContainerForLocation(targetPath), children[i]
+ .getName());
+ copy(sourcePath.append(children[i].getName()), temp
+ .getLocation());
+ } catch (CoreException e) {
+ status = StatusUtils.errorStatus(NLS.bind(
+ JBossFacetCoreMessages.Error_Copy, new String[] { e
+ .getLocalizedMessage() }), e);
+ }
+ }
+ }
+ return status;
+ }
+
+ private static IFolder makeFolder(IContainer parent, String folderName)
+ throws CoreException {
+ IResource child = parent.findMember(folderName);
+ if (child == null) {
+ IFolder folder = parent.getFolder(new Path(folderName));
+ try {
+ folder.create(true, true, null);
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return folder;
+ } else {
+ if (child.getType() == IResource.FOLDER) {
+ return (IFolder) child;
+ } else {
+ throw new CoreException(new Status(IStatus.ERROR,
+ "ResourceUtils", 0, NLS.bind("ERROR",// EnvironmentMessages.MSG_ERROR_RESOURCE_NOT_FOLDER,
+ new Object[] { parent.getFullPath().append(
+ folderName).toString() }), null));
+ }
+ }
+
+ }
+
+ private static IFile makeFile(IContainer parent, String fileName,
+ InputStream inputStream) throws CoreException {
+ IResource child = parent.findMember(fileName);
+
+ if (child != null) {
+ if (child.getType() == IResource.FILE) {
+
+ // We have permission to overwrite so check if file is read-only
+ if (child.getResourceAttributes() != null
+ && child.getResourceAttributes().isReadOnly()) {
+ IFile[] files = new IFile[1];
+ files[0] = (IFile) child;
+ }
+
+ // Change the contents of the existing file.
+ IFile file = parent.getFile(new Path(fileName));
+ file.setContents(inputStream, true, true, null);
+
+ return file;
+
+ } else {
+ throw new CoreException(new Status(IStatus.ERROR,
+ "ResourceUtils", 0, NLS.bind("ERROR",
+ new Object[] { parent.getFullPath().append(
+ fileName) }), null));
+ }
+ } else {
+ // Create a new file.
+ IFile file = parent.getFile(new Path(fileName));
+ file.create(inputStream, true, null);
+
+ return file;
+ }
+ }
+
+
+
+
+}
Added: workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/utils/StatusUtils.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/utils/StatusUtils.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.project/src/org/jboss/tools/esb/project/utils/StatusUtils.java 2008-08-26 02:02:04 UTC (rev 9888)
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * 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.esb.project.utils;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+
+public class StatusUtils
+{
+ public static IStatus errorStatus( String errorMessage )
+ {
+ return new Status( IStatus.ERROR, "id", 0, errorMessage, null );
+ }
+
+ public static IStatus errorStatus( Throwable exc )
+ {
+ String message = exc.getMessage();
+
+ return new Status( IStatus.ERROR, "id", 0, message == null ? "" : message, exc );
+ }
+
+ public static IStatus errorStatus( String message, Throwable exc )
+ {
+ return new Status( IStatus.ERROR, "id", 0, message, exc );
+ }
+
+ public static MultiStatus multiStatus( String message, IStatus[] children, Throwable exc )
+ {
+ return new MultiStatus( "id", 0, children, message, exc );
+ }
+
+ public static MultiStatus multiStatus( String message, IStatus[] children )
+ {
+ return new MultiStatus( "id", 0, children, message, null );
+ }
+
+ public static IStatus warningStatus( String warningMessage )
+ {
+ return new Status( IStatus.WARNING, "id", 0, warningMessage, null );
+ }
+
+ public static IStatus warningStatus( String warningMessage, Throwable exc )
+ {
+ return new Status( IStatus.WARNING, "id", 0, warningMessage, exc );
+ }
+
+ public static IStatus infoStatus( String infoMessage )
+ {
+ return new Status( IStatus.INFO, "id", 0, infoMessage, null );
+ }
+}
\ No newline at end of file
16 years, 4 months
JBoss Tools SVN: r9887 - workspace/Denny.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-08-25 22:00:34 -0400 (Mon, 25 Aug 2008)
New Revision: 9887
Added:
workspace/Denny/org.jboss.tools.esb.project/
Log:
esb facet definition
16 years, 4 months
JBoss Tools SVN: r9886 - trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-08-25 20:00:40 -0400 (Mon, 25 Aug 2008)
New Revision: 9886
Modified:
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletClassWizardPage.java
Log:
JBIDE-2620 Portlet wizards has bad label and exception for class name
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletClassWizardPage.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletClassWizardPage.java 2008-08-25 22:29:42 UTC (rev 9885)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletClassWizardPage.java 2008-08-26 00:00:40 UTC (rev 9886)
@@ -61,6 +61,7 @@
private Label existingClassLabel;
private Text existingClassText;
private Button existingClassButton;
+ private boolean disableExistingClassButton = false;
public NewJSFPortletClassWizardPage(IDataModel model, String pageName, String pageDesc, String pageTitle,
String moduleType) {
@@ -96,24 +97,31 @@
}
private void createUseExistingGroup(Composite composite) {
-
+
existingClassLabel = new Label(composite, SWT.LEFT);
existingClassLabel.setText(CLASS_NAME_LABEL);
- existingClassLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- existingClassText = new Text(composite, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
+ existingClassLabel.setLayoutData(new GridData(
+ GridData.HORIZONTAL_ALIGN_BEGINNING));
+
+ existingClassText = new Text(composite, SWT.SINGLE | SWT.BORDER
+ | SWT.READ_ONLY);
existingClassText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
synchHelper.synchText(existingClassText, CLASS_NAME, null);
existingClassText.setText(IPortletUIConstants.JBOSS_JSF_PORTLET_CLASS);
-
+
existingClassButton = new Button(composite, SWT.PUSH);
existingClassButton.setText(BROWSE_BUTTON_LABEL);
- existingClassButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- existingClassButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleClassButtonSelected();
- }
- });
+ existingClassButton.setLayoutData(new GridData(
+ GridData.HORIZONTAL_ALIGN_FILL));
+ if (disableExistingClassButton) {
+ existingClassButton.setEnabled(false);
+ } else {
+ existingClassButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleClassButtonSelected();
+ }
+ });
+ }
}
private void handleClassButtonSelected() {
@@ -179,7 +187,10 @@
if (isProjectValid(project))
items.add(project.getName());
}
- if (items.isEmpty()) return;
+ if (items.isEmpty()) {
+ disableExistingClassButton = true;
+ return;
+ }
String[] names = new String[items.size()];
for (int i = 0; i < items.size(); i++) {
names[i] = (String) items.get(i);
16 years, 4 months
JBoss Tools SVN: r9885 - trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-08-25 18:29:42 -0400 (Mon, 25 Aug 2008)
New Revision: 9885
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java
Log:
NPE's
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2008-08-25 22:25:08 UTC (rev 9884)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/ArchivesModel.java 2008-08-25 22:29:42 UTC (rev 9885)
@@ -153,7 +153,7 @@
}
public boolean isProjectRegistered(IPath projectPath) {
- return archivesRoot.containsKey(projectPath);
+ return projectPath != null && archivesRoot.containsKey(projectPath);
}
public boolean canReregister(IPath projectPath) {
@@ -161,7 +161,7 @@
}
public boolean canReregister(IPath projectPath, String file) {
- return projectPath.append(file).toFile().exists();
+ return projectPath != null && file != null && projectPath.append(file).toFile().exists();
}
public IArchiveModelRootNode registerProject(IPath projectPath, IProgressMonitor monitor) throws ArchivesModelException {
16 years, 4 months
JBoss Tools SVN: r9884 - trunk/core/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-08-25 18:25:08 -0400 (Mon, 25 Aug 2008)
New Revision: 9884
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/ArchivesModelModuleContributor.java
Log:
NPE
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/ArchivesModelModuleContributor.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/ArchivesModelModuleContributor.java 2008-08-25 18:06:25 UTC (rev 9883)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/ArchivesModelModuleContributor.java 2008-08-25 22:25:08 UTC (rev 9884)
@@ -93,6 +93,8 @@
}
protected void createModules(IProject project) throws ArchivesModelException {
+ if( project == null )
+ return;
IArchive[] packages = ModelUtil.getProjectArchives(project.getLocation());
if( packages != null && packages.length > 0 ) {
IModule module;
16 years, 4 months
JBoss Tools SVN: r9883 - in trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui: preferences and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-08-25 14:06:25 -0400 (Mon, 25 Aug 2008)
New Revision: 9883
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/TabbedPreferencesPage.java
Log:
PMD violations fix
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java 2008-08-25 16:14:29 UTC (rev 9882)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java 2008-08-25 18:06:25 UTC (rev 9883)
@@ -292,11 +292,7 @@
String name = tableProvider.getValueAt(i, 0);
Properties p = new Properties();
p.setProperty("name", name);
- try {
- XActionInvoker.invoke("AnyElementNew", "EditActions.EditAttribute", xmo, p);
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ XActionInvoker.invoke("AnyElementNew", "EditActions.EditAttribute", xmo, p);
}
void delete() throws XModelException {
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/TabbedPreferencesPage.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/TabbedPreferencesPage.java 2008-08-25 16:14:29 UTC (rev 9882)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/TabbedPreferencesPage.java 2008-08-25 18:06:25 UTC (rev 9883)
@@ -52,8 +52,8 @@
private List convertPathArrayToPreferencePageList(String[] path) {
XModel model = getPreferenceModel();
- if(model==null) throw new NullPointerException("Preference XModel not loaded.");
- if(path==null) throw new NullPointerException("String array with path's cannot be null");
+ if(model==null) throw new IllegalArgumentException("Preference XModel not loaded.");
+ if(path==null) throw new IllegalArgumentException("String array with path's cannot be null");
if(path.length==0) throw new IllegalArgumentException("Path array should contains at least one element.");
List<XMOBasedPreferencesPage> pages = new ArrayList<XMOBasedPreferencesPage>();
for (int i = 0; i < path.length; i++) {
16 years, 4 months
JBoss Tools SVN: r9882 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-08-25 12:14:29 -0400 (Mon, 25 Aug 2008)
New Revision: 9882
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/ExpandableForm.java
Log:
JBIDE-2607
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/ExpandableForm.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/ExpandableForm.java 2008-08-25 12:41:26 UTC (rev 9881)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/ExpandableForm.java 2008-08-25 16:14:29 UTC (rev 9882)
@@ -70,7 +70,10 @@
toolkit = new FormToolkit(parent.getDisplay());
}
- section = toolkit.createSection(parent, ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED|ExpandableComposite.TITLE_BAR);
+ // commented by vitali:
+ //section = toolkit.createSection(parent, ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED|ExpandableComposite.TITLE_BAR);
+ // ExpandableComposite.TITLE_BAR option results for the tree flicking in "Hibernate Configuration 3.0 XML Editor"
+ section = toolkit.createSection(parent, ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED|ExpandableComposite.SHORT_TITLE_BAR);
section.setText("" + getHeadingText());
section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | /*GridData.FILL_VERTICAL |*/ GridData.VERTICAL_ALIGN_BEGINNING));
toolkit.adapt(section);
16 years, 4 months
JBoss Tools SVN: r9881 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-08-25 08:41:26 -0400 (Mon, 25 Aug 2008)
New Revision: 9881
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2683
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java 2008-08-25 12:14:59 UTC (rev 9880)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java 2008-08-25 12:41:26 UTC (rev 9881)
@@ -697,9 +697,17 @@
updateStatus(HibernateConsoleMessages.ConsoleConfigurationWizardPage_name_must_specified);
return;
} else {
- if(oldConfiguaration==null && KnownConfigurations.getInstance().find(getConfigurationName() )!=null) {
- updateStatus(HibernateConsoleMessages.ConsoleConfigurationWizardPage_config_name_already_exist);
- return;
+ if(oldConfiguaration==null){
+ ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
+ try {
+ if (lm.isExistingLaunchConfigurationName(getConfigurationName())){
+
+ updateStatus(HibernateConsoleMessages.ConsoleConfigurationWizardPage_config_name_already_exist);
+ return;
+ }
+ } catch (CoreException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage(e.getMessage(), e);
+ }
}
}
16 years, 4 months