commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gu...@apache.org
Subject svn commit: r945185 [35/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/part/ScxmlUriEditorInputTester.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/part/ScxmlUriEditorInputTester.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/part/ScxmlUriEditorInputTester.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/part/ScxmlUriEditorInputTester.java Mon May 17 14:38:45 2010
@@ -0,0 +1,39 @@
+/*
+ * 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.part;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.emf.common.ui.URIEditorInput;
+
+/**
+ * @generated
+ */
+public class ScxmlUriEditorInputTester extends PropertyTester {
+
+	/**
+	 * @generated
+	 */
+	public boolean test(Object receiver, String method, Object[] args,
+			Object expectedValue) {
+		if (false == receiver instanceof URIEditorInput) {
+			return false;
+		}
+		URIEditorInput editorInput = (URIEditorInput) receiver;
+		return "scxml_diagram".equals(editorInput.getURI().fileExtension()); //$NON-NLS-1$
+	}
+
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/part/ScxmlUriEditorInputTester.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/part/ScxmlVisualIDRegistry.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/part/ScxmlVisualIDRegistry.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/part/ScxmlVisualIDRegistry.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/part/ScxmlVisualIDRegistry.java Mon May 17 14:38:45 2010
@@ -0,0 +1,1564 @@
+/*
+ * 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.part;
+
+import org.apache.commons.scxml.ScxmlPackage;
+import org.apache.commons.scxml.ServiceTemplate;
+import org.apache.commons.scxml.diagram.edit.parts.*;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * This registry is used to determine which type of visual object should be
+ * created for the corresponding Diagram, Node, ChildNode or Link represented
+ * by a domain model object.
+ * 
+ * @generated
+ */
+public class ScxmlVisualIDRegistry {
+
+	/**
+	 * @generated
+	 */
+	private static final String DEBUG_KEY = "org.apache.commons.scxml.diagram/debug/visualID"; //$NON-NLS-1$
+
+	/**
+	 * @generated
+	 */
+	public static int getVisualID(View view) {
+		if (view instanceof Diagram) {
+			if (ServiceTemplateEditPart.MODEL_ID.equals(view.getType())) {
+				return ServiceTemplateEditPart.VISUAL_ID;
+			} else {
+				return -1;
+			}
+		}
+		return org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry
+				.getVisualID(view.getType());
+	}
+
+	/**
+	 * @generated
+	 */
+	public static String getModelID(View view) {
+		View diagram = view.getDiagram();
+		while (view != diagram) {
+			EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+			if (annotation != null) {
+				return (String) annotation.getDetails().get("modelID"); //$NON-NLS-1$
+			}
+			view = (View) view.eContainer();
+		}
+		return diagram != null ? diagram.getType() : null;
+	}
+
+	/**
+	 * @generated
+	 */
+	public static int getVisualID(String type) {
+		try {
+			return Integer.parseInt(type);
+		} catch (NumberFormatException e) {
+			if (Boolean.TRUE.toString().equalsIgnoreCase(
+					Platform.getDebugOption(DEBUG_KEY))) {
+				ScxmlDiagramEditorPlugin.getInstance().logError(
+						"Unable to parse view type as a visualID number: "
+								+ type);
+			}
+		}
+		return -1;
+	}
+
+	/**
+	 * @generated
+	 */
+	public static String getType(int visualID) {
+		return String.valueOf(visualID);
+	}
+
+	/**
+	 * @generated
+	 */
+	public static int getDiagramVisualID(EObject domainElement) {
+		if (domainElement == null) {
+			return -1;
+		}
+		if (ScxmlPackage.eINSTANCE.getServiceTemplate().isSuperTypeOf(
+				domainElement.eClass())
+				&& isDiagram((ServiceTemplate) domainElement)) {
+			return ServiceTemplateEditPart.VISUAL_ID;
+		}
+		return -1;
+	}
+
+	/**
+	 * @generated
+	 */
+	public static int getNodeVisualID(View containerView, EObject domainElement) {
+		if (domainElement == null) {
+			return -1;
+		}
+		String containerModelID = org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry
+				.getModelID(containerView);
+		if (!ServiceTemplateEditPart.MODEL_ID.equals(containerModelID)) {
+			return -1;
+		}
+		int containerVisualID;
+		if (ServiceTemplateEditPart.MODEL_ID.equals(containerModelID)) {
+			containerVisualID = org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry
+					.getVisualID(containerView);
+		} else {
+			if (containerView instanceof Diagram) {
+				containerVisualID = ServiceTemplateEditPart.VISUAL_ID;
+			} else {
+				return -1;
+			}
+		}
+		switch (containerVisualID) {
+		case StateStateCompartmentEditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getOnEntry().isSuperTypeOf(
+					domainElement.eClass())) {
+				return OnEntryEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getOnExit().isSuperTypeOf(
+					domainElement.eClass())) {
+				return OnExitEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getInvoke().isSuperTypeOf(
+					domainElement.eClass())) {
+				return InvokeEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getInitialState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return InitialState2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getHistoryState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return HistoryStateEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getParallel().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Parallel2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getAnchor().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Anchor2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getFinalState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return FinalState2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return State3EditPart.VISUAL_ID;
+			}
+			break;
+		case OnEntryOnEntryCompartmentEditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getIf().isSuperTypeOf(
+					domainElement.eClass())) {
+				return IfEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getAssign().isSuperTypeOf(
+					domainElement.eClass())) {
+				return AssignEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getRaise().isSuperTypeOf(
+					domainElement.eClass())) {
+				return RaiseEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getLog().isSuperTypeOf(
+					domainElement.eClass())) {
+				return LogEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getValidate().isSuperTypeOf(
+					domainElement.eClass())) {
+				return ValidateEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getCancel().isSuperTypeOf(
+					domainElement.eClass())) {
+				return CancelEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getSend().isSuperTypeOf(
+					domainElement.eClass())) {
+				return SendEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getParam().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Param2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getScript().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Script2EditPart.VISUAL_ID;
+			}
+			break;
+		case IfIfCompartmentEditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getElseIf().isSuperTypeOf(
+					domainElement.eClass())) {
+				return ElseIfEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getElse().isSuperTypeOf(
+					domainElement.eClass())) {
+				return ElseEditPart.VISUAL_ID;
+			}
+			break;
+		case SendSendCompartmentEditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getParam().isSuperTypeOf(
+					domainElement.eClass())) {
+				return ParamEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getContent().isSuperTypeOf(
+					domainElement.eClass())) {
+				return ContentEditPart.VISUAL_ID;
+			}
+			break;
+		case ContentContentCompartmentEditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getContent().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Content2EditPart.VISUAL_ID;
+			}
+			break;
+		case ContentContentCompartment2EditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getContent().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Content2EditPart.VISUAL_ID;
+			}
+			break;
+		case OnExitOnExitCompartmentEditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getIf().isSuperTypeOf(
+					domainElement.eClass())) {
+				return If2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getAssign().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Assign2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getRaise().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Raise2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getLog().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Log2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getValidate().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Validate2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getCancel().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Cancel2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getParam().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Param3EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getSend().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Send2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getScript().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Script3EditPart.VISUAL_ID;
+			}
+			break;
+		case IfIfCompartment2EditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getElseIf().isSuperTypeOf(
+					domainElement.eClass())) {
+				return ElseIfEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getElse().isSuperTypeOf(
+					domainElement.eClass())) {
+				return ElseEditPart.VISUAL_ID;
+			}
+			break;
+		case SendSendCompartment2EditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getParam().isSuperTypeOf(
+					domainElement.eClass())) {
+				return ParamEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getContent().isSuperTypeOf(
+					domainElement.eClass())) {
+				return ContentEditPart.VISUAL_ID;
+			}
+			break;
+		case InvokeInvokeCompartmentEditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getFinalize().isSuperTypeOf(
+					domainElement.eClass())) {
+				return FinalizeEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getParam().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Param4EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getContent().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Content3EditPart.VISUAL_ID;
+			}
+			break;
+		case ContentContentCompartment3EditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getContent().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Content2EditPart.VISUAL_ID;
+			}
+			break;
+		case ParallelParallelCompartmentEditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getHistoryState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return HistoryState2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getAnchor().isSuperTypeOf(
+					domainElement.eClass())) {
+				return AnchorEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getParallel().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Parallel3EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getOnEntry().isSuperTypeOf(
+					domainElement.eClass())) {
+				return OnEntry2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getOnExit().isSuperTypeOf(
+					domainElement.eClass())) {
+				return OnExit2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return State2EditPart.VISUAL_ID;
+			}
+			break;
+		case ParallelParallelCompartment2EditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getHistoryState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return HistoryState2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getAnchor().isSuperTypeOf(
+					domainElement.eClass())) {
+				return AnchorEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getParallel().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Parallel3EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getOnEntry().isSuperTypeOf(
+					domainElement.eClass())) {
+				return OnEntry2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getOnExit().isSuperTypeOf(
+					domainElement.eClass())) {
+				return OnExit2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return State2EditPart.VISUAL_ID;
+			}
+			break;
+		case OnEntryOnEntryCompartment2EditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getIf().isSuperTypeOf(
+					domainElement.eClass())) {
+				return IfEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getAssign().isSuperTypeOf(
+					domainElement.eClass())) {
+				return AssignEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getRaise().isSuperTypeOf(
+					domainElement.eClass())) {
+				return RaiseEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getLog().isSuperTypeOf(
+					domainElement.eClass())) {
+				return LogEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getValidate().isSuperTypeOf(
+					domainElement.eClass())) {
+				return ValidateEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getCancel().isSuperTypeOf(
+					domainElement.eClass())) {
+				return CancelEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getSend().isSuperTypeOf(
+					domainElement.eClass())) {
+				return SendEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getParam().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Param2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getScript().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Script2EditPart.VISUAL_ID;
+			}
+			break;
+		case OnExitOnExitCompartment2EditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getIf().isSuperTypeOf(
+					domainElement.eClass())) {
+				return If2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getAssign().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Assign2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getRaise().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Raise2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getLog().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Log2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getValidate().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Validate2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getCancel().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Cancel2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getParam().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Param3EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getSend().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Send2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getScript().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Script3EditPart.VISUAL_ID;
+			}
+			break;
+		case StateStateCompartment2EditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getOnEntry().isSuperTypeOf(
+					domainElement.eClass())) {
+				return OnEntryEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getOnExit().isSuperTypeOf(
+					domainElement.eClass())) {
+				return OnExitEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getInvoke().isSuperTypeOf(
+					domainElement.eClass())) {
+				return InvokeEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getInitialState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return InitialState2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getHistoryState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return HistoryStateEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getParallel().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Parallel2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getAnchor().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Anchor2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getFinalState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return FinalState2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return State3EditPart.VISUAL_ID;
+			}
+			break;
+		case FinalStateFinalStateCompartmentEditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getDonedata().isSuperTypeOf(
+					domainElement.eClass())) {
+				return DonedataEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getOnEntry().isSuperTypeOf(
+					domainElement.eClass())) {
+				return OnEntry3EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getOnExit().isSuperTypeOf(
+					domainElement.eClass())) {
+				return OnExit3EditPart.VISUAL_ID;
+			}
+			break;
+		case DonedataDonedataCompartmentEditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getParam().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Param5EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getContent().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Content4EditPart.VISUAL_ID;
+			}
+			break;
+		case ContentContentCompartment4EditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getContent().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Content2EditPart.VISUAL_ID;
+			}
+			break;
+		case OnEntryOnEntryCompartment3EditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getIf().isSuperTypeOf(
+					domainElement.eClass())) {
+				return IfEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getAssign().isSuperTypeOf(
+					domainElement.eClass())) {
+				return AssignEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getRaise().isSuperTypeOf(
+					domainElement.eClass())) {
+				return RaiseEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getLog().isSuperTypeOf(
+					domainElement.eClass())) {
+				return LogEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getValidate().isSuperTypeOf(
+					domainElement.eClass())) {
+				return ValidateEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getCancel().isSuperTypeOf(
+					domainElement.eClass())) {
+				return CancelEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getSend().isSuperTypeOf(
+					domainElement.eClass())) {
+				return SendEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getParam().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Param2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getScript().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Script2EditPart.VISUAL_ID;
+			}
+			break;
+		case OnExitOnExitCompartment3EditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getIf().isSuperTypeOf(
+					domainElement.eClass())) {
+				return If2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getAssign().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Assign2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getRaise().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Raise2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getLog().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Log2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getValidate().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Validate2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getCancel().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Cancel2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getParam().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Param3EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getSend().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Send2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getScript().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Script3EditPart.VISUAL_ID;
+			}
+			break;
+		case StateStateCompartment3EditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getOnEntry().isSuperTypeOf(
+					domainElement.eClass())) {
+				return OnEntryEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getOnExit().isSuperTypeOf(
+					domainElement.eClass())) {
+				return OnExitEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getInvoke().isSuperTypeOf(
+					domainElement.eClass())) {
+				return InvokeEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getInitialState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return InitialState2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getHistoryState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return HistoryStateEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getParallel().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Parallel2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getAnchor().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Anchor2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getFinalState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return FinalState2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return State3EditPart.VISUAL_ID;
+			}
+			break;
+		case ParallelParallelCompartment3EditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getHistoryState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return HistoryState2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getAnchor().isSuperTypeOf(
+					domainElement.eClass())) {
+				return AnchorEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getParallel().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Parallel3EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getOnEntry().isSuperTypeOf(
+					domainElement.eClass())) {
+				return OnEntry2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getOnExit().isSuperTypeOf(
+					domainElement.eClass())) {
+				return OnExit2EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return State2EditPart.VISUAL_ID;
+			}
+			break;
+		case DataModelDataModelCompartmentEditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getData().isSuperTypeOf(
+					domainElement.eClass())) {
+				return DataEditPart.VISUAL_ID;
+			}
+			break;
+		case DataDataCompartmentEditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getContent().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Content5EditPart.VISUAL_ID;
+			}
+			break;
+		case ContentContentCompartment5EditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getContent().isSuperTypeOf(
+					domainElement.eClass())) {
+				return Content2EditPart.VISUAL_ID;
+			}
+			break;
+		case FinalStateFinalStateCompartment2EditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getDonedata().isSuperTypeOf(
+					domainElement.eClass())) {
+				return DonedataEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getOnEntry().isSuperTypeOf(
+					domainElement.eClass())) {
+				return OnEntry3EditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getOnExit().isSuperTypeOf(
+					domainElement.eClass())) {
+				return OnExit3EditPart.VISUAL_ID;
+			}
+			break;
+		case ServiceTemplateEditPart.VISUAL_ID:
+			if (ScxmlPackage.eINSTANCE.getState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return StateEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getInitialState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return InitialStateEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getScript().isSuperTypeOf(
+					domainElement.eClass())) {
+				return ScriptEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getParallel().isSuperTypeOf(
+					domainElement.eClass())) {
+				return ParallelEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getDataModel().isSuperTypeOf(
+					domainElement.eClass())) {
+				return DataModelEditPart.VISUAL_ID;
+			}
+			if (ScxmlPackage.eINSTANCE.getFinalState().isSuperTypeOf(
+					domainElement.eClass())) {
+				return FinalStateEditPart.VISUAL_ID;
+			}
+			break;
+		}
+		return -1;
+	}
+
+	/**
+	 * @generated
+	 */
+	public static boolean canCreateNode(View containerView, int nodeVisualID) {
+		String containerModelID = org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry
+				.getModelID(containerView);
+		if (!ServiceTemplateEditPart.MODEL_ID.equals(containerModelID)) {
+			return false;
+		}
+		int containerVisualID;
+		if (ServiceTemplateEditPart.MODEL_ID.equals(containerModelID)) {
+			containerVisualID = org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry
+					.getVisualID(containerView);
+		} else {
+			if (containerView instanceof Diagram) {
+				containerVisualID = ServiceTemplateEditPart.VISUAL_ID;
+			} else {
+				return false;
+			}
+		}
+		switch (containerVisualID) {
+		case StateEditPart.VISUAL_ID:
+			if (StateIdEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (StateStateCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case InitialStateEditPart.VISUAL_ID:
+			if (WrappingLabelEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case ScriptEditPart.VISUAL_ID:
+			if (WrappingLabel2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case ParallelEditPart.VISUAL_ID:
+			if (ParallelIdEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (ParallelParallelCompartment3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case DataModelEditPart.VISUAL_ID:
+			if (DataModelSchemaEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (DataModelDataModelCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case FinalStateEditPart.VISUAL_ID:
+			if (FinalStateIdEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (FinalStateFinalStateCompartment2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case OnEntryEditPart.VISUAL_ID:
+			if (WrappingLabel3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnEntryOnEntryCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case IfEditPart.VISUAL_ID:
+			if (IfCondEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (IfIfCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case ElseIfEditPart.VISUAL_ID:
+			if (ElseIfCondEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case ElseEditPart.VISUAL_ID:
+			if (WrappingLabel4EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case AssignEditPart.VISUAL_ID:
+			if (AssignDataidEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (AssignExprEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case RaiseEditPart.VISUAL_ID:
+			if (RaiseEventEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case LogEditPart.VISUAL_ID:
+			if (LogExprEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case ValidateEditPart.VISUAL_ID:
+			if (ValidateSchemaEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case CancelEditPart.VISUAL_ID:
+			if (CancelSendidEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case SendEditPart.VISUAL_ID:
+			if (SendEventEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (SendSendCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case ParamEditPart.VISUAL_ID:
+			if (ParamNameEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case ContentEditPart.VISUAL_ID:
+			if (ContentContentCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Content2EditPart.VISUAL_ID:
+			if (ContentContentCompartment2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Param2EditPart.VISUAL_ID:
+			if (ParamName2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Script2EditPart.VISUAL_ID:
+			if (WrappingLabel5EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case OnExitEditPart.VISUAL_ID:
+			if (WrappingLabel6EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnExitOnExitCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case If2EditPart.VISUAL_ID:
+			if (IfCond2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (IfIfCompartment2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Assign2EditPart.VISUAL_ID:
+			if (AssignDataid2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (AssignExpr2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Raise2EditPart.VISUAL_ID:
+			if (RaiseEvent2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Log2EditPart.VISUAL_ID:
+			if (LogExpr2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Validate2EditPart.VISUAL_ID:
+			if (ValidateSchema2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Cancel2EditPart.VISUAL_ID:
+			if (CancelSendid2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Param3EditPart.VISUAL_ID:
+			if (ParamName3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Send2EditPart.VISUAL_ID:
+			if (SendEvent2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (SendSendCompartment2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Script3EditPart.VISUAL_ID:
+			if (WrappingLabel7EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case InvokeEditPart.VISUAL_ID:
+			if (InvokeTypeEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (InvokeInvokeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case FinalizeEditPart.VISUAL_ID:
+			if (WrappingLabel8EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Param4EditPart.VISUAL_ID:
+			if (ParamName4EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Content3EditPart.VISUAL_ID:
+			if (ContentContentCompartment3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case InitialState2EditPart.VISUAL_ID:
+			if (WrappingLabel9EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case HistoryStateEditPart.VISUAL_ID:
+			if (HistoryStateIdEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Parallel2EditPart.VISUAL_ID:
+			if (ParallelId2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (ParallelParallelCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case HistoryState2EditPart.VISUAL_ID:
+			if (HistoryStateId2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case AnchorEditPart.VISUAL_ID:
+			if (AnchorTypeEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Parallel3EditPart.VISUAL_ID:
+			if (ParallelId3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (ParallelParallelCompartment2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case OnEntry2EditPart.VISUAL_ID:
+			if (WrappingLabel10EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnEntryOnEntryCompartment2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case OnExit2EditPart.VISUAL_ID:
+			if (WrappingLabel11EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnExitOnExitCompartment2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case State2EditPart.VISUAL_ID:
+			if (StateId2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (StateStateCompartment2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Anchor2EditPart.VISUAL_ID:
+			if (AnchorType2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case FinalState2EditPart.VISUAL_ID:
+			if (FinalStateId2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (FinalStateFinalStateCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case DonedataEditPart.VISUAL_ID:
+			if (WrappingLabel12EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (DonedataDonedataCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Param5EditPart.VISUAL_ID:
+			if (ParamName5EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Content4EditPart.VISUAL_ID:
+			if (ContentContentCompartment4EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case OnEntry3EditPart.VISUAL_ID:
+			if (WrappingLabel13EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnEntryOnEntryCompartment3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case OnExit3EditPart.VISUAL_ID:
+			if (WrappingLabel14EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnExitOnExitCompartment3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case State3EditPart.VISUAL_ID:
+			if (StateId3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (StateStateCompartment3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case DataEditPart.VISUAL_ID:
+			if (DataIdEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (DataDataCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case Content5EditPart.VISUAL_ID:
+			if (ContentContentCompartment5EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case StateStateCompartmentEditPart.VISUAL_ID:
+			if (OnEntryEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnExitEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (InvokeEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (InitialState2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (HistoryStateEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Parallel2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Anchor2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (FinalState2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (State3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case OnEntryOnEntryCompartmentEditPart.VISUAL_ID:
+			if (IfEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (AssignEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (RaiseEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (LogEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (ValidateEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (CancelEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (SendEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Param2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Script2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case IfIfCompartmentEditPart.VISUAL_ID:
+			if (ElseIfEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (ElseEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case SendSendCompartmentEditPart.VISUAL_ID:
+			if (ParamEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (ContentEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case ContentContentCompartmentEditPart.VISUAL_ID:
+			if (Content2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case ContentContentCompartment2EditPart.VISUAL_ID:
+			if (Content2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case OnExitOnExitCompartmentEditPart.VISUAL_ID:
+			if (If2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Assign2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Raise2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Log2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Validate2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Cancel2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Param3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Send2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Script3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case IfIfCompartment2EditPart.VISUAL_ID:
+			if (ElseIfEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (ElseEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case SendSendCompartment2EditPart.VISUAL_ID:
+			if (ParamEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (ContentEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case InvokeInvokeCompartmentEditPart.VISUAL_ID:
+			if (FinalizeEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Param4EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Content3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case ContentContentCompartment3EditPart.VISUAL_ID:
+			if (Content2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case ParallelParallelCompartmentEditPart.VISUAL_ID:
+			if (HistoryState2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (AnchorEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Parallel3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnEntry2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnExit2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (State2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case ParallelParallelCompartment2EditPart.VISUAL_ID:
+			if (HistoryState2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (AnchorEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Parallel3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnEntry2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnExit2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (State2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case OnEntryOnEntryCompartment2EditPart.VISUAL_ID:
+			if (IfEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (AssignEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (RaiseEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (LogEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (ValidateEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (CancelEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (SendEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Param2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Script2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case OnExitOnExitCompartment2EditPart.VISUAL_ID:
+			if (If2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Assign2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Raise2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Log2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Validate2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Cancel2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Param3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Send2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Script3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case StateStateCompartment2EditPart.VISUAL_ID:
+			if (OnEntryEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnExitEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (InvokeEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (InitialState2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (HistoryStateEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Parallel2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Anchor2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (FinalState2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (State3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case FinalStateFinalStateCompartmentEditPart.VISUAL_ID:
+			if (DonedataEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnEntry3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnExit3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case DonedataDonedataCompartmentEditPart.VISUAL_ID:
+			if (Param5EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Content4EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case ContentContentCompartment4EditPart.VISUAL_ID:
+			if (Content2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case OnEntryOnEntryCompartment3EditPart.VISUAL_ID:
+			if (IfEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (AssignEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (RaiseEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (LogEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (ValidateEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (CancelEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (SendEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Param2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Script2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case OnExitOnExitCompartment3EditPart.VISUAL_ID:
+			if (If2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Assign2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Raise2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Log2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Validate2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Cancel2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Param3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Send2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Script3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case StateStateCompartment3EditPart.VISUAL_ID:
+			if (OnEntryEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnExitEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (InvokeEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (InitialState2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (HistoryStateEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Parallel2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Anchor2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (FinalState2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (State3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case ParallelParallelCompartment3EditPart.VISUAL_ID:
+			if (HistoryState2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (AnchorEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (Parallel3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnEntry2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnExit2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (State2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case DataModelDataModelCompartmentEditPart.VISUAL_ID:
+			if (DataEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case DataDataCompartmentEditPart.VISUAL_ID:
+			if (Content5EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case ContentContentCompartment5EditPart.VISUAL_ID:
+			if (Content2EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case FinalStateFinalStateCompartment2EditPart.VISUAL_ID:
+			if (DonedataEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnEntry3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (OnExit3EditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case ServiceTemplateEditPart.VISUAL_ID:
+			if (StateEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (InitialStateEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (ScriptEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (ParallelEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (DataModelEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			if (FinalStateEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		case TranslationEditPart.VISUAL_ID:
+			if (TranslationEventEditPart.VISUAL_ID == nodeVisualID) {
+				return true;
+			}
+			break;
+		}
+		return false;
+	}
+
+	/**
+	 * @generated
+	 */
+	public static int getLinkWithClassVisualID(EObject domainElement) {
+		if (domainElement == null) {
+			return -1;
+		}
+		if (ScxmlPackage.eINSTANCE.getTranslation().isSuperTypeOf(
+				domainElement.eClass())) {
+			return TranslationEditPart.VISUAL_ID;
+		}
+		return -1;
+	}
+
+	/**
+	 * User can change implementation of this method to handle some specific
+	 * situations not covered by default logic.
+	 * 
+	 * @generated
+	 */
+	private static boolean isDiagram(ServiceTemplate element) {
+		return true;
+	}
+
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/part/ScxmlVisualIDRegistry.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/preferences/DiagramAppearancePreferencePage.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/preferences/DiagramAppearancePreferencePage.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/preferences/DiagramAppearancePreferencePage.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/preferences/DiagramAppearancePreferencePage.java Mon May 17 14:38:45 2010
@@ -0,0 +1,34 @@
+/*
+ * 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.preferences;
+
+import org.apache.commons.scxml.diagram.part.ScxmlDiagramEditorPlugin;
+import org.eclipse.gmf.runtime.diagram.ui.preferences.AppearancePreferencePage;
+
+/**
+ * @generated
+ */
+public class DiagramAppearancePreferencePage extends AppearancePreferencePage {
+
+	/**
+	 * @generated
+	 */
+	public DiagramAppearancePreferencePage() {
+		setPreferenceStore(ScxmlDiagramEditorPlugin.getInstance()
+				.getPreferenceStore());
+	}
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/preferences/DiagramAppearancePreferencePage.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/preferences/DiagramConnectionsPreferencePage.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/preferences/DiagramConnectionsPreferencePage.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/preferences/DiagramConnectionsPreferencePage.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/preferences/DiagramConnectionsPreferencePage.java Mon May 17 14:38:45 2010
@@ -0,0 +1,34 @@
+/*
+ * 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.preferences;
+
+import org.apache.commons.scxml.diagram.part.ScxmlDiagramEditorPlugin;
+import org.eclipse.gmf.runtime.diagram.ui.preferences.ConnectionsPreferencePage;
+
+/**
+ * @generated
+ */
+public class DiagramConnectionsPreferencePage extends ConnectionsPreferencePage {
+
+	/**
+	 * @generated
+	 */
+	public DiagramConnectionsPreferencePage() {
+		setPreferenceStore(ScxmlDiagramEditorPlugin.getInstance()
+				.getPreferenceStore());
+	}
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/preferences/DiagramConnectionsPreferencePage.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/preferences/DiagramGeneralPreferencePage.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/preferences/DiagramGeneralPreferencePage.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/preferences/DiagramGeneralPreferencePage.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/preferences/DiagramGeneralPreferencePage.java Mon May 17 14:38:45 2010
@@ -0,0 +1,34 @@
+/*
+ * 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.preferences;
+
+import org.apache.commons.scxml.diagram.part.ScxmlDiagramEditorPlugin;
+import org.eclipse.gmf.runtime.diagram.ui.preferences.DiagramsPreferencePage;
+
+/**
+ * @generated
+ */
+public class DiagramGeneralPreferencePage extends DiagramsPreferencePage {
+
+	/**
+	 * @generated
+	 */
+	public DiagramGeneralPreferencePage() {
+		setPreferenceStore(ScxmlDiagramEditorPlugin.getInstance()
+				.getPreferenceStore());
+	}
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/preferences/DiagramGeneralPreferencePage.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/preferences/DiagramPreferenceInitializer.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/preferences/DiagramPreferenceInitializer.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/preferences/DiagramPreferenceInitializer.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/preferences/DiagramPreferenceInitializer.java Mon May 17 14:38:45 2010
@@ -0,0 +1,46 @@
+/*
+ * 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.preferences;
+
+import org.apache.commons.scxml.diagram.part.ScxmlDiagramEditorPlugin;
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+/**
+ * @generated
+ */
+public class DiagramPreferenceInitializer extends AbstractPreferenceInitializer {
+
+	/**
+	 * @generated
+	 */
+	public void initializeDefaultPreferences() {
+		IPreferenceStore store = getPreferenceStore();
+		DiagramPrintingPreferencePage.initDefaults(store);
+		DiagramGeneralPreferencePage.initDefaults(store);
+		DiagramAppearancePreferencePage.initDefaults(store);
+		DiagramConnectionsPreferencePage.initDefaults(store);
+		DiagramRulersAndGridPreferencePage.initDefaults(store);
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IPreferenceStore getPreferenceStore() {
+		return ScxmlDiagramEditorPlugin.getInstance().getPreferenceStore();
+	}
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/preferences/DiagramPreferenceInitializer.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/preferences/DiagramPrintingPreferencePage.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/preferences/DiagramPrintingPreferencePage.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/preferences/DiagramPrintingPreferencePage.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/preferences/DiagramPrintingPreferencePage.java Mon May 17 14:38:45 2010
@@ -0,0 +1,34 @@
+/*
+ * 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.preferences;
+
+import org.apache.commons.scxml.diagram.part.ScxmlDiagramEditorPlugin;
+import org.eclipse.gmf.runtime.diagram.ui.preferences.PrintingPreferencePage;
+
+/**
+ * @generated
+ */
+public class DiagramPrintingPreferencePage extends PrintingPreferencePage {
+
+	/**
+	 * @generated
+	 */
+	public DiagramPrintingPreferencePage() {
+		setPreferenceStore(ScxmlDiagramEditorPlugin.getInstance()
+				.getPreferenceStore());
+	}
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/preferences/DiagramPrintingPreferencePage.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/preferences/DiagramRulersAndGridPreferencePage.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/preferences/DiagramRulersAndGridPreferencePage.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/preferences/DiagramRulersAndGridPreferencePage.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/preferences/DiagramRulersAndGridPreferencePage.java Mon May 17 14:38:45 2010
@@ -0,0 +1,34 @@
+/*
+ * 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.preferences;
+
+import org.apache.commons.scxml.diagram.part.ScxmlDiagramEditorPlugin;
+import org.eclipse.gmf.runtime.diagram.ui.preferences.RulerGridPreferencePage;
+
+/**
+ * @generated
+ */
+public class DiagramRulersAndGridPreferencePage extends RulerGridPreferencePage {
+
+	/**
+	 * @generated
+	 */
+	public DiagramRulersAndGridPreferencePage() {
+		setPreferenceStore(ScxmlDiagramEditorPlugin.getInstance()
+				.getPreferenceStore());
+	}
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/preferences/DiagramRulersAndGridPreferencePage.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/ElementInitializers.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/ElementInitializers.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/ElementInitializers.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ElementInitializers.java Mon May 17 14:38:45 2010
@@ -0,0 +1,24 @@
+/*
+ * 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;
+
+/**
+ * @generated
+ */
+public class ElementInitializers {
+
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ElementInitializers.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/ScxmlEditPartProvider.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/ScxmlEditPartProvider.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/ScxmlEditPartProvider.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/providers/ScxmlEditPartProvider.java Mon May 17 14:38:45 2010
@@ -0,0 +1,158 @@
+/*
+ * 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.lang.ref.WeakReference;
+
+import org.apache.commons.scxml.diagram.edit.parts.ScxmlEditPartFactory;
+import org.apache.commons.scxml.diagram.edit.parts.ServiceTemplateEditPart;
+import org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartFactory;
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpart.AbstractEditPartProvider;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class ScxmlEditPartProvider extends AbstractEditPartProvider {
+
+	/**
+	 * @generated
+	 */
+	private EditPartFactory factory;
+
+	/**
+	 * @generated
+	 */
+	private boolean allowCaching;
+
+	/**
+	 * @generated
+	 */
+	private WeakReference cachedPart;
+
+	/**
+	 * @generated
+	 */
+	private WeakReference cachedView;
+
+	/**
+	 * @generated
+	 */
+	public ScxmlEditPartProvider() {
+		setFactory(new ScxmlEditPartFactory());
+		setAllowCaching(true);
+	}
+
+	/**
+	 * @generated
+	 */
+	public final EditPartFactory getFactory() {
+		return factory;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected void setFactory(EditPartFactory factory) {
+		this.factory = factory;
+	}
+
+	/**
+	 * @generated
+	 */
+	public final boolean isAllowCaching() {
+		return allowCaching;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected synchronized void setAllowCaching(boolean allowCaching) {
+		this.allowCaching = allowCaching;
+		if (!allowCaching) {
+			cachedPart = null;
+			cachedView = null;
+		}
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IGraphicalEditPart createEditPart(View view) {
+		EditPart part = factory.createEditPart(null, view);
+		if (part instanceof IGraphicalEditPart) {
+			return (IGraphicalEditPart) part;
+		}
+		return null;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IGraphicalEditPart getCachedPart(View view) {
+		if (cachedView != null && cachedView.get() == view) {
+			return (IGraphicalEditPart) cachedPart.get();
+		}
+		return null;
+	}
+
+	/**
+	 * @generated
+	 */
+	public synchronized IGraphicalEditPart createGraphicEditPart(View view) {
+		if (isAllowCaching()) {
+			IGraphicalEditPart part = getCachedPart(view);
+			cachedPart = null;
+			cachedView = null;
+			if (part != null) {
+				return part;
+			}
+		}
+		return createEditPart(view);
+	}
+
+	/**
+	 * @generated
+	 */
+	public synchronized boolean provides(IOperation operation) {
+		if (operation instanceof CreateGraphicEditPartOperation) {
+			View view = ((IEditPartOperation) operation).getView();
+			if (!ServiceTemplateEditPart.MODEL_ID.equals(ScxmlVisualIDRegistry
+					.getModelID(view))) {
+				return false;
+			}
+			if (isAllowCaching() && getCachedPart(view) != null) {
+				return true;
+			}
+			IGraphicalEditPart part = createEditPart(view);
+			if (part != null) {
+				if (isAllowCaching()) {
+					cachedPart = new WeakReference(part);
+					cachedView = new WeakReference(view);
+				}
+				return true;
+			}
+		}
+		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/ScxmlEditPartProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message