commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gu...@apache.org
Subject svn commit: r953075 [11/17] - in /commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram: edit/policies/ navigator/ providers/ sheet/ view/factories/
Date Wed, 09 Jun 2010 16:29:16 GMT
Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingElementTypes.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingElementTypes.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingElementTypes.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingElementTypes.java Wed Jun  9 16:29:10 2010
@@ -0,0 +1,611 @@
+/*
+ * 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.modeling.diagram.providers;
+
+import java.util.HashSet;
+import java.util.IdentityHashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingDiagramEditorPlugin;
+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 ModelingElementTypes extends ElementInitializers {
+
+	/**
+	 * @generated
+	 */
+	private ModelingElementTypes() {
+	}
+
+	/**
+	 * @generated
+	 */
+	private static Map elements;
+
+	/**
+	 * @generated
+	 */
+	private static ImageRegistry imageRegistry;
+
+	/**
+	 * @generated
+	 */
+	private static Set KNOWN_ELEMENT_TYPES;
+
+	/**
+	 * @generated
+	 */
+	public static final IElementType ServiceTemplate_1000 = getElementType("org.apache.commons.scxml.modeling.diagram.ServiceTemplate_1000"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType State_2001 = getElementType("org.apache.commons.scxml.modeling.diagram.State_2001"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Script_2003 = getElementType("org.apache.commons.scxml.modeling.diagram.Script_2003"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Parallel_2004 = getElementType("org.apache.commons.scxml.modeling.diagram.Parallel_2004"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType DataModel_2005 = getElementType("org.apache.commons.scxml.modeling.diagram.DataModel_2005"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType FinalState_2006 = getElementType("org.apache.commons.scxml.modeling.diagram.FinalState_2006"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType OnEntry_3001 = getElementType("org.apache.commons.scxml.modeling.diagram.OnEntry_3001"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType If_3002 = getElementType("org.apache.commons.scxml.modeling.diagram.If_3002"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType ElseIf_3003 = getElementType("org.apache.commons.scxml.modeling.diagram.ElseIf_3003"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Else_3004 = getElementType("org.apache.commons.scxml.modeling.diagram.Else_3004"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Assign_3005 = getElementType("org.apache.commons.scxml.modeling.diagram.Assign_3005"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Raise_3006 = getElementType("org.apache.commons.scxml.modeling.diagram.Raise_3006"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Log_3007 = getElementType("org.apache.commons.scxml.modeling.diagram.Log_3007"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Validate_3008 = getElementType("org.apache.commons.scxml.modeling.diagram.Validate_3008"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Cancel_3009 = getElementType("org.apache.commons.scxml.modeling.diagram.Cancel_3009"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Send_3010 = getElementType("org.apache.commons.scxml.modeling.diagram.Send_3010"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Param_3011 = getElementType("org.apache.commons.scxml.modeling.diagram.Param_3011"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Content_3012 = getElementType("org.apache.commons.scxml.modeling.diagram.Content_3012"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Content_3013 = getElementType("org.apache.commons.scxml.modeling.diagram.Content_3013"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Param_3014 = getElementType("org.apache.commons.scxml.modeling.diagram.Param_3014"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Script_3015 = getElementType("org.apache.commons.scxml.modeling.diagram.Script_3015"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType ExtenExecContent_3049 = getElementType("org.apache.commons.scxml.modeling.diagram.ExtenExecContent_3049"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType OnExit_3016 = getElementType("org.apache.commons.scxml.modeling.diagram.OnExit_3016"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType If_3017 = getElementType("org.apache.commons.scxml.modeling.diagram.If_3017"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Assign_3018 = getElementType("org.apache.commons.scxml.modeling.diagram.Assign_3018"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Raise_3019 = getElementType("org.apache.commons.scxml.modeling.diagram.Raise_3019"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Log_3020 = getElementType("org.apache.commons.scxml.modeling.diagram.Log_3020"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Validate_3021 = getElementType("org.apache.commons.scxml.modeling.diagram.Validate_3021"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Cancel_3022 = getElementType("org.apache.commons.scxml.modeling.diagram.Cancel_3022"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Param_3023 = getElementType("org.apache.commons.scxml.modeling.diagram.Param_3023"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Send_3024 = getElementType("org.apache.commons.scxml.modeling.diagram.Send_3024"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Script_3025 = getElementType("org.apache.commons.scxml.modeling.diagram.Script_3025"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType ExtenExecContent_3050 = getElementType("org.apache.commons.scxml.modeling.diagram.ExtenExecContent_3050"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Invoke_3026 = getElementType("org.apache.commons.scxml.modeling.diagram.Invoke_3026"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Finalize_3027 = getElementType("org.apache.commons.scxml.modeling.diagram.Finalize_3027"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Param_3028 = getElementType("org.apache.commons.scxml.modeling.diagram.Param_3028"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Content_3029 = getElementType("org.apache.commons.scxml.modeling.diagram.Content_3029"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType InitialState_3030 = getElementType("org.apache.commons.scxml.modeling.diagram.InitialState_3030"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType HistoryState_3031 = getElementType("org.apache.commons.scxml.modeling.diagram.HistoryState_3031"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Parallel_3032 = getElementType("org.apache.commons.scxml.modeling.diagram.Parallel_3032"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType HistoryState_3033 = getElementType("org.apache.commons.scxml.modeling.diagram.HistoryState_3033"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Anchor_3034 = getElementType("org.apache.commons.scxml.modeling.diagram.Anchor_3034"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Parallel_3035 = getElementType("org.apache.commons.scxml.modeling.diagram.Parallel_3035"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType OnEntry_3036 = getElementType("org.apache.commons.scxml.modeling.diagram.OnEntry_3036"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType OnExit_3037 = getElementType("org.apache.commons.scxml.modeling.diagram.OnExit_3037"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType State_3038 = getElementType("org.apache.commons.scxml.modeling.diagram.State_3038"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Anchor_3039 = getElementType("org.apache.commons.scxml.modeling.diagram.Anchor_3039"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType FinalState_3040 = getElementType("org.apache.commons.scxml.modeling.diagram.FinalState_3040"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Donedata_3041 = getElementType("org.apache.commons.scxml.modeling.diagram.Donedata_3041"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Param_3042 = getElementType("org.apache.commons.scxml.modeling.diagram.Param_3042"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Content_3043 = getElementType("org.apache.commons.scxml.modeling.diagram.Content_3043"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType OnEntry_3044 = getElementType("org.apache.commons.scxml.modeling.diagram.OnEntry_3044"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType OnExit_3045 = getElementType("org.apache.commons.scxml.modeling.diagram.OnExit_3045"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType State_3046 = getElementType("org.apache.commons.scxml.modeling.diagram.State_3046"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Data_3047 = getElementType("org.apache.commons.scxml.modeling.diagram.Data_3047"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Content_3048 = getElementType("org.apache.commons.scxml.modeling.diagram.Content_3048"); //$NON-NLS-1$
+	/**
+	 * @generated
+	 */
+	public static final IElementType Transition_4001 = getElementType("org.apache.commons.scxml.modeling.diagram.Transition_4001"); //$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 ModelingDiagramEditorPlugin.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_1000, ModelingPackage.eINSTANCE
+					.getServiceTemplate());
+
+			elements.put(State_2001, ModelingPackage.eINSTANCE.getState());
+
+			elements.put(Script_2003, ModelingPackage.eINSTANCE.getScript());
+
+			elements
+					.put(Parallel_2004, ModelingPackage.eINSTANCE.getParallel());
+
+			elements.put(DataModel_2005, ModelingPackage.eINSTANCE
+					.getDataModel());
+
+			elements.put(FinalState_2006, ModelingPackage.eINSTANCE
+					.getFinalState());
+
+			elements.put(OnEntry_3001, ModelingPackage.eINSTANCE.getOnEntry());
+
+			elements.put(If_3002, ModelingPackage.eINSTANCE.getIf());
+
+			elements.put(ElseIf_3003, ModelingPackage.eINSTANCE.getElseIf());
+
+			elements.put(Else_3004, ModelingPackage.eINSTANCE.getElse());
+
+			elements.put(Assign_3005, ModelingPackage.eINSTANCE.getAssign());
+
+			elements.put(Raise_3006, ModelingPackage.eINSTANCE.getRaise());
+
+			elements.put(Log_3007, ModelingPackage.eINSTANCE.getLog());
+
+			elements
+					.put(Validate_3008, ModelingPackage.eINSTANCE.getValidate());
+
+			elements.put(Cancel_3009, ModelingPackage.eINSTANCE.getCancel());
+
+			elements.put(Send_3010, ModelingPackage.eINSTANCE.getSend());
+
+			elements.put(Param_3011, ModelingPackage.eINSTANCE.getParam());
+
+			elements.put(Content_3012, ModelingPackage.eINSTANCE.getContent());
+
+			elements.put(Content_3013, ModelingPackage.eINSTANCE.getContent());
+
+			elements.put(Param_3014, ModelingPackage.eINSTANCE.getParam());
+
+			elements.put(Script_3015, ModelingPackage.eINSTANCE.getScript());
+
+			elements.put(ExtenExecContent_3049, ModelingPackage.eINSTANCE
+					.getExtenExecContent());
+
+			elements.put(OnExit_3016, ModelingPackage.eINSTANCE.getOnExit());
+
+			elements.put(If_3017, ModelingPackage.eINSTANCE.getIf());
+
+			elements.put(Assign_3018, ModelingPackage.eINSTANCE.getAssign());
+
+			elements.put(Raise_3019, ModelingPackage.eINSTANCE.getRaise());
+
+			elements.put(Log_3020, ModelingPackage.eINSTANCE.getLog());
+
+			elements
+					.put(Validate_3021, ModelingPackage.eINSTANCE.getValidate());
+
+			elements.put(Cancel_3022, ModelingPackage.eINSTANCE.getCancel());
+
+			elements.put(Param_3023, ModelingPackage.eINSTANCE.getParam());
+
+			elements.put(Send_3024, ModelingPackage.eINSTANCE.getSend());
+
+			elements.put(Script_3025, ModelingPackage.eINSTANCE.getScript());
+
+			elements.put(ExtenExecContent_3050, ModelingPackage.eINSTANCE
+					.getExtenExecContent());
+
+			elements.put(Invoke_3026, ModelingPackage.eINSTANCE.getInvoke());
+
+			elements
+					.put(Finalize_3027, ModelingPackage.eINSTANCE.getFinalize());
+
+			elements.put(Param_3028, ModelingPackage.eINSTANCE.getParam());
+
+			elements.put(Content_3029, ModelingPackage.eINSTANCE.getContent());
+
+			elements.put(InitialState_3030, ModelingPackage.eINSTANCE
+					.getInitialState());
+
+			elements.put(HistoryState_3031, ModelingPackage.eINSTANCE
+					.getHistoryState());
+
+			elements
+					.put(Parallel_3032, ModelingPackage.eINSTANCE.getParallel());
+
+			elements.put(HistoryState_3033, ModelingPackage.eINSTANCE
+					.getHistoryState());
+
+			elements.put(Anchor_3034, ModelingPackage.eINSTANCE.getAnchor());
+
+			elements
+					.put(Parallel_3035, ModelingPackage.eINSTANCE.getParallel());
+
+			elements.put(OnEntry_3036, ModelingPackage.eINSTANCE.getOnEntry());
+
+			elements.put(OnExit_3037, ModelingPackage.eINSTANCE.getOnExit());
+
+			elements.put(State_3038, ModelingPackage.eINSTANCE.getState());
+
+			elements.put(Anchor_3039, ModelingPackage.eINSTANCE.getAnchor());
+
+			elements.put(FinalState_3040, ModelingPackage.eINSTANCE
+					.getFinalState());
+
+			elements
+					.put(Donedata_3041, ModelingPackage.eINSTANCE.getDonedata());
+
+			elements.put(Param_3042, ModelingPackage.eINSTANCE.getParam());
+
+			elements.put(Content_3043, ModelingPackage.eINSTANCE.getContent());
+
+			elements.put(OnEntry_3044, ModelingPackage.eINSTANCE.getOnEntry());
+
+			elements.put(OnExit_3045, ModelingPackage.eINSTANCE.getOnExit());
+
+			elements.put(State_3046, ModelingPackage.eINSTANCE.getState());
+
+			elements.put(Data_3047, ModelingPackage.eINSTANCE.getData());
+
+			elements.put(Content_3048, ModelingPackage.eINSTANCE.getContent());
+
+			elements.put(Transition_4001, ModelingPackage.eINSTANCE
+					.getTransition());
+		}
+		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_1000);
+			KNOWN_ELEMENT_TYPES.add(State_2001);
+			KNOWN_ELEMENT_TYPES.add(Script_2003);
+			KNOWN_ELEMENT_TYPES.add(Parallel_2004);
+			KNOWN_ELEMENT_TYPES.add(DataModel_2005);
+			KNOWN_ELEMENT_TYPES.add(FinalState_2006);
+			KNOWN_ELEMENT_TYPES.add(OnEntry_3001);
+			KNOWN_ELEMENT_TYPES.add(If_3002);
+			KNOWN_ELEMENT_TYPES.add(ElseIf_3003);
+			KNOWN_ELEMENT_TYPES.add(Else_3004);
+			KNOWN_ELEMENT_TYPES.add(Assign_3005);
+			KNOWN_ELEMENT_TYPES.add(Raise_3006);
+			KNOWN_ELEMENT_TYPES.add(Log_3007);
+			KNOWN_ELEMENT_TYPES.add(Validate_3008);
+			KNOWN_ELEMENT_TYPES.add(Cancel_3009);
+			KNOWN_ELEMENT_TYPES.add(Send_3010);
+			KNOWN_ELEMENT_TYPES.add(Param_3011);
+			KNOWN_ELEMENT_TYPES.add(Content_3012);
+			KNOWN_ELEMENT_TYPES.add(Content_3013);
+			KNOWN_ELEMENT_TYPES.add(Param_3014);
+			KNOWN_ELEMENT_TYPES.add(Script_3015);
+			KNOWN_ELEMENT_TYPES.add(ExtenExecContent_3049);
+			KNOWN_ELEMENT_TYPES.add(OnExit_3016);
+			KNOWN_ELEMENT_TYPES.add(If_3017);
+			KNOWN_ELEMENT_TYPES.add(Assign_3018);
+			KNOWN_ELEMENT_TYPES.add(Raise_3019);
+			KNOWN_ELEMENT_TYPES.add(Log_3020);
+			KNOWN_ELEMENT_TYPES.add(Validate_3021);
+			KNOWN_ELEMENT_TYPES.add(Cancel_3022);
+			KNOWN_ELEMENT_TYPES.add(Param_3023);
+			KNOWN_ELEMENT_TYPES.add(Send_3024);
+			KNOWN_ELEMENT_TYPES.add(Script_3025);
+			KNOWN_ELEMENT_TYPES.add(ExtenExecContent_3050);
+			KNOWN_ELEMENT_TYPES.add(Invoke_3026);
+			KNOWN_ELEMENT_TYPES.add(Finalize_3027);
+			KNOWN_ELEMENT_TYPES.add(Param_3028);
+			KNOWN_ELEMENT_TYPES.add(Content_3029);
+			KNOWN_ELEMENT_TYPES.add(InitialState_3030);
+			KNOWN_ELEMENT_TYPES.add(HistoryState_3031);
+			KNOWN_ELEMENT_TYPES.add(Parallel_3032);
+			KNOWN_ELEMENT_TYPES.add(HistoryState_3033);
+			KNOWN_ELEMENT_TYPES.add(Anchor_3034);
+			KNOWN_ELEMENT_TYPES.add(Parallel_3035);
+			KNOWN_ELEMENT_TYPES.add(OnEntry_3036);
+			KNOWN_ELEMENT_TYPES.add(OnExit_3037);
+			KNOWN_ELEMENT_TYPES.add(State_3038);
+			KNOWN_ELEMENT_TYPES.add(Anchor_3039);
+			KNOWN_ELEMENT_TYPES.add(FinalState_3040);
+			KNOWN_ELEMENT_TYPES.add(Donedata_3041);
+			KNOWN_ELEMENT_TYPES.add(Param_3042);
+			KNOWN_ELEMENT_TYPES.add(Content_3043);
+			KNOWN_ELEMENT_TYPES.add(OnEntry_3044);
+			KNOWN_ELEMENT_TYPES.add(OnExit_3045);
+			KNOWN_ELEMENT_TYPES.add(State_3046);
+			KNOWN_ELEMENT_TYPES.add(Data_3047);
+			KNOWN_ELEMENT_TYPES.add(Content_3048);
+			KNOWN_ELEMENT_TYPES.add(Transition_4001);
+		}
+		return KNOWN_ELEMENT_TYPES.contains(elementType);
+	}
+
+}

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

Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingIconProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingIconProvider.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingIconProvider.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingIconProvider.java Wed Jun  9 16:29:10 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.modeling.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 ModelingIconProvider extends AbstractProvider implements
+		IIconProvider {
+
+	/**
+	 * @generated
+	 */
+	public Image getIcon(IAdaptable hint, int flags) {
+		return ModelingElementTypes.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.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingIconProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingModelingAssistantProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingModelingAssistantProvider.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingModelingAssistantProvider.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingModelingAssistantProvider.java Wed Jun  9 16:29:10 2010
@@ -0,0 +1,457 @@
+/*
+ * 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.modeling.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.modeling.diagram.edit.parts.ContentContentCompartment2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ContentContentCompartment3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ContentContentCompartment4EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ContentContentCompartment5EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ContentContentCompartmentEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.DataDataCompartmentEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.DataModelDataModelCompartmentEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.DonedataDonedataCompartmentEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.FinalStateFinalStateCompartment2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.FinalStateFinalStateCompartmentEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.If2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.IfEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.InvokeInvokeCompartmentEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnEntryOnEntryCompartment2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnEntryOnEntryCompartment3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnEntryOnEntryCompartmentEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnExitOnExitCompartment2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnExitOnExitCompartment3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.OnExitOnExitCompartmentEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ParallelParallelCompartment2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ParallelParallelCompartment3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ParallelParallelCompartmentEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.SendSendCompartment2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.SendSendCompartmentEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ServiceTemplateEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.StateStateCompartment2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.StateStateCompartment3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.StateStateCompartmentEditPart;
+import org.apache.commons.scxml.modeling.diagram.part.Messages;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingDiagramEditorPlugin;
+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 ModelingModelingAssistantProvider 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(ModelingElementTypes.ElseIf_3003);
+			types.add(ModelingElementTypes.Else_3004);
+			return types;
+		}
+		if (editPart instanceof If2EditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.ElseIf_3003);
+			types.add(ModelingElementTypes.Else_3004);
+			return types;
+		}
+		if (editPart instanceof StateStateCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.OnEntry_3001);
+			types.add(ModelingElementTypes.OnExit_3016);
+			types.add(ModelingElementTypes.Invoke_3026);
+			types.add(ModelingElementTypes.InitialState_3030);
+			types.add(ModelingElementTypes.HistoryState_3031);
+			types.add(ModelingElementTypes.Parallel_3032);
+			types.add(ModelingElementTypes.Anchor_3039);
+			types.add(ModelingElementTypes.FinalState_3040);
+			types.add(ModelingElementTypes.State_3046);
+			return types;
+		}
+		if (editPart instanceof OnEntryOnEntryCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.If_3002);
+			types.add(ModelingElementTypes.Assign_3005);
+			types.add(ModelingElementTypes.Raise_3006);
+			types.add(ModelingElementTypes.Log_3007);
+			types.add(ModelingElementTypes.Validate_3008);
+			types.add(ModelingElementTypes.Cancel_3009);
+			types.add(ModelingElementTypes.Send_3010);
+			types.add(ModelingElementTypes.Param_3014);
+			types.add(ModelingElementTypes.Script_3015);
+			types.add(ModelingElementTypes.ExtenExecContent_3049);
+			return types;
+		}
+		if (editPart instanceof SendSendCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.Param_3011);
+			types.add(ModelingElementTypes.Content_3012);
+			return types;
+		}
+		if (editPart instanceof ContentContentCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.Content_3013);
+			return types;
+		}
+		if (editPart instanceof ContentContentCompartment2EditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.Content_3013);
+			return types;
+		}
+		if (editPart instanceof OnExitOnExitCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.If_3017);
+			types.add(ModelingElementTypes.Assign_3018);
+			types.add(ModelingElementTypes.Raise_3019);
+			types.add(ModelingElementTypes.Log_3020);
+			types.add(ModelingElementTypes.Validate_3021);
+			types.add(ModelingElementTypes.Cancel_3022);
+			types.add(ModelingElementTypes.Param_3023);
+			types.add(ModelingElementTypes.Send_3024);
+			types.add(ModelingElementTypes.Script_3025);
+			types.add(ModelingElementTypes.ExtenExecContent_3050);
+			return types;
+		}
+		if (editPart instanceof SendSendCompartment2EditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.Param_3011);
+			types.add(ModelingElementTypes.Content_3012);
+			return types;
+		}
+		if (editPart instanceof InvokeInvokeCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.Finalize_3027);
+			types.add(ModelingElementTypes.Param_3028);
+			types.add(ModelingElementTypes.Content_3029);
+			return types;
+		}
+		if (editPart instanceof ContentContentCompartment3EditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.Content_3013);
+			return types;
+		}
+		if (editPart instanceof ParallelParallelCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.HistoryState_3033);
+			types.add(ModelingElementTypes.Anchor_3034);
+			types.add(ModelingElementTypes.Parallel_3035);
+			types.add(ModelingElementTypes.OnEntry_3036);
+			types.add(ModelingElementTypes.OnExit_3037);
+			types.add(ModelingElementTypes.State_3038);
+			return types;
+		}
+		if (editPart instanceof ParallelParallelCompartment2EditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.HistoryState_3033);
+			types.add(ModelingElementTypes.Anchor_3034);
+			types.add(ModelingElementTypes.Parallel_3035);
+			types.add(ModelingElementTypes.OnEntry_3036);
+			types.add(ModelingElementTypes.OnExit_3037);
+			types.add(ModelingElementTypes.State_3038);
+			return types;
+		}
+		if (editPart instanceof OnEntryOnEntryCompartment2EditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.If_3002);
+			types.add(ModelingElementTypes.Assign_3005);
+			types.add(ModelingElementTypes.Raise_3006);
+			types.add(ModelingElementTypes.Log_3007);
+			types.add(ModelingElementTypes.Validate_3008);
+			types.add(ModelingElementTypes.Cancel_3009);
+			types.add(ModelingElementTypes.Send_3010);
+			types.add(ModelingElementTypes.Param_3014);
+			types.add(ModelingElementTypes.Script_3015);
+			types.add(ModelingElementTypes.ExtenExecContent_3049);
+			return types;
+		}
+		if (editPart instanceof OnExitOnExitCompartment2EditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.If_3017);
+			types.add(ModelingElementTypes.Assign_3018);
+			types.add(ModelingElementTypes.Raise_3019);
+			types.add(ModelingElementTypes.Log_3020);
+			types.add(ModelingElementTypes.Validate_3021);
+			types.add(ModelingElementTypes.Cancel_3022);
+			types.add(ModelingElementTypes.Param_3023);
+			types.add(ModelingElementTypes.Send_3024);
+			types.add(ModelingElementTypes.Script_3025);
+			types.add(ModelingElementTypes.ExtenExecContent_3050);
+			return types;
+		}
+		if (editPart instanceof StateStateCompartment2EditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.OnEntry_3001);
+			types.add(ModelingElementTypes.OnExit_3016);
+			types.add(ModelingElementTypes.Invoke_3026);
+			types.add(ModelingElementTypes.InitialState_3030);
+			types.add(ModelingElementTypes.HistoryState_3031);
+			types.add(ModelingElementTypes.Parallel_3032);
+			types.add(ModelingElementTypes.Anchor_3039);
+			types.add(ModelingElementTypes.FinalState_3040);
+			types.add(ModelingElementTypes.State_3046);
+			return types;
+		}
+		if (editPart instanceof FinalStateFinalStateCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.Donedata_3041);
+			types.add(ModelingElementTypes.OnEntry_3044);
+			types.add(ModelingElementTypes.OnExit_3045);
+			return types;
+		}
+		if (editPart instanceof DonedataDonedataCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.Param_3042);
+			types.add(ModelingElementTypes.Content_3043);
+			return types;
+		}
+		if (editPart instanceof ContentContentCompartment4EditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.Content_3013);
+			return types;
+		}
+		if (editPart instanceof OnEntryOnEntryCompartment3EditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.If_3002);
+			types.add(ModelingElementTypes.Assign_3005);
+			types.add(ModelingElementTypes.Raise_3006);
+			types.add(ModelingElementTypes.Log_3007);
+			types.add(ModelingElementTypes.Validate_3008);
+			types.add(ModelingElementTypes.Cancel_3009);
+			types.add(ModelingElementTypes.Send_3010);
+			types.add(ModelingElementTypes.Param_3014);
+			types.add(ModelingElementTypes.Script_3015);
+			types.add(ModelingElementTypes.ExtenExecContent_3049);
+			return types;
+		}
+		if (editPart instanceof OnExitOnExitCompartment3EditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.If_3017);
+			types.add(ModelingElementTypes.Assign_3018);
+			types.add(ModelingElementTypes.Raise_3019);
+			types.add(ModelingElementTypes.Log_3020);
+			types.add(ModelingElementTypes.Validate_3021);
+			types.add(ModelingElementTypes.Cancel_3022);
+			types.add(ModelingElementTypes.Param_3023);
+			types.add(ModelingElementTypes.Send_3024);
+			types.add(ModelingElementTypes.Script_3025);
+			types.add(ModelingElementTypes.ExtenExecContent_3050);
+			return types;
+		}
+		if (editPart instanceof StateStateCompartment3EditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.OnEntry_3001);
+			types.add(ModelingElementTypes.OnExit_3016);
+			types.add(ModelingElementTypes.Invoke_3026);
+			types.add(ModelingElementTypes.InitialState_3030);
+			types.add(ModelingElementTypes.HistoryState_3031);
+			types.add(ModelingElementTypes.Parallel_3032);
+			types.add(ModelingElementTypes.Anchor_3039);
+			types.add(ModelingElementTypes.FinalState_3040);
+			types.add(ModelingElementTypes.State_3046);
+			return types;
+		}
+		if (editPart instanceof ParallelParallelCompartment3EditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.HistoryState_3033);
+			types.add(ModelingElementTypes.Anchor_3034);
+			types.add(ModelingElementTypes.Parallel_3035);
+			types.add(ModelingElementTypes.OnEntry_3036);
+			types.add(ModelingElementTypes.OnExit_3037);
+			types.add(ModelingElementTypes.State_3038);
+			return types;
+		}
+		if (editPart instanceof DataModelDataModelCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.Data_3047);
+			return types;
+		}
+		if (editPart instanceof DataDataCompartmentEditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.Content_3048);
+			return types;
+		}
+		if (editPart instanceof ContentContentCompartment5EditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.Content_3013);
+			return types;
+		}
+		if (editPart instanceof FinalStateFinalStateCompartment2EditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.Donedata_3041);
+			types.add(ModelingElementTypes.OnEntry_3044);
+			types.add(ModelingElementTypes.OnExit_3045);
+			return types;
+		}
+		if (editPart instanceof ServiceTemplateEditPart) {
+			List types = new ArrayList();
+			types.add(ModelingElementTypes.State_2001);
+			types.add(ModelingElementTypes.Script_2003);
+			types.add(ModelingElementTypes.Parallel_2004);
+			types.add(ModelingElementTypes.DataModel_2005);
+			types.add(ModelingElementTypes.FinalState_2006);
+			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(
+				ModelingDiagramEditorPlugin.getInstance()
+						.getItemProvidersAdapterFactory());
+		ElementListSelectionDialog dialog = new ElementListSelectionDialog(
+				shell, labelProvider);
+		dialog.setMessage(Messages.ModelingModelingAssistantProviderMessage);
+		dialog.setTitle(Messages.ModelingModelingAssistantProviderTitle);
+		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.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingModelingAssistantProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingParserProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingParserProvider.java?rev=953075&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingParserProvider.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingParserProvider.java Wed Jun  9 16:29:10 2010
@@ -0,0 +1,1116 @@
+/*
+ * 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.modeling.diagram.providers;
+
+import org.apache.commons.scxml.modeling.ModelingPackage;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.AnchorType2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.AnchorTypeEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.AssignDataid2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.AssignDataidEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.CancelSendid2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.CancelSendidEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.DataIdEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.DataModelSchemaEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ElseIfCondEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.FinalStateId2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.FinalStateIdEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.HistoryStateId2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.HistoryStateIdEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.IfCond2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.IfCondEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.InvokeTypeEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.LogExpr2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.LogExprEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ParallelId2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ParallelId3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ParallelIdEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ParamName2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ParamName3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ParamName4EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ParamName5EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ParamNameEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.RaiseEvent2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.RaiseEventEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.SendEvent2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.SendEventEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.StateId2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.StateId3EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.StateIdEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.TransitionCondEditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ValidateSchema2EditPart;
+import org.apache.commons.scxml.modeling.diagram.edit.parts.ValidateSchemaEditPart;
+import org.apache.commons.scxml.modeling.diagram.parsers.MessageFormatParser;
+import org.apache.commons.scxml.modeling.diagram.part.ModelingVisualIDRegistry;
+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 ModelingParserProvider extends AbstractProvider implements
+		IParserProvider {
+
+	/**
+	 * @generated
+	 */
+	private IParser stateId_5045Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getStateId_5045Parser() {
+		if (stateId_5045Parser == null) {
+			stateId_5045Parser = createStateId_5045Parser();
+		}
+		return stateId_5045Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createStateId_5045Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getState_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser parallelId_5048Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getParallelId_5048Parser() {
+		if (parallelId_5048Parser == null) {
+			parallelId_5048Parser = createParallelId_5048Parser();
+		}
+		return parallelId_5048Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createParallelId_5048Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getParallel_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser dataModelSchema_5050Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getDataModelSchema_5050Parser() {
+		if (dataModelSchema_5050Parser == null) {
+			dataModelSchema_5050Parser = createDataModelSchema_5050Parser();
+		}
+		return dataModelSchema_5050Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createDataModelSchema_5050Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getDataModel_Schema(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser finalStateId_5051Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getFinalStateId_5051Parser() {
+		if (finalStateId_5051Parser == null) {
+			finalStateId_5051Parser = createFinalStateId_5051Parser();
+		}
+		return finalStateId_5051Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createFinalStateId_5051Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getFinalState_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser ifCond_5003Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getIfCond_5003Parser() {
+		if (ifCond_5003Parser == null) {
+			ifCond_5003Parser = createIfCond_5003Parser();
+		}
+		return ifCond_5003Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createIfCond_5003Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getIf_Cond(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser elseIfCond_5001Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getElseIfCond_5001Parser() {
+		if (elseIfCond_5001Parser == null) {
+			elseIfCond_5001Parser = createElseIfCond_5001Parser();
+		}
+		return elseIfCond_5001Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createElseIfCond_5001Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getElseIf_Cond(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser assignDataid_5004Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getAssignDataid_5004Parser() {
+		if (assignDataid_5004Parser == null) {
+			assignDataid_5004Parser = createAssignDataid_5004Parser();
+		}
+		return assignDataid_5004Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createAssignDataid_5004Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getAssign_Dataid(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser raiseEvent_5006Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getRaiseEvent_5006Parser() {
+		if (raiseEvent_5006Parser == null) {
+			raiseEvent_5006Parser = createRaiseEvent_5006Parser();
+		}
+		return raiseEvent_5006Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createRaiseEvent_5006Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getRaise_Event(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser logExpr_5007Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getLogExpr_5007Parser() {
+		if (logExpr_5007Parser == null) {
+			logExpr_5007Parser = createLogExpr_5007Parser();
+		}
+		return logExpr_5007Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createLogExpr_5007Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getLog_Expr(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser validateSchema_5008Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getValidateSchema_5008Parser() {
+		if (validateSchema_5008Parser == null) {
+			validateSchema_5008Parser = createValidateSchema_5008Parser();
+		}
+		return validateSchema_5008Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createValidateSchema_5008Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getValidate_Schema(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser cancelSendid_5009Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getCancelSendid_5009Parser() {
+		if (cancelSendid_5009Parser == null) {
+			cancelSendid_5009Parser = createCancelSendid_5009Parser();
+		}
+		return cancelSendid_5009Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createCancelSendid_5009Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getCancel_Sendid(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser sendEvent_5011Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getSendEvent_5011Parser() {
+		if (sendEvent_5011Parser == null) {
+			sendEvent_5011Parser = createSendEvent_5011Parser();
+		}
+		return sendEvent_5011Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createSendEvent_5011Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getSend_Event(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser paramName_5010Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getParamName_5010Parser() {
+		if (paramName_5010Parser == null) {
+			paramName_5010Parser = createParamName_5010Parser();
+		}
+		return paramName_5010Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createParamName_5010Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getParam_Name(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser paramName_5012Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getParamName_5012Parser() {
+		if (paramName_5012Parser == null) {
+			paramName_5012Parser = createParamName_5012Parser();
+		}
+		return paramName_5012Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createParamName_5012Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getParam_Name(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser ifCond_5015Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getIfCond_5015Parser() {
+		if (ifCond_5015Parser == null) {
+			ifCond_5015Parser = createIfCond_5015Parser();
+		}
+		return ifCond_5015Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createIfCond_5015Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getIf_Cond(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser assignDataid_5016Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getAssignDataid_5016Parser() {
+		if (assignDataid_5016Parser == null) {
+			assignDataid_5016Parser = createAssignDataid_5016Parser();
+		}
+		return assignDataid_5016Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createAssignDataid_5016Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getAssign_Dataid(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser raiseEvent_5018Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getRaiseEvent_5018Parser() {
+		if (raiseEvent_5018Parser == null) {
+			raiseEvent_5018Parser = createRaiseEvent_5018Parser();
+		}
+		return raiseEvent_5018Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createRaiseEvent_5018Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getRaise_Event(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser logExpr_5019Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getLogExpr_5019Parser() {
+		if (logExpr_5019Parser == null) {
+			logExpr_5019Parser = createLogExpr_5019Parser();
+		}
+		return logExpr_5019Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createLogExpr_5019Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getLog_Expr(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser validateSchema_5020Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getValidateSchema_5020Parser() {
+		if (validateSchema_5020Parser == null) {
+			validateSchema_5020Parser = createValidateSchema_5020Parser();
+		}
+		return validateSchema_5020Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createValidateSchema_5020Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getValidate_Schema(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser cancelSendid_5021Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getCancelSendid_5021Parser() {
+		if (cancelSendid_5021Parser == null) {
+			cancelSendid_5021Parser = createCancelSendid_5021Parser();
+		}
+		return cancelSendid_5021Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createCancelSendid_5021Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getCancel_Sendid(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser paramName_5022Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getParamName_5022Parser() {
+		if (paramName_5022Parser == null) {
+			paramName_5022Parser = createParamName_5022Parser();
+		}
+		return paramName_5022Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createParamName_5022Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getParam_Name(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser sendEvent_5023Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getSendEvent_5023Parser() {
+		if (sendEvent_5023Parser == null) {
+			sendEvent_5023Parser = createSendEvent_5023Parser();
+		}
+		return sendEvent_5023Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createSendEvent_5023Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getSend_Event(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser invokeType_5028Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getInvokeType_5028Parser() {
+		if (invokeType_5028Parser == null) {
+			invokeType_5028Parser = createInvokeType_5028Parser();
+		}
+		return invokeType_5028Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createInvokeType_5028Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getInvoke_Type(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser paramName_5027Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getParamName_5027Parser() {
+		if (paramName_5027Parser == null) {
+			paramName_5027Parser = createParamName_5027Parser();
+		}
+		return paramName_5027Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createParamName_5027Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getParam_Name(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser historyStateId_5030Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getHistoryStateId_5030Parser() {
+		if (historyStateId_5030Parser == null) {
+			historyStateId_5030Parser = createHistoryStateId_5030Parser();
+		}
+		return historyStateId_5030Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createHistoryStateId_5030Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getHistoryState_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser parallelId_5044Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getParallelId_5044Parser() {
+		if (parallelId_5044Parser == null) {
+			parallelId_5044Parser = createParallelId_5044Parser();
+		}
+		return parallelId_5044Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createParallelId_5044Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getParallel_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser historyStateId_5031Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getHistoryStateId_5031Parser() {
+		if (historyStateId_5031Parser == null) {
+			historyStateId_5031Parser = createHistoryStateId_5031Parser();
+		}
+		return historyStateId_5031Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createHistoryStateId_5031Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getHistoryState_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser anchorType_5032Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getAnchorType_5032Parser() {
+		if (anchorType_5032Parser == null) {
+			anchorType_5032Parser = createAnchorType_5032Parser();
+		}
+		return anchorType_5032Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createAnchorType_5032Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getAnchor_Type(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser parallelId_5043Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getParallelId_5043Parser() {
+		if (parallelId_5043Parser == null) {
+			parallelId_5043Parser = createParallelId_5043Parser();
+		}
+		return parallelId_5043Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createParallelId_5043Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getParallel_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser stateId_5042Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getStateId_5042Parser() {
+		if (stateId_5042Parser == null) {
+			stateId_5042Parser = createStateId_5042Parser();
+		}
+		return stateId_5042Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createStateId_5042Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getState_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser anchorType_5035Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getAnchorType_5035Parser() {
+		if (anchorType_5035Parser == null) {
+			anchorType_5035Parser = createAnchorType_5035Parser();
+		}
+		return anchorType_5035Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createAnchorType_5035Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getAnchor_Type(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser finalStateId_5040Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getFinalStateId_5040Parser() {
+		if (finalStateId_5040Parser == null) {
+			finalStateId_5040Parser = createFinalStateId_5040Parser();
+		}
+		return finalStateId_5040Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createFinalStateId_5040Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getFinalState_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser paramName_5036Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getParamName_5036Parser() {
+		if (paramName_5036Parser == null) {
+			paramName_5036Parser = createParamName_5036Parser();
+		}
+		return paramName_5036Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createParamName_5036Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getParam_Name(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser stateId_5041Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getStateId_5041Parser() {
+		if (stateId_5041Parser == null) {
+			stateId_5041Parser = createStateId_5041Parser();
+		}
+		return stateId_5041Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createStateId_5041Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getState_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser dataId_5049Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getDataId_5049Parser() {
+		if (dataId_5049Parser == null) {
+			dataId_5049Parser = createDataId_5049Parser();
+		}
+		return dataId_5049Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createDataId_5049Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getData_Id(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	private IParser transitionCond_6001Parser;
+
+	/**
+	 * @generated
+	 */
+	private IParser getTransitionCond_6001Parser() {
+		if (transitionCond_6001Parser == null) {
+			transitionCond_6001Parser = createTransitionCond_6001Parser();
+		}
+		return transitionCond_6001Parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser createTransitionCond_6001Parser() {
+		EAttribute[] features = new EAttribute[] { ModelingPackage.eINSTANCE
+				.getTransition_Cond(), };
+		MessageFormatParser parser = new MessageFormatParser(features);
+		return parser;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParser getParser(int visualID) {
+		switch (visualID) {
+		case StateIdEditPart.VISUAL_ID:
+			return getStateId_5045Parser();
+		case ParallelIdEditPart.VISUAL_ID:
+			return getParallelId_5048Parser();
+		case DataModelSchemaEditPart.VISUAL_ID:
+			return getDataModelSchema_5050Parser();
+		case FinalStateIdEditPart.VISUAL_ID:
+			return getFinalStateId_5051Parser();
+		case IfCondEditPart.VISUAL_ID:
+			return getIfCond_5003Parser();
+		case ElseIfCondEditPart.VISUAL_ID:
+			return getElseIfCond_5001Parser();
+		case AssignDataidEditPart.VISUAL_ID:
+			return getAssignDataid_5004Parser();
+		case RaiseEventEditPart.VISUAL_ID:
+			return getRaiseEvent_5006Parser();
+		case LogExprEditPart.VISUAL_ID:
+			return getLogExpr_5007Parser();
+		case ValidateSchemaEditPart.VISUAL_ID:
+			return getValidateSchema_5008Parser();
+		case CancelSendidEditPart.VISUAL_ID:
+			return getCancelSendid_5009Parser();
+		case SendEventEditPart.VISUAL_ID:
+			return getSendEvent_5011Parser();
+		case ParamNameEditPart.VISUAL_ID:
+			return getParamName_5010Parser();
+		case ParamName2EditPart.VISUAL_ID:
+			return getParamName_5012Parser();
+		case IfCond2EditPart.VISUAL_ID:
+			return getIfCond_5015Parser();
+		case AssignDataid2EditPart.VISUAL_ID:
+			return getAssignDataid_5016Parser();
+		case RaiseEvent2EditPart.VISUAL_ID:
+			return getRaiseEvent_5018Parser();
+		case LogExpr2EditPart.VISUAL_ID:
+			return getLogExpr_5019Parser();
+		case ValidateSchema2EditPart.VISUAL_ID:
+			return getValidateSchema_5020Parser();
+		case CancelSendid2EditPart.VISUAL_ID:
+			return getCancelSendid_5021Parser();
+		case ParamName3EditPart.VISUAL_ID:
+			return getParamName_5022Parser();
+		case SendEvent2EditPart.VISUAL_ID:
+			return getSendEvent_5023Parser();
+		case InvokeTypeEditPart.VISUAL_ID:
+			return getInvokeType_5028Parser();
+		case ParamName4EditPart.VISUAL_ID:
+			return getParamName_5027Parser();
+		case HistoryStateIdEditPart.VISUAL_ID:
+			return getHistoryStateId_5030Parser();
+		case ParallelId2EditPart.VISUAL_ID:
+			return getParallelId_5044Parser();
+		case HistoryStateId2EditPart.VISUAL_ID:
+			return getHistoryStateId_5031Parser();
+		case AnchorTypeEditPart.VISUAL_ID:
+			return getAnchorType_5032Parser();
+		case ParallelId3EditPart.VISUAL_ID:
+			return getParallelId_5043Parser();
+		case StateId2EditPart.VISUAL_ID:
+			return getStateId_5042Parser();
+		case AnchorType2EditPart.VISUAL_ID:
+			return getAnchorType_5035Parser();
+		case FinalStateId2EditPart.VISUAL_ID:
+			return getFinalStateId_5040Parser();
+		case ParamName5EditPart.VISUAL_ID:
+			return getParamName_5036Parser();
+		case StateId3EditPart.VISUAL_ID:
+			return getStateId_5041Parser();
+		case DataIdEditPart.VISUAL_ID:
+			return getDataId_5049Parser();
+		case TransitionCondEditPart.VISUAL_ID:
+			return getTransitionCond_6001Parser();
+		}
+		return null;
+	}
+
+	/**
+	 * @generated
+	 */
+	public IParser getParser(IAdaptable hint) {
+		String vid = (String) hint.getAdapter(String.class);
+		if (vid != null) {
+			return getParser(ModelingVisualIDRegistry.getVisualID(vid));
+		}
+		View view = (View) hint.getAdapter(View.class);
+		if (view != null) {
+			return getParser(ModelingVisualIDRegistry.getVisualID(view));
+		}
+		return null;
+	}
+
+	/**
+	 * @generated
+	 */
+	public boolean provides(IOperation operation) {
+		if (operation instanceof GetParserOperation) {
+			IAdaptable hint = ((GetParserOperation) operation).getHint();
+			if (ModelingElementTypes.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.modeling.diagram/src/org/apache/commons/scxml/modeling/diagram/providers/ModelingParserProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message