commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gu...@apache.org
Subject svn commit: r945185 [36/42] - in /commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram: ./ META-INF/ bin/ icons/ icons/obj16/ icons/wizban/ src/ src/org/ src/org/apache/ src/org/apache/commons/ src/org/apache/com...
Date Mon, 17 May 2010 14:38:59 GMT
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlElementTypes.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlElementTypes.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlElementTypes.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlElementTypes.java Mon May 17 14:38:45 2010
@@ -0,0 +1,595 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.scxml.diagram.providers;
+
+import java.util.HashSet;
+import java.util.IdentityHashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.scxml.ScxmlPackage;
+import org.apache.commons.scxml.diagram.part.ScxmlDiagramEditorPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.ENamedElement;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @generated
+ */
+public class ScxmlElementTypes extends ElementInitializers {
+
+	/**
+	 * @generated
+	 */
+	private ScxmlElementTypes() {
+	}
+
+	/**
+	 * @generated
+	 */
+	private static Map elements;
+
+	/**
+	 * @generated
+	 */
+	private static ImageRegistry imageRegistry;
+
+	/**
+	 * @generated
+	 */
+	private static Set KNOWN_ELEMENT_TYPES;
+
+	/**
+	 * @generated
+	 */
+	public static final IElementType ServiceTemplate_79 = getElementType("org.apache.commons.scxml.diagram.ServiceTemplate_79"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType State_1001 = getElementType("org.apache.commons.scxml.diagram.State_1001"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType InitialState_1002 = getElementType("org.apache.commons.scxml.diagram.InitialState_1002"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Script_1003 = getElementType("org.apache.commons.scxml.diagram.Script_1003"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Parallel_1004 = getElementType("org.apache.commons.scxml.diagram.Parallel_1004"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType DataModel_1005 = getElementType("org.apache.commons.scxml.diagram.DataModel_1005"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType FinalState_1006 = getElementType("org.apache.commons.scxml.diagram.FinalState_1006"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType OnEntry_2001 = getElementType("org.apache.commons.scxml.diagram.OnEntry_2001"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType If_2002 = getElementType("org.apache.commons.scxml.diagram.If_2002"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType ElseIf_2003 = getElementType("org.apache.commons.scxml.diagram.ElseIf_2003"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Else_2004 = getElementType("org.apache.commons.scxml.diagram.Else_2004"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Assign_2005 = getElementType("org.apache.commons.scxml.diagram.Assign_2005"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Raise_2006 = getElementType("org.apache.commons.scxml.diagram.Raise_2006"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Log_2007 = getElementType("org.apache.commons.scxml.diagram.Log_2007"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Validate_2008 = getElementType("org.apache.commons.scxml.diagram.Validate_2008"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Cancel_2009 = getElementType("org.apache.commons.scxml.diagram.Cancel_2009"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Send_2010 = getElementType("org.apache.commons.scxml.diagram.Send_2010"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Param_2011 = getElementType("org.apache.commons.scxml.diagram.Param_2011"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Content_2012 = getElementType("org.apache.commons.scxml.diagram.Content_2012"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Content_2013 = getElementType("org.apache.commons.scxml.diagram.Content_2013"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Param_2014 = getElementType("org.apache.commons.scxml.diagram.Param_2014"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Script_2015 = getElementType("org.apache.commons.scxml.diagram.Script_2015"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType OnExit_2016 = getElementType("org.apache.commons.scxml.diagram.OnExit_2016"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType If_2017 = getElementType("org.apache.commons.scxml.diagram.If_2017"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Assign_2018 = getElementType("org.apache.commons.scxml.diagram.Assign_2018"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Raise_2019 = getElementType("org.apache.commons.scxml.diagram.Raise_2019"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Log_2020 = getElementType("org.apache.commons.scxml.diagram.Log_2020"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Validate_2021 = getElementType("org.apache.commons.scxml.diagram.Validate_2021"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Cancel_2022 = getElementType("org.apache.commons.scxml.diagram.Cancel_2022"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Param_2023 = getElementType("org.apache.commons.scxml.diagram.Param_2023"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Send_2024 = getElementType("org.apache.commons.scxml.diagram.Send_2024"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Script_2025 = getElementType("org.apache.commons.scxml.diagram.Script_2025"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Invoke_2026 = getElementType("org.apache.commons.scxml.diagram.Invoke_2026"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Finalize_2027 = getElementType("org.apache.commons.scxml.diagram.Finalize_2027"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Param_2028 = getElementType("org.apache.commons.scxml.diagram.Param_2028"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Content_2029 = getElementType("org.apache.commons.scxml.diagram.Content_2029"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType InitialState_2030 = getElementType("org.apache.commons.scxml.diagram.InitialState_2030"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType HistoryState_2031 = getElementType("org.apache.commons.scxml.diagram.HistoryState_2031"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Parallel_2032 = getElementType("org.apache.commons.scxml.diagram.Parallel_2032"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType HistoryState_2033 = getElementType("org.apache.commons.scxml.diagram.HistoryState_2033"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Anchor_2034 = getElementType("org.apache.commons.scxml.diagram.Anchor_2034"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Parallel_2035 = getElementType("org.apache.commons.scxml.diagram.Parallel_2035"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType OnEntry_2036 = getElementType("org.apache.commons.scxml.diagram.OnEntry_2036"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType OnExit_2037 = getElementType("org.apache.commons.scxml.diagram.OnExit_2037"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType State_2038 = getElementType("org.apache.commons.scxml.diagram.State_2038"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Anchor_2039 = getElementType("org.apache.commons.scxml.diagram.Anchor_2039"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType FinalState_2040 = getElementType("org.apache.commons.scxml.diagram.FinalState_2040"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Donedata_2041 = getElementType("org.apache.commons.scxml.diagram.Donedata_2041"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Param_2042 = getElementType("org.apache.commons.scxml.diagram.Param_2042"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Content_2043 = getElementType("org.apache.commons.scxml.diagram.Content_2043"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType OnEntry_2044 = getElementType("org.apache.commons.scxml.diagram.OnEntry_2044"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType OnExit_2045 = getElementType("org.apache.commons.scxml.diagram.OnExit_2045"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType State_2046 = getElementType("org.apache.commons.scxml.diagram.State_2046"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Data_2047 = getElementType("org.apache.commons.scxml.diagram.Data_2047"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Content_2048 = getElementType("org.apache.commons.scxml.diagram.Content_2048"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Translation_3001 = getElementType("org.apache.commons.scxml.diagram.Translation_3001"); //$NON-NLS-1$
+
+	/**
+	 * @generated
+	 */
+	private static ImageRegistry getImageRegistry() {
+		if (imageRegistry == null) {
+			imageRegistry = new ImageRegistry();
+		}
+		return imageRegistry;
+	}
+
+	/**
+	 * @generated
+	 */
+	private static String getImageRegistryKey(ENamedElement element) {
+		return element.getName();
+	}
+
+	/**
+	 * @generated
+	 */
+	private static ImageDescriptor getProvidedImageDescriptor(
+			ENamedElement element) {
+		if (element instanceof EStructuralFeature) {
+			EStructuralFeature feature = ((EStructuralFeature) element);
+			EClass eContainingClass = feature.getEContainingClass();
+			EClassifier eType = feature.getEType();
+			if (eContainingClass != null && !eContainingClass.isAbstract()) {
+				element = eContainingClass;
+			} else if (eType instanceof EClass
+					&& !((EClass) eType).isAbstract()) {
+				element = eType;
+			}
+		}
+		if (element instanceof EClass) {
+			EClass eClass = (EClass) element;
+			if (!eClass.isAbstract()) {
+				return ScxmlDiagramEditorPlugin.getInstance()
+						.getItemImageDescriptor(
+								eClass.getEPackage().getEFactoryInstance()
+										.create(eClass));
+			}
+		}
+		// TODO : support structural features
+		return null;
+	}
+
+	/**
+	 * @generated
+	 */
+	public static ImageDescriptor getImageDescriptor(ENamedElement element) {
+		String key = getImageRegistryKey(element);
+		ImageDescriptor imageDescriptor = getImageRegistry().getDescriptor(key);
+		if (imageDescriptor == null) {
+			imageDescriptor = getProvidedImageDescriptor(element);
+			if (imageDescriptor == null) {
+				imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
+			}
+			getImageRegistry().put(key, imageDescriptor);
+		}
+		return imageDescriptor;
+	}
+
+	/**
+	 * @generated
+	 */
+	public static Image getImage(ENamedElement element) {
+		String key = getImageRegistryKey(element);
+		Image image = getImageRegistry().get(key);
+		if (image == null) {
+			ImageDescriptor imageDescriptor = getProvidedImageDescriptor(element);
+			if (imageDescriptor == null) {
+				imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
+			}
+			getImageRegistry().put(key, imageDescriptor);
+			image = getImageRegistry().get(key);
+		}
+		return image;
+	}
+
+	/**
+	 * @generated
+	 */
+	public static ImageDescriptor getImageDescriptor(IAdaptable hint) {
+		ENamedElement element = getElement(hint);
+		if (element == null) {
+			return null;
+		}
+		return getImageDescriptor(element);
+	}
+
+	/**
+	 * @generated
+	 */
+	public static Image getImage(IAdaptable hint) {
+		ENamedElement element = getElement(hint);
+		if (element == null) {
+			return null;
+		}
+		return getImage(element);
+	}
+
+	/**
+	 * Returns 'type' of the ecore object associated with the hint.
+	 * 
+	 * @generated
+	 */
+	public static ENamedElement getElement(IAdaptable hint) {
+		Object type = hint.getAdapter(IElementType.class);
+		if (elements == null) {
+			elements = new IdentityHashMap();
+
+			elements.put(ServiceTemplate_79, ScxmlPackage.eINSTANCE
+					.getServiceTemplate());
+
+			elements.put(State_1001, ScxmlPackage.eINSTANCE.getState());
+
+			elements.put(InitialState_1002, ScxmlPackage.eINSTANCE
+					.getInitialState());
+
+			elements.put(Script_1003, ScxmlPackage.eINSTANCE.getScript());
+
+			elements.put(Parallel_1004, ScxmlPackage.eINSTANCE.getParallel());
+
+			elements.put(DataModel_1005, ScxmlPackage.eINSTANCE.getDataModel());
+
+			elements.put(FinalState_1006, ScxmlPackage.eINSTANCE
+					.getFinalState());
+
+			elements.put(OnEntry_2001, ScxmlPackage.eINSTANCE.getOnEntry());
+
+			elements.put(If_2002, ScxmlPackage.eINSTANCE.getIf());
+
+			elements.put(ElseIf_2003, ScxmlPackage.eINSTANCE.getElseIf());
+
+			elements.put(Else_2004, ScxmlPackage.eINSTANCE.getElse());
+
+			elements.put(Assign_2005, ScxmlPackage.eINSTANCE.getAssign());
+
+			elements.put(Raise_2006, ScxmlPackage.eINSTANCE.getRaise());
+
+			elements.put(Log_2007, ScxmlPackage.eINSTANCE.getLog());
+
+			elements.put(Validate_2008, ScxmlPackage.eINSTANCE.getValidate());
+
+			elements.put(Cancel_2009, ScxmlPackage.eINSTANCE.getCancel());
+
+			elements.put(Send_2010, ScxmlPackage.eINSTANCE.getSend());
+
+			elements.put(Param_2011, ScxmlPackage.eINSTANCE.getParam());
+
+			elements.put(Content_2012, ScxmlPackage.eINSTANCE.getContent());
+
+			elements.put(Content_2013, ScxmlPackage.eINSTANCE.getContent());
+
+			elements.put(Param_2014, ScxmlPackage.eINSTANCE.getParam());
+
+			elements.put(Script_2015, ScxmlPackage.eINSTANCE.getScript());
+
+			elements.put(OnExit_2016, ScxmlPackage.eINSTANCE.getOnExit());
+
+			elements.put(If_2017, ScxmlPackage.eINSTANCE.getIf());
+
+			elements.put(Assign_2018, ScxmlPackage.eINSTANCE.getAssign());
+
+			elements.put(Raise_2019, ScxmlPackage.eINSTANCE.getRaise());
+
+			elements.put(Log_2020, ScxmlPackage.eINSTANCE.getLog());
+
+			elements.put(Validate_2021, ScxmlPackage.eINSTANCE.getValidate());
+
+			elements.put(Cancel_2022, ScxmlPackage.eINSTANCE.getCancel());
+
+			elements.put(Param_2023, ScxmlPackage.eINSTANCE.getParam());
+
+			elements.put(Send_2024, ScxmlPackage.eINSTANCE.getSend());
+
+			elements.put(Script_2025, ScxmlPackage.eINSTANCE.getScript());
+
+			elements.put(Invoke_2026, ScxmlPackage.eINSTANCE.getInvoke());
+
+			elements.put(Finalize_2027, ScxmlPackage.eINSTANCE.getFinalize());
+
+			elements.put(Param_2028, ScxmlPackage.eINSTANCE.getParam());
+
+			elements.put(Content_2029, ScxmlPackage.eINSTANCE.getContent());
+
+			elements.put(InitialState_2030, ScxmlPackage.eINSTANCE
+					.getInitialState());
+
+			elements.put(HistoryState_2031, ScxmlPackage.eINSTANCE
+					.getHistoryState());
+
+			elements.put(Parallel_2032, ScxmlPackage.eINSTANCE.getParallel());
+
+			elements.put(HistoryState_2033, ScxmlPackage.eINSTANCE
+					.getHistoryState());
+
+			elements.put(Anchor_2034, ScxmlPackage.eINSTANCE.getAnchor());
+
+			elements.put(Parallel_2035, ScxmlPackage.eINSTANCE.getParallel());
+
+			elements.put(OnEntry_2036, ScxmlPackage.eINSTANCE.getOnEntry());
+
+			elements.put(OnExit_2037, ScxmlPackage.eINSTANCE.getOnExit());
+
+			elements.put(State_2038, ScxmlPackage.eINSTANCE.getState());
+
+			elements.put(Anchor_2039, ScxmlPackage.eINSTANCE.getAnchor());
+
+			elements.put(FinalState_2040, ScxmlPackage.eINSTANCE
+					.getFinalState());
+
+			elements.put(Donedata_2041, ScxmlPackage.eINSTANCE.getDonedata());
+
+			elements.put(Param_2042, ScxmlPackage.eINSTANCE.getParam());
+
+			elements.put(Content_2043, ScxmlPackage.eINSTANCE.getContent());
+
+			elements.put(OnEntry_2044, ScxmlPackage.eINSTANCE.getOnEntry());
+
+			elements.put(OnExit_2045, ScxmlPackage.eINSTANCE.getOnExit());
+
+			elements.put(State_2046, ScxmlPackage.eINSTANCE.getState());
+
+			elements.put(Data_2047, ScxmlPackage.eINSTANCE.getData());
+
+			elements.put(Content_2048, ScxmlPackage.eINSTANCE.getContent());
+
+			elements.put(Translation_3001, ScxmlPackage.eINSTANCE
+					.getTranslation());
+		}
+		return (ENamedElement) elements.get(type);
+	}
+
+	/**
+	 * @generated
+	 */
+	private static IElementType getElementType(String id) {
+		return ElementTypeRegistry.getInstance().getType(id);
+	}
+
+	/**
+	 * @generated
+	 */
+	public static boolean isKnownElementType(IElementType elementType) {
+		if (KNOWN_ELEMENT_TYPES == null) {
+			KNOWN_ELEMENT_TYPES = new HashSet();
+			KNOWN_ELEMENT_TYPES.add(ServiceTemplate_79);
+			KNOWN_ELEMENT_TYPES.add(State_1001);
+			KNOWN_ELEMENT_TYPES.add(InitialState_1002);
+			KNOWN_ELEMENT_TYPES.add(Script_1003);
+			KNOWN_ELEMENT_TYPES.add(Parallel_1004);
+			KNOWN_ELEMENT_TYPES.add(DataModel_1005);
+			KNOWN_ELEMENT_TYPES.add(FinalState_1006);
+			KNOWN_ELEMENT_TYPES.add(OnEntry_2001);
+			KNOWN_ELEMENT_TYPES.add(If_2002);
+			KNOWN_ELEMENT_TYPES.add(ElseIf_2003);
+			KNOWN_ELEMENT_TYPES.add(Else_2004);
+			KNOWN_ELEMENT_TYPES.add(Assign_2005);
+			KNOWN_ELEMENT_TYPES.add(Raise_2006);
+			KNOWN_ELEMENT_TYPES.add(Log_2007);
+			KNOWN_ELEMENT_TYPES.add(Validate_2008);
+			KNOWN_ELEMENT_TYPES.add(Cancel_2009);
+			KNOWN_ELEMENT_TYPES.add(Send_2010);
+			KNOWN_ELEMENT_TYPES.add(Param_2011);
+			KNOWN_ELEMENT_TYPES.add(Content_2012);
+			KNOWN_ELEMENT_TYPES.add(Content_2013);
+			KNOWN_ELEMENT_TYPES.add(Param_2014);
+			KNOWN_ELEMENT_TYPES.add(Script_2015);
+			KNOWN_ELEMENT_TYPES.add(OnExit_2016);
+			KNOWN_ELEMENT_TYPES.add(If_2017);
+			KNOWN_ELEMENT_TYPES.add(Assign_2018);
+			KNOWN_ELEMENT_TYPES.add(Raise_2019);
+			KNOWN_ELEMENT_TYPES.add(Log_2020);
+			KNOWN_ELEMENT_TYPES.add(Validate_2021);
+			KNOWN_ELEMENT_TYPES.add(Cancel_2022);
+			KNOWN_ELEMENT_TYPES.add(Param_2023);
+			KNOWN_ELEMENT_TYPES.add(Send_2024);
+			KNOWN_ELEMENT_TYPES.add(Script_2025);
+			KNOWN_ELEMENT_TYPES.add(Invoke_2026);
+			KNOWN_ELEMENT_TYPES.add(Finalize_2027);
+			KNOWN_ELEMENT_TYPES.add(Param_2028);
+			KNOWN_ELEMENT_TYPES.add(Content_2029);
+			KNOWN_ELEMENT_TYPES.add(InitialState_2030);
+			KNOWN_ELEMENT_TYPES.add(HistoryState_2031);
+			KNOWN_ELEMENT_TYPES.add(Parallel_2032);
+			KNOWN_ELEMENT_TYPES.add(HistoryState_2033);
+			KNOWN_ELEMENT_TYPES.add(Anchor_2034);
+			KNOWN_ELEMENT_TYPES.add(Parallel_2035);
+			KNOWN_ELEMENT_TYPES.add(OnEntry_2036);
+			KNOWN_ELEMENT_TYPES.add(OnExit_2037);
+			KNOWN_ELEMENT_TYPES.add(State_2038);
+			KNOWN_ELEMENT_TYPES.add(Anchor_2039);
+			KNOWN_ELEMENT_TYPES.add(FinalState_2040);
+			KNOWN_ELEMENT_TYPES.add(Donedata_2041);
+			KNOWN_ELEMENT_TYPES.add(Param_2042);
+			KNOWN_ELEMENT_TYPES.add(Content_2043);
+			KNOWN_ELEMENT_TYPES.add(OnEntry_2044);
+			KNOWN_ELEMENT_TYPES.add(OnExit_2045);
+			KNOWN_ELEMENT_TYPES.add(State_2046);
+			KNOWN_ELEMENT_TYPES.add(Data_2047);
+			KNOWN_ELEMENT_TYPES.add(Content_2048);
+			KNOWN_ELEMENT_TYPES.add(Translation_3001);
+		}
+		return KNOWN_ELEMENT_TYPES.contains(elementType);
+	}
+
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlElementTypes.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlIconProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlIconProvider.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlIconProvider.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlIconProvider.java Mon May 17 14:38:45 2010
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.scxml.diagram.providers;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.common.ui.services.icon.GetIconOperation;
+import org.eclipse.gmf.runtime.common.ui.services.icon.IIconProvider;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @generated
+ */
+public class ScxmlIconProvider extends AbstractProvider implements
+		IIconProvider {
+
+	/**
+	 * @generated
+	 */
+	public Image getIcon(IAdaptable hint, int flags) {
+		return ScxmlElementTypes.getImage(hint);
+	}
+
+	/**
+	 * @generated
+	 */
+	public boolean provides(IOperation operation) {
+		if (operation instanceof GetIconOperation) {
+			return ((GetIconOperation) operation).execute(this) != null;
+		}
+		return false;
+	}
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlIconProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlModelingAssistantProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlModelingAssistantProvider.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlModelingAssistantProvider.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlModelingAssistantProvider.java Mon May 17 14:38:45 2010
@@ -0,0 +1,451 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.scxml.diagram.providers;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.commons.scxml.diagram.edit.parts.ContentContentCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ContentContentCompartment3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ContentContentCompartment4EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ContentContentCompartment5EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ContentContentCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.DataDataCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.DataModelDataModelCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.DonedataDonedataCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.FinalStateFinalStateCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.FinalStateFinalStateCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.If2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.IfEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.InvokeInvokeCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnEntryOnEntryCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnEntryOnEntryCompartment3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnEntryOnEntryCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnExitOnExitCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnExitOnExitCompartment3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.OnExitOnExitCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ParallelParallelCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ParallelParallelCompartment3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ParallelParallelCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.SendSendCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.SendSendCompartmentEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ServiceTemplateEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.StateStateCompartment2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.StateStateCompartment3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.StateStateCompartmentEditPart;
+import org.apache.commons.scxml.diagram.part.Messages;
+import org.apache.commons.scxml.diagram.part.ScxmlDiagramEditorPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.ui.services.modelingassistant.ModelingAssistantProvider;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+
+/**
+ * @generated
+ */
+public class ScxmlModelingAssistantProvider extends ModelingAssistantProvider {
+
+	/**
+	 * @generated
+	 */
+	public List getTypesForPopupBar(IAdaptable host) {
+		IGraphicalEditPart editPart = (IGraphicalEditPart) host
+				.getAdapter(IGraphicalEditPart.class);
+		if (editPart instanceof IfEditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.ElseIf_2003);
+			types.add(ScxmlElementTypes.Else_2004);
+			return types;
+		}
+		if (editPart instanceof If2EditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.ElseIf_2003);
+			types.add(ScxmlElementTypes.Else_2004);
+			return types;
+		}
+		if (editPart instanceof StateStateCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.OnEntry_2001);
+			types.add(ScxmlElementTypes.OnExit_2016);
+			types.add(ScxmlElementTypes.Invoke_2026);
+			types.add(ScxmlElementTypes.InitialState_2030);
+			types.add(ScxmlElementTypes.HistoryState_2031);
+			types.add(ScxmlElementTypes.Parallel_2032);
+			types.add(ScxmlElementTypes.Anchor_2039);
+			types.add(ScxmlElementTypes.FinalState_2040);
+			types.add(ScxmlElementTypes.State_2046);
+			return types;
+		}
+		if (editPart instanceof OnEntryOnEntryCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.If_2002);
+			types.add(ScxmlElementTypes.Assign_2005);
+			types.add(ScxmlElementTypes.Raise_2006);
+			types.add(ScxmlElementTypes.Log_2007);
+			types.add(ScxmlElementTypes.Validate_2008);
+			types.add(ScxmlElementTypes.Cancel_2009);
+			types.add(ScxmlElementTypes.Send_2010);
+			types.add(ScxmlElementTypes.Param_2014);
+			types.add(ScxmlElementTypes.Script_2015);
+			return types;
+		}
+		if (editPart instanceof SendSendCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.Param_2011);
+			types.add(ScxmlElementTypes.Content_2012);
+			return types;
+		}
+		if (editPart instanceof ContentContentCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.Content_2013);
+			return types;
+		}
+		if (editPart instanceof ContentContentCompartment2EditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.Content_2013);
+			return types;
+		}
+		if (editPart instanceof OnExitOnExitCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.If_2017);
+			types.add(ScxmlElementTypes.Assign_2018);
+			types.add(ScxmlElementTypes.Raise_2019);
+			types.add(ScxmlElementTypes.Log_2020);
+			types.add(ScxmlElementTypes.Validate_2021);
+			types.add(ScxmlElementTypes.Cancel_2022);
+			types.add(ScxmlElementTypes.Param_2023);
+			types.add(ScxmlElementTypes.Send_2024);
+			types.add(ScxmlElementTypes.Script_2025);
+			return types;
+		}
+		if (editPart instanceof SendSendCompartment2EditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.Param_2011);
+			types.add(ScxmlElementTypes.Content_2012);
+			return types;
+		}
+		if (editPart instanceof InvokeInvokeCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.Finalize_2027);
+			types.add(ScxmlElementTypes.Param_2028);
+			types.add(ScxmlElementTypes.Content_2029);
+			return types;
+		}
+		if (editPart instanceof ContentContentCompartment3EditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.Content_2013);
+			return types;
+		}
+		if (editPart instanceof ParallelParallelCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.HistoryState_2033);
+			types.add(ScxmlElementTypes.Anchor_2034);
+			types.add(ScxmlElementTypes.Parallel_2035);
+			types.add(ScxmlElementTypes.OnEntry_2036);
+			types.add(ScxmlElementTypes.OnExit_2037);
+			types.add(ScxmlElementTypes.State_2038);
+			return types;
+		}
+		if (editPart instanceof ParallelParallelCompartment2EditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.HistoryState_2033);
+			types.add(ScxmlElementTypes.Anchor_2034);
+			types.add(ScxmlElementTypes.Parallel_2035);
+			types.add(ScxmlElementTypes.OnEntry_2036);
+			types.add(ScxmlElementTypes.OnExit_2037);
+			types.add(ScxmlElementTypes.State_2038);
+			return types;
+		}
+		if (editPart instanceof OnEntryOnEntryCompartment2EditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.If_2002);
+			types.add(ScxmlElementTypes.Assign_2005);
+			types.add(ScxmlElementTypes.Raise_2006);
+			types.add(ScxmlElementTypes.Log_2007);
+			types.add(ScxmlElementTypes.Validate_2008);
+			types.add(ScxmlElementTypes.Cancel_2009);
+			types.add(ScxmlElementTypes.Send_2010);
+			types.add(ScxmlElementTypes.Param_2014);
+			types.add(ScxmlElementTypes.Script_2015);
+			return types;
+		}
+		if (editPart instanceof OnExitOnExitCompartment2EditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.If_2017);
+			types.add(ScxmlElementTypes.Assign_2018);
+			types.add(ScxmlElementTypes.Raise_2019);
+			types.add(ScxmlElementTypes.Log_2020);
+			types.add(ScxmlElementTypes.Validate_2021);
+			types.add(ScxmlElementTypes.Cancel_2022);
+			types.add(ScxmlElementTypes.Param_2023);
+			types.add(ScxmlElementTypes.Send_2024);
+			types.add(ScxmlElementTypes.Script_2025);
+			return types;
+		}
+		if (editPart instanceof StateStateCompartment2EditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.OnEntry_2001);
+			types.add(ScxmlElementTypes.OnExit_2016);
+			types.add(ScxmlElementTypes.Invoke_2026);
+			types.add(ScxmlElementTypes.InitialState_2030);
+			types.add(ScxmlElementTypes.HistoryState_2031);
+			types.add(ScxmlElementTypes.Parallel_2032);
+			types.add(ScxmlElementTypes.Anchor_2039);
+			types.add(ScxmlElementTypes.FinalState_2040);
+			types.add(ScxmlElementTypes.State_2046);
+			return types;
+		}
+		if (editPart instanceof FinalStateFinalStateCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.Donedata_2041);
+			types.add(ScxmlElementTypes.OnEntry_2044);
+			types.add(ScxmlElementTypes.OnExit_2045);
+			return types;
+		}
+		if (editPart instanceof DonedataDonedataCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.Param_2042);
+			types.add(ScxmlElementTypes.Content_2043);
+			return types;
+		}
+		if (editPart instanceof ContentContentCompartment4EditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.Content_2013);
+			return types;
+		}
+		if (editPart instanceof OnEntryOnEntryCompartment3EditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.If_2002);
+			types.add(ScxmlElementTypes.Assign_2005);
+			types.add(ScxmlElementTypes.Raise_2006);
+			types.add(ScxmlElementTypes.Log_2007);
+			types.add(ScxmlElementTypes.Validate_2008);
+			types.add(ScxmlElementTypes.Cancel_2009);
+			types.add(ScxmlElementTypes.Send_2010);
+			types.add(ScxmlElementTypes.Param_2014);
+			types.add(ScxmlElementTypes.Script_2015);
+			return types;
+		}
+		if (editPart instanceof OnExitOnExitCompartment3EditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.If_2017);
+			types.add(ScxmlElementTypes.Assign_2018);
+			types.add(ScxmlElementTypes.Raise_2019);
+			types.add(ScxmlElementTypes.Log_2020);
+			types.add(ScxmlElementTypes.Validate_2021);
+			types.add(ScxmlElementTypes.Cancel_2022);
+			types.add(ScxmlElementTypes.Param_2023);
+			types.add(ScxmlElementTypes.Send_2024);
+			types.add(ScxmlElementTypes.Script_2025);
+			return types;
+		}
+		if (editPart instanceof StateStateCompartment3EditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.OnEntry_2001);
+			types.add(ScxmlElementTypes.OnExit_2016);
+			types.add(ScxmlElementTypes.Invoke_2026);
+			types.add(ScxmlElementTypes.InitialState_2030);
+			types.add(ScxmlElementTypes.HistoryState_2031);
+			types.add(ScxmlElementTypes.Parallel_2032);
+			types.add(ScxmlElementTypes.Anchor_2039);
+			types.add(ScxmlElementTypes.FinalState_2040);
+			types.add(ScxmlElementTypes.State_2046);
+			return types;
+		}
+		if (editPart instanceof ParallelParallelCompartment3EditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.HistoryState_2033);
+			types.add(ScxmlElementTypes.Anchor_2034);
+			types.add(ScxmlElementTypes.Parallel_2035);
+			types.add(ScxmlElementTypes.OnEntry_2036);
+			types.add(ScxmlElementTypes.OnExit_2037);
+			types.add(ScxmlElementTypes.State_2038);
+			return types;
+		}
+		if (editPart instanceof DataModelDataModelCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.Data_2047);
+			return types;
+		}
+		if (editPart instanceof DataDataCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.Content_2048);
+			return types;
+		}
+		if (editPart instanceof ContentContentCompartment5EditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.Content_2013);
+			return types;
+		}
+		if (editPart instanceof FinalStateFinalStateCompartment2EditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.Donedata_2041);
+			types.add(ScxmlElementTypes.OnEntry_2044);
+			types.add(ScxmlElementTypes.OnExit_2045);
+			return types;
+		}
+		if (editPart instanceof ServiceTemplateEditPart) {
+			List types = new ArrayList();
+			types.add(ScxmlElementTypes.State_1001);
+			types.add(ScxmlElementTypes.InitialState_1002);
+			types.add(ScxmlElementTypes.Script_1003);
+			types.add(ScxmlElementTypes.Parallel_1004);
+			types.add(ScxmlElementTypes.DataModel_1005);
+			types.add(ScxmlElementTypes.FinalState_1006);
+			return types;
+		}
+		return Collections.EMPTY_LIST;
+	}
+
+	/**
+	 * @generated
+	 */
+	public List getRelTypesOnSource(IAdaptable source) {
+		IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source
+				.getAdapter(IGraphicalEditPart.class);
+		return Collections.EMPTY_LIST;
+	}
+
+	/**
+	 * @generated
+	 */
+	public List getRelTypesOnTarget(IAdaptable target) {
+		IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target
+				.getAdapter(IGraphicalEditPart.class);
+		return Collections.EMPTY_LIST;
+	}
+
+	/**
+	 * @generated
+	 */
+	public List getRelTypesOnSourceAndTarget(IAdaptable source,
+			IAdaptable target) {
+		IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source
+				.getAdapter(IGraphicalEditPart.class);
+		IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target
+				.getAdapter(IGraphicalEditPart.class);
+		return Collections.EMPTY_LIST;
+	}
+
+	/**
+	 * @generated
+	 */
+	public List getTypesForSource(IAdaptable target,
+			IElementType relationshipType) {
+		IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target
+				.getAdapter(IGraphicalEditPart.class);
+		return Collections.EMPTY_LIST;
+	}
+
+	/**
+	 * @generated
+	 */
+	public List getTypesForTarget(IAdaptable source,
+			IElementType relationshipType) {
+		IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source
+				.getAdapter(IGraphicalEditPart.class);
+		return Collections.EMPTY_LIST;
+	}
+
+	/**
+	 * @generated
+	 */
+	public EObject selectExistingElementForSource(IAdaptable target,
+			IElementType relationshipType) {
+		return selectExistingElement(target, getTypesForSource(target,
+				relationshipType));
+	}
+
+	/**
+	 * @generated
+	 */
+	public EObject selectExistingElementForTarget(IAdaptable source,
+			IElementType relationshipType) {
+		return selectExistingElement(source, getTypesForTarget(source,
+				relationshipType));
+	}
+
+	/**
+	 * @generated
+	 */
+	protected EObject selectExistingElement(IAdaptable host, Collection types) {
+		if (types.isEmpty()) {
+			return null;
+		}
+		IGraphicalEditPart editPart = (IGraphicalEditPart) host
+				.getAdapter(IGraphicalEditPart.class);
+		if (editPart == null) {
+			return null;
+		}
+		Diagram diagram = (Diagram) editPart.getRoot().getContents().getModel();
+		Collection elements = new HashSet();
+		for (Iterator it = diagram.getElement().eAllContents(); it.hasNext();) {
+			EObject element = (EObject) it.next();
+			if (isApplicableElement(element, types)) {
+				elements.add(element);
+			}
+		}
+		if (elements.isEmpty()) {
+			return null;
+		}
+		return selectElement((EObject[]) elements.toArray(new EObject[elements
+				.size()]));
+	}
+
+	/**
+	 * @generated
+	 */
+	protected boolean isApplicableElement(EObject element, Collection types) {
+		IElementType type = ElementTypeRegistry.getInstance().getElementType(
+				element);
+		return types.contains(type);
+	}
+
+	/**
+	 * @generated
+	 */
+	protected EObject selectElement(EObject[] elements) {
+		Shell shell = Display.getCurrent().getActiveShell();
+		ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
+				ScxmlDiagramEditorPlugin.getInstance()
+						.getItemProvidersAdapterFactory());
+		ElementListSelectionDialog dialog = new ElementListSelectionDialog(
+				shell, labelProvider);
+		dialog.setMessage(Messages.ScxmlModelingAssistantProviderMessage);
+		dialog.setTitle(Messages.ScxmlModelingAssistantProviderTitle);
+		dialog.setMultipleSelection(false);
+		dialog.setElements(elements);
+		EObject selected = null;
+		if (dialog.open() == Window.OK) {
+			selected = (EObject) dialog.getFirstResult();
+		}
+		return selected;
+	}
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlModelingAssistantProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlParserProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlParserProvider.java?rev=945185&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlParserProvider.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlParserProvider.java Mon May 17 14:38:45 2010
@@ -0,0 +1,1172 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.scxml.diagram.providers;
+
+import org.apache.commons.scxml.ScxmlPackage;
+import org.apache.commons.scxml.diagram.edit.parts.AnchorType2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.AnchorTypeEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.AssignDataid2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.AssignDataidEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.AssignExpr2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.AssignExprEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.CancelSendid2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.CancelSendidEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.DataIdEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.DataModelSchemaEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ElseIfCondEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.FinalStateId2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.FinalStateIdEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.HistoryStateId2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.HistoryStateIdEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.IfCond2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.IfCondEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.InvokeTypeEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.LogExpr2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.LogExprEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ParallelId2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ParallelId3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ParallelIdEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ParamName2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ParamName3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ParamName4EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ParamName5EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ParamNameEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.RaiseEvent2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.RaiseEventEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.SendEvent2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.SendEventEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.StateId2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.StateId3EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.StateIdEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.TranslationEventEditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ValidateSchema2EditPart;
+import org.apache.commons.scxml.diagram.edit.parts.ValidateSchemaEditPart;
+import org.apache.commons.scxml.diagram.parsers.MessageFormatParser;
+import org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.common.ui.services.parser.GetParserOperation;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserProvider;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ParserHintAdapter;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class ScxmlParserProvider extends AbstractProvider implements
+		IParserProvider {
+
+	/**
+	 * @generated
+	 */
+	private IParser stateId_4045Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getStateId_4045Parser() {
+		if (stateId_4045Parser == null) {
+			stateId_4045Parser = createStateId_4045Parser();
+		}
+		return stateId_4045Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createStateId_4045Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getState_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser parallelId_4048Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getParallelId_4048Parser() {
+		if (parallelId_4048Parser == null) {
+			parallelId_4048Parser = createParallelId_4048Parser();
+		}
+		return parallelId_4048Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createParallelId_4048Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getParallel_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser dataModelSchema_4050Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getDataModelSchema_4050Parser() {
+		if (dataModelSchema_4050Parser == null) {
+			dataModelSchema_4050Parser = createDataModelSchema_4050Parser();
+		}
+		return dataModelSchema_4050Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createDataModelSchema_4050Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getDataModel_Schema(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser finalStateId_4051Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getFinalStateId_4051Parser() {
+		if (finalStateId_4051Parser == null) {
+			finalStateId_4051Parser = createFinalStateId_4051Parser();
+		}
+		return finalStateId_4051Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createFinalStateId_4051Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getFinalState_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser ifCond_4003Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getIfCond_4003Parser() {
+		if (ifCond_4003Parser == null) {
+			ifCond_4003Parser = createIfCond_4003Parser();
+		}
+		return ifCond_4003Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createIfCond_4003Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getIf_Cond(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser elseIfCond_4001Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getElseIfCond_4001Parser() {
+		if (elseIfCond_4001Parser == null) {
+			elseIfCond_4001Parser = createElseIfCond_4001Parser();
+		}
+		return elseIfCond_4001Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createElseIfCond_4001Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getElseIf_Cond(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser assignDataid_4004Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getAssignDataid_4004Parser() {
+		if (assignDataid_4004Parser == null) {
+			assignDataid_4004Parser = createAssignDataid_4004Parser();
+		}
+		return assignDataid_4004Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createAssignDataid_4004Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getAssign_Dataid(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser assignExpr_4005Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getAssignExpr_4005Parser() {
+		if (assignExpr_4005Parser == null) {
+			assignExpr_4005Parser = createAssignExpr_4005Parser();
+		}
+		return assignExpr_4005Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createAssignExpr_4005Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getAssign_Expr(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser raiseEvent_4006Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getRaiseEvent_4006Parser() {
+		if (raiseEvent_4006Parser == null) {
+			raiseEvent_4006Parser = createRaiseEvent_4006Parser();
+		}
+		return raiseEvent_4006Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createRaiseEvent_4006Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getRaise_Event(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser logExpr_4007Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getLogExpr_4007Parser() {
+		if (logExpr_4007Parser == null) {
+			logExpr_4007Parser = createLogExpr_4007Parser();
+		}
+		return logExpr_4007Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createLogExpr_4007Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getLog_Expr(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser validateSchema_4008Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getValidateSchema_4008Parser() {
+		if (validateSchema_4008Parser == null) {
+			validateSchema_4008Parser = createValidateSchema_4008Parser();
+		}
+		return validateSchema_4008Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createValidateSchema_4008Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getValidate_Schema(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser cancelSendid_4009Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getCancelSendid_4009Parser() {
+		if (cancelSendid_4009Parser == null) {
+			cancelSendid_4009Parser = createCancelSendid_4009Parser();
+		}
+		return cancelSendid_4009Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createCancelSendid_4009Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getCancel_Sendid(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser sendEvent_4011Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getSendEvent_4011Parser() {
+		if (sendEvent_4011Parser == null) {
+			sendEvent_4011Parser = createSendEvent_4011Parser();
+		}
+		return sendEvent_4011Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createSendEvent_4011Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getSend_Event(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser paramName_4010Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getParamName_4010Parser() {
+		if (paramName_4010Parser == null) {
+			paramName_4010Parser = createParamName_4010Parser();
+		}
+		return paramName_4010Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createParamName_4010Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getParam_Name(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser paramName_4012Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getParamName_4012Parser() {
+		if (paramName_4012Parser == null) {
+			paramName_4012Parser = createParamName_4012Parser();
+		}
+		return paramName_4012Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createParamName_4012Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getParam_Name(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser ifCond_4015Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getIfCond_4015Parser() {
+		if (ifCond_4015Parser == null) {
+			ifCond_4015Parser = createIfCond_4015Parser();
+		}
+		return ifCond_4015Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createIfCond_4015Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getIf_Cond(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser assignDataid_4016Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getAssignDataid_4016Parser() {
+		if (assignDataid_4016Parser == null) {
+			assignDataid_4016Parser = createAssignDataid_4016Parser();
+		}
+		return assignDataid_4016Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createAssignDataid_4016Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getAssign_Dataid(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser assignExpr_4017Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getAssignExpr_4017Parser() {
+		if (assignExpr_4017Parser == null) {
+			assignExpr_4017Parser = createAssignExpr_4017Parser();
+		}
+		return assignExpr_4017Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createAssignExpr_4017Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getAssign_Expr(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser raiseEvent_4018Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getRaiseEvent_4018Parser() {
+		if (raiseEvent_4018Parser == null) {
+			raiseEvent_4018Parser = createRaiseEvent_4018Parser();
+		}
+		return raiseEvent_4018Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createRaiseEvent_4018Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getRaise_Event(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser logExpr_4019Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getLogExpr_4019Parser() {
+		if (logExpr_4019Parser == null) {
+			logExpr_4019Parser = createLogExpr_4019Parser();
+		}
+		return logExpr_4019Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createLogExpr_4019Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getLog_Expr(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser validateSchema_4020Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getValidateSchema_4020Parser() {
+		if (validateSchema_4020Parser == null) {
+			validateSchema_4020Parser = createValidateSchema_4020Parser();
+		}
+		return validateSchema_4020Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createValidateSchema_4020Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getValidate_Schema(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser cancelSendid_4021Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getCancelSendid_4021Parser() {
+		if (cancelSendid_4021Parser == null) {
+			cancelSendid_4021Parser = createCancelSendid_4021Parser();
+		}
+		return cancelSendid_4021Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createCancelSendid_4021Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getCancel_Sendid(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser paramName_4022Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getParamName_4022Parser() {
+		if (paramName_4022Parser == null) {
+			paramName_4022Parser = createParamName_4022Parser();
+		}
+		return paramName_4022Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createParamName_4022Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getParam_Name(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser sendEvent_4023Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getSendEvent_4023Parser() {
+		if (sendEvent_4023Parser == null) {
+			sendEvent_4023Parser = createSendEvent_4023Parser();
+		}
+		return sendEvent_4023Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createSendEvent_4023Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getSend_Event(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser invokeType_4028Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getInvokeType_4028Parser() {
+		if (invokeType_4028Parser == null) {
+			invokeType_4028Parser = createInvokeType_4028Parser();
+		}
+		return invokeType_4028Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createInvokeType_4028Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getInvoke_Type(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser paramName_4027Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getParamName_4027Parser() {
+		if (paramName_4027Parser == null) {
+			paramName_4027Parser = createParamName_4027Parser();
+		}
+		return paramName_4027Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createParamName_4027Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getParam_Name(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser historyStateId_4030Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getHistoryStateId_4030Parser() {
+		if (historyStateId_4030Parser == null) {
+			historyStateId_4030Parser = createHistoryStateId_4030Parser();
+		}
+		return historyStateId_4030Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createHistoryStateId_4030Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getHistoryState_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser parallelId_4044Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getParallelId_4044Parser() {
+		if (parallelId_4044Parser == null) {
+			parallelId_4044Parser = createParallelId_4044Parser();
+		}
+		return parallelId_4044Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createParallelId_4044Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getParallel_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser historyStateId_4031Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getHistoryStateId_4031Parser() {
+		if (historyStateId_4031Parser == null) {
+			historyStateId_4031Parser = createHistoryStateId_4031Parser();
+		}
+		return historyStateId_4031Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createHistoryStateId_4031Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getHistoryState_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser anchorType_4032Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getAnchorType_4032Parser() {
+		if (anchorType_4032Parser == null) {
+			anchorType_4032Parser = createAnchorType_4032Parser();
+		}
+		return anchorType_4032Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createAnchorType_4032Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getAnchor_Type(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser parallelId_4043Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getParallelId_4043Parser() {
+		if (parallelId_4043Parser == null) {
+			parallelId_4043Parser = createParallelId_4043Parser();
+		}
+		return parallelId_4043Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createParallelId_4043Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getParallel_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser stateId_4042Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getStateId_4042Parser() {
+		if (stateId_4042Parser == null) {
+			stateId_4042Parser = createStateId_4042Parser();
+		}
+		return stateId_4042Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createStateId_4042Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getState_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser anchorType_4035Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getAnchorType_4035Parser() {
+		if (anchorType_4035Parser == null) {
+			anchorType_4035Parser = createAnchorType_4035Parser();
+		}
+		return anchorType_4035Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createAnchorType_4035Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getAnchor_Type(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser finalStateId_4040Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getFinalStateId_4040Parser() {
+		if (finalStateId_4040Parser == null) {
+			finalStateId_4040Parser = createFinalStateId_4040Parser();
+		}
+		return finalStateId_4040Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createFinalStateId_4040Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getFinalState_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser paramName_4036Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getParamName_4036Parser() {
+		if (paramName_4036Parser == null) {
+			paramName_4036Parser = createParamName_4036Parser();
+		}
+		return paramName_4036Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createParamName_4036Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getParam_Name(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser stateId_4041Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getStateId_4041Parser() {
+		if (stateId_4041Parser == null) {
+			stateId_4041Parser = createStateId_4041Parser();
+		}
+		return stateId_4041Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createStateId_4041Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getState_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser dataId_4049Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getDataId_4049Parser() {
+		if (dataId_4049Parser == null) {
+			dataId_4049Parser = createDataId_4049Parser();
+		}
+		return dataId_4049Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createDataId_4049Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getData_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser translationEvent_4052Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getTranslationEvent_4052Parser() {
+		if (translationEvent_4052Parser == null) {
+			translationEvent_4052Parser = createTranslationEvent_4052Parser();
+		}
+		return translationEvent_4052Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createTranslationEvent_4052Parser() {
+		EAttribute[] features = new EAttribute[] { ScxmlPackage.eINSTANCE
+				.getTranslation_Event(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser getParser(int visualID) {
+		switch (visualID) {
+		case StateIdEditPart.VISUAL_ID:
+			return getStateId_4045Parser();
+		case ParallelIdEditPart.VISUAL_ID:
+			return getParallelId_4048Parser();
+		case DataModelSchemaEditPart.VISUAL_ID:
+			return getDataModelSchema_4050Parser();
+		case FinalStateIdEditPart.VISUAL_ID:
+			return getFinalStateId_4051Parser();
+		case IfCondEditPart.VISUAL_ID:
+			return getIfCond_4003Parser();
+		case ElseIfCondEditPart.VISUAL_ID:
+			return getElseIfCond_4001Parser();
+		case AssignDataidEditPart.VISUAL_ID:
+			return getAssignDataid_4004Parser();
+		case AssignExprEditPart.VISUAL_ID:
+			return getAssignExpr_4005Parser();
+		case RaiseEventEditPart.VISUAL_ID:
+			return getRaiseEvent_4006Parser();
+		case LogExprEditPart.VISUAL_ID:
+			return getLogExpr_4007Parser();
+		case ValidateSchemaEditPart.VISUAL_ID:
+			return getValidateSchema_4008Parser();
+		case CancelSendidEditPart.VISUAL_ID:
+			return getCancelSendid_4009Parser();
+		case SendEventEditPart.VISUAL_ID:
+			return getSendEvent_4011Parser();
+		case ParamNameEditPart.VISUAL_ID:
+			return getParamName_4010Parser();
+		case ParamName2EditPart.VISUAL_ID:
+			return getParamName_4012Parser();
+		case IfCond2EditPart.VISUAL_ID:
+			return getIfCond_4015Parser();
+		case AssignDataid2EditPart.VISUAL_ID:
+			return getAssignDataid_4016Parser();
+		case AssignExpr2EditPart.VISUAL_ID:
+			return getAssignExpr_4017Parser();
+		case RaiseEvent2EditPart.VISUAL_ID:
+			return getRaiseEvent_4018Parser();
+		case LogExpr2EditPart.VISUAL_ID:
+			return getLogExpr_4019Parser();
+		case ValidateSchema2EditPart.VISUAL_ID:
+			return getValidateSchema_4020Parser();
+		case CancelSendid2EditPart.VISUAL_ID:
+			return getCancelSendid_4021Parser();
+		case ParamName3EditPart.VISUAL_ID:
+			return getParamName_4022Parser();
+		case SendEvent2EditPart.VISUAL_ID:
+			return getSendEvent_4023Parser();
+		case InvokeTypeEditPart.VISUAL_ID:
+			return getInvokeType_4028Parser();
+		case ParamName4EditPart.VISUAL_ID:
+			return getParamName_4027Parser();
+		case HistoryStateIdEditPart.VISUAL_ID:
+			return getHistoryStateId_4030Parser();
+		case ParallelId2EditPart.VISUAL_ID:
+			return getParallelId_4044Parser();
+		case HistoryStateId2EditPart.VISUAL_ID:
+			return getHistoryStateId_4031Parser();
+		case AnchorTypeEditPart.VISUAL_ID:
+			return getAnchorType_4032Parser();
+		case ParallelId3EditPart.VISUAL_ID:
+			return getParallelId_4043Parser();
+		case StateId2EditPart.VISUAL_ID:
+			return getStateId_4042Parser();
+		case AnchorType2EditPart.VISUAL_ID:
+			return getAnchorType_4035Parser();
+		case FinalStateId2EditPart.VISUAL_ID:
+			return getFinalStateId_4040Parser();
+		case ParamName5EditPart.VISUAL_ID:
+			return getParamName_4036Parser();
+		case StateId3EditPart.VISUAL_ID:
+			return getStateId_4041Parser();
+		case DataIdEditPart.VISUAL_ID:
+			return getDataId_4049Parser();
+		case TranslationEventEditPart.VISUAL_ID:
+			return getTranslationEvent_4052Parser();
+		}
+		return null;
+	}
+
+	/**
+	 * @generated
+	 */
+	public IParser getParser(IAdaptable hint) {
+		String vid = (String) hint.getAdapter(String.class);
+		if (vid != null) {
+			return getParser(ScxmlVisualIDRegistry.getVisualID(vid));
+		}
+		View view = (View) hint.getAdapter(View.class);
+		if (view != null) {
+			return getParser(ScxmlVisualIDRegistry.getVisualID(view));
+		}
+		return null;
+	}
+
+	/**
+	 * @generated
+	 */
+	public boolean provides(IOperation operation) {
+		if (operation instanceof GetParserOperation) {
+			IAdaptable hint = ((GetParserOperation) operation).getHint();
+			if (ScxmlElementTypes.getElement(hint) == null) {
+				return false;
+			}
+			return getParser(hint) != null;
+		}
+		return false;
+	}
+
+	/**
+	 * @generated
+	 */
+	public static class HintAdapter extends ParserHintAdapter {
+
+		/**
+		 * @generated
+		 */
+		private final IElementType elementType;
+
+		/**
+		 * @generated
+		 */
+		public HintAdapter(IElementType type, EObject object, String parserHint) {
+			super(object, parserHint);
+			assert type != null;
+			elementType = type;
+		}
+
+		/**
+		 * @generated
+		 */
+		public Object getAdapter(Class adapter) {
+			if (IElementType.class.equals(adapter)) {
+				return elementType;
+			}
+			return super.getAdapter(adapter);
+		}
+	}
+
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlParserProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message