commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gu...@apache.org
Subject svn commit: r945185 [31/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/navigator/ScxmlNavigatorLabelProvider.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/navigator/ScxmlNavigatorLabelProvider.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/navigator/ScxmlNavigatorLabelProvider.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorLabelProvider.java Mon May 17 14:38:45 2010
@@ -0,0 +1,1567 @@
+/*
+ * 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.navigator;
+
+import org.apache.commons.scxml.ServiceTemplate;
+import org.apache.commons.scxml.diagram.edit.parts.*;
+import org.apache.commons.scxml.diagram.part.ScxmlDiagramEditorPlugin;
+import org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry;
+import org.apache.commons.scxml.diagram.providers.ScxmlElementTypes;
+import org.apache.commons.scxml.diagram.providers.ScxmlParserProvider;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.jface.viewers.ITreePathLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.ViewerLabel;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.navigator.ICommonContentExtensionSite;
+import org.eclipse.ui.navigator.ICommonLabelProvider;
+
+/**
+ * @generated
+ */
+public class ScxmlNavigatorLabelProvider extends LabelProvider implements
+		ICommonLabelProvider, ITreePathLabelProvider {
+
+	/**
+	 * @generated
+	 */
+	static {
+		ScxmlDiagramEditorPlugin
+				.getInstance()
+				.getImageRegistry()
+				.put(
+						"Navigator?UnknownElement", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
+		ScxmlDiagramEditorPlugin
+				.getInstance()
+				.getImageRegistry()
+				.put(
+						"Navigator?ImageNotFound", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
+	}
+
+	/**
+	 * @generated
+	 */
+	public void updateLabel(ViewerLabel label, TreePath elementPath) {
+		Object element = elementPath.getLastSegment();
+		if (element instanceof ScxmlNavigatorItem
+				&& !isOwnView(((ScxmlNavigatorItem) element).getView())) {
+			return;
+		}
+		label.setText(getText(element));
+		label.setImage(getImage(element));
+	}
+
+	/**
+	 * @generated
+	 */
+	public Image getImage(Object element) {
+		if (element instanceof ScxmlNavigatorGroup) {
+			ScxmlNavigatorGroup group = (ScxmlNavigatorGroup) element;
+			return ScxmlDiagramEditorPlugin.getInstance().getBundledImage(
+					group.getIcon());
+		}
+
+		if (element instanceof ScxmlNavigatorItem) {
+			ScxmlNavigatorItem navigatorItem = (ScxmlNavigatorItem) element;
+			if (!isOwnView(navigatorItem.getView())) {
+				return super.getImage(element);
+			}
+			return getImage(navigatorItem.getView());
+		}
+
+		return super.getImage(element);
+	}
+
+	/**
+	 * @generated
+	 */
+	public Image getImage(View view) {
+		switch (ScxmlVisualIDRegistry.getVisualID(view)) {
+		case ServiceTemplateEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Diagram?org.apache.commons.scxml?ServiceTemplate", ScxmlElementTypes.ServiceTemplate_79); //$NON-NLS-1$
+		case StateEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?TopLevelNode?org.apache.commons.scxml?State", ScxmlElementTypes.State_1001); //$NON-NLS-1$
+		case InitialStateEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?TopLevelNode?org.apache.commons.scxml?InitialState", ScxmlElementTypes.InitialState_1002); //$NON-NLS-1$
+		case ScriptEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?TopLevelNode?org.apache.commons.scxml?Script", ScxmlElementTypes.Script_1003); //$NON-NLS-1$
+		case ParallelEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?TopLevelNode?org.apache.commons.scxml?Parallel", ScxmlElementTypes.Parallel_1004); //$NON-NLS-1$
+		case DataModelEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?TopLevelNode?org.apache.commons.scxml?DataModel", ScxmlElementTypes.DataModel_1005); //$NON-NLS-1$
+		case FinalStateEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?TopLevelNode?org.apache.commons.scxml?FinalState", ScxmlElementTypes.FinalState_1006); //$NON-NLS-1$
+		case OnEntryEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?OnEntry", ScxmlElementTypes.OnEntry_2001); //$NON-NLS-1$
+		case IfEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?If", ScxmlElementTypes.If_2002); //$NON-NLS-1$
+		case ElseIfEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?ElseIf", ScxmlElementTypes.ElseIf_2003); //$NON-NLS-1$
+		case ElseEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Else", ScxmlElementTypes.Else_2004); //$NON-NLS-1$
+		case AssignEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Assign", ScxmlElementTypes.Assign_2005); //$NON-NLS-1$
+		case RaiseEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Raise", ScxmlElementTypes.Raise_2006); //$NON-NLS-1$
+		case LogEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Log", ScxmlElementTypes.Log_2007); //$NON-NLS-1$
+		case ValidateEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Validate", ScxmlElementTypes.Validate_2008); //$NON-NLS-1$
+		case CancelEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Cancel", ScxmlElementTypes.Cancel_2009); //$NON-NLS-1$
+		case SendEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Send", ScxmlElementTypes.Send_2010); //$NON-NLS-1$
+		case ParamEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Param", ScxmlElementTypes.Param_2011); //$NON-NLS-1$
+		case ContentEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Content", ScxmlElementTypes.Content_2012); //$NON-NLS-1$
+		case Content2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Content", ScxmlElementTypes.Content_2013); //$NON-NLS-1$
+		case Param2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Param", ScxmlElementTypes.Param_2014); //$NON-NLS-1$
+		case Script2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Script", ScxmlElementTypes.Script_2015); //$NON-NLS-1$
+		case OnExitEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?OnExit", ScxmlElementTypes.OnExit_2016); //$NON-NLS-1$
+		case If2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?If", ScxmlElementTypes.If_2017); //$NON-NLS-1$
+		case Assign2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Assign", ScxmlElementTypes.Assign_2018); //$NON-NLS-1$
+		case Raise2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Raise", ScxmlElementTypes.Raise_2019); //$NON-NLS-1$
+		case Log2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Log", ScxmlElementTypes.Log_2020); //$NON-NLS-1$
+		case Validate2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Validate", ScxmlElementTypes.Validate_2021); //$NON-NLS-1$
+		case Cancel2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Cancel", ScxmlElementTypes.Cancel_2022); //$NON-NLS-1$
+		case Param3EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Param", ScxmlElementTypes.Param_2023); //$NON-NLS-1$
+		case Send2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Send", ScxmlElementTypes.Send_2024); //$NON-NLS-1$
+		case Script3EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Script", ScxmlElementTypes.Script_2025); //$NON-NLS-1$
+		case InvokeEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Invoke", ScxmlElementTypes.Invoke_2026); //$NON-NLS-1$
+		case FinalizeEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Finalize", ScxmlElementTypes.Finalize_2027); //$NON-NLS-1$
+		case Param4EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Param", ScxmlElementTypes.Param_2028); //$NON-NLS-1$
+		case Content3EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Content", ScxmlElementTypes.Content_2029); //$NON-NLS-1$
+		case InitialState2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?InitialState", ScxmlElementTypes.InitialState_2030); //$NON-NLS-1$
+		case HistoryStateEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?HistoryState", ScxmlElementTypes.HistoryState_2031); //$NON-NLS-1$
+		case Parallel2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Parallel", ScxmlElementTypes.Parallel_2032); //$NON-NLS-1$
+		case HistoryState2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?HistoryState", ScxmlElementTypes.HistoryState_2033); //$NON-NLS-1$
+		case AnchorEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Anchor", ScxmlElementTypes.Anchor_2034); //$NON-NLS-1$
+		case Parallel3EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Parallel", ScxmlElementTypes.Parallel_2035); //$NON-NLS-1$
+		case OnEntry2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?OnEntry", ScxmlElementTypes.OnEntry_2036); //$NON-NLS-1$
+		case OnExit2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?OnExit", ScxmlElementTypes.OnExit_2037); //$NON-NLS-1$
+		case State2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?State", ScxmlElementTypes.State_2038); //$NON-NLS-1$
+		case Anchor2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Anchor", ScxmlElementTypes.Anchor_2039); //$NON-NLS-1$
+		case FinalState2EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?FinalState", ScxmlElementTypes.FinalState_2040); //$NON-NLS-1$
+		case DonedataEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Donedata", ScxmlElementTypes.Donedata_2041); //$NON-NLS-1$
+		case Param5EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Param", ScxmlElementTypes.Param_2042); //$NON-NLS-1$
+		case Content4EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Content", ScxmlElementTypes.Content_2043); //$NON-NLS-1$
+		case OnEntry3EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?OnEntry", ScxmlElementTypes.OnEntry_2044); //$NON-NLS-1$
+		case OnExit3EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?OnExit", ScxmlElementTypes.OnExit_2045); //$NON-NLS-1$
+		case State3EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?State", ScxmlElementTypes.State_2046); //$NON-NLS-1$
+		case DataEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Data", ScxmlElementTypes.Data_2047); //$NON-NLS-1$
+		case Content5EditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Node?org.apache.commons.scxml?Content", ScxmlElementTypes.Content_2048); //$NON-NLS-1$
+		case TranslationEditPart.VISUAL_ID:
+			return getImage(
+					"Navigator?Link?org.apache.commons.scxml?Translation", ScxmlElementTypes.Translation_3001); //$NON-NLS-1$
+		}
+		return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$
+	}
+
+	/**
+	 * @generated
+	 */
+	private Image getImage(String key, IElementType elementType) {
+		ImageRegistry imageRegistry = ScxmlDiagramEditorPlugin.getInstance()
+				.getImageRegistry();
+		Image image = imageRegistry.get(key);
+		if (image == null && elementType != null
+				&& ScxmlElementTypes.isKnownElementType(elementType)) {
+			image = ScxmlElementTypes.getImage(elementType);
+			imageRegistry.put(key, image);
+		}
+
+		if (image == null) {
+			image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
+			imageRegistry.put(key, image);
+		}
+		return image;
+	}
+
+	/**
+	 * @generated
+	 */
+	public String getText(Object element) {
+		if (element instanceof ScxmlNavigatorGroup) {
+			ScxmlNavigatorGroup group = (ScxmlNavigatorGroup) element;
+			return group.getGroupName();
+		}
+
+		if (element instanceof ScxmlNavigatorItem) {
+			ScxmlNavigatorItem navigatorItem = (ScxmlNavigatorItem) element;
+			if (!isOwnView(navigatorItem.getView())) {
+				return null;
+			}
+			return getText(navigatorItem.getView());
+		}
+
+		return super.getText(element);
+	}
+
+	/**
+	 * @generated
+	 */
+	public String getText(View view) {
+		if (view.getElement() != null && view.getElement().eIsProxy()) {
+			return getUnresolvedDomainElementProxyText(view);
+		}
+		switch (ScxmlVisualIDRegistry.getVisualID(view)) {
+		case ServiceTemplateEditPart.VISUAL_ID:
+			return getServiceTemplate_79Text(view);
+		case StateEditPart.VISUAL_ID:
+			return getState_1001Text(view);
+		case InitialStateEditPart.VISUAL_ID:
+			return getInitialState_1002Text(view);
+		case ScriptEditPart.VISUAL_ID:
+			return getScript_1003Text(view);
+		case ParallelEditPart.VISUAL_ID:
+			return getParallel_1004Text(view);
+		case DataModelEditPart.VISUAL_ID:
+			return getDataModel_1005Text(view);
+		case FinalStateEditPart.VISUAL_ID:
+			return getFinalState_1006Text(view);
+		case OnEntryEditPart.VISUAL_ID:
+			return getOnEntry_2001Text(view);
+		case IfEditPart.VISUAL_ID:
+			return getIf_2002Text(view);
+		case ElseIfEditPart.VISUAL_ID:
+			return getElseIf_2003Text(view);
+		case ElseEditPart.VISUAL_ID:
+			return getElse_2004Text(view);
+		case AssignEditPart.VISUAL_ID:
+			return getAssign_2005Text(view);
+		case RaiseEditPart.VISUAL_ID:
+			return getRaise_2006Text(view);
+		case LogEditPart.VISUAL_ID:
+			return getLog_2007Text(view);
+		case ValidateEditPart.VISUAL_ID:
+			return getValidate_2008Text(view);
+		case CancelEditPart.VISUAL_ID:
+			return getCancel_2009Text(view);
+		case SendEditPart.VISUAL_ID:
+			return getSend_2010Text(view);
+		case ParamEditPart.VISUAL_ID:
+			return getParam_2011Text(view);
+		case ContentEditPart.VISUAL_ID:
+			return getContent_2012Text(view);
+		case Content2EditPart.VISUAL_ID:
+			return getContent_2013Text(view);
+		case Param2EditPart.VISUAL_ID:
+			return getParam_2014Text(view);
+		case Script2EditPart.VISUAL_ID:
+			return getScript_2015Text(view);
+		case OnExitEditPart.VISUAL_ID:
+			return getOnExit_2016Text(view);
+		case If2EditPart.VISUAL_ID:
+			return getIf_2017Text(view);
+		case Assign2EditPart.VISUAL_ID:
+			return getAssign_2018Text(view);
+		case Raise2EditPart.VISUAL_ID:
+			return getRaise_2019Text(view);
+		case Log2EditPart.VISUAL_ID:
+			return getLog_2020Text(view);
+		case Validate2EditPart.VISUAL_ID:
+			return getValidate_2021Text(view);
+		case Cancel2EditPart.VISUAL_ID:
+			return getCancel_2022Text(view);
+		case Param3EditPart.VISUAL_ID:
+			return getParam_2023Text(view);
+		case Send2EditPart.VISUAL_ID:
+			return getSend_2024Text(view);
+		case Script3EditPart.VISUAL_ID:
+			return getScript_2025Text(view);
+		case InvokeEditPart.VISUAL_ID:
+			return getInvoke_2026Text(view);
+		case FinalizeEditPart.VISUAL_ID:
+			return getFinalize_2027Text(view);
+		case Param4EditPart.VISUAL_ID:
+			return getParam_2028Text(view);
+		case Content3EditPart.VISUAL_ID:
+			return getContent_2029Text(view);
+		case InitialState2EditPart.VISUAL_ID:
+			return getInitialState_2030Text(view);
+		case HistoryStateEditPart.VISUAL_ID:
+			return getHistoryState_2031Text(view);
+		case Parallel2EditPart.VISUAL_ID:
+			return getParallel_2032Text(view);
+		case HistoryState2EditPart.VISUAL_ID:
+			return getHistoryState_2033Text(view);
+		case AnchorEditPart.VISUAL_ID:
+			return getAnchor_2034Text(view);
+		case Parallel3EditPart.VISUAL_ID:
+			return getParallel_2035Text(view);
+		case OnEntry2EditPart.VISUAL_ID:
+			return getOnEntry_2036Text(view);
+		case OnExit2EditPart.VISUAL_ID:
+			return getOnExit_2037Text(view);
+		case State2EditPart.VISUAL_ID:
+			return getState_2038Text(view);
+		case Anchor2EditPart.VISUAL_ID:
+			return getAnchor_2039Text(view);
+		case FinalState2EditPart.VISUAL_ID:
+			return getFinalState_2040Text(view);
+		case DonedataEditPart.VISUAL_ID:
+			return getDonedata_2041Text(view);
+		case Param5EditPart.VISUAL_ID:
+			return getParam_2042Text(view);
+		case Content4EditPart.VISUAL_ID:
+			return getContent_2043Text(view);
+		case OnEntry3EditPart.VISUAL_ID:
+			return getOnEntry_2044Text(view);
+		case OnExit3EditPart.VISUAL_ID:
+			return getOnExit_2045Text(view);
+		case State3EditPart.VISUAL_ID:
+			return getState_2046Text(view);
+		case DataEditPart.VISUAL_ID:
+			return getData_2047Text(view);
+		case Content5EditPart.VISUAL_ID:
+			return getContent_2048Text(view);
+		case TranslationEditPart.VISUAL_ID:
+			return getTranslation_3001Text(view);
+		}
+		return getUnknownElementText(view);
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getServiceTemplate_79Text(View view) {
+		ServiceTemplate domainModelElement = (ServiceTemplate) view
+				.getElement();
+		if (domainModelElement != null) {
+			return domainModelElement.getName();
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"No domain element for view with visualID = " + 79); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getState_1001Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.State_1001, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(StateIdEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4045); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getInitialState_1002Text(View view) {
+
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.InitialState_1002,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(WrappingLabelEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getScript_1003Text(View view) {
+
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Script_1003,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(WrappingLabel2EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getParallel_1004Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Parallel_1004,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(ParallelIdEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4048); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getDataModel_1005Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.DataModel_1005,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry
+						.getType(DataModelSchemaEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4050); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getFinalState_1006Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.FinalState_1006,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(FinalStateIdEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4051); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getOnEntry_2001Text(View view) {
+
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.OnEntry_2001,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(WrappingLabel3EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getIf_2002Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.If_2002, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(IfCondEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4003); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getElseIf_2003Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.ElseIf_2003,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(ElseIfCondEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4001); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getElse_2004Text(View view) {
+
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Else_2004, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(WrappingLabel4EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getAssign_2005Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Assign_2005,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(AssignDataidEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4004); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getRaise_2006Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Raise_2006, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(RaiseEventEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4006); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getLog_2007Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Log_2007, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(LogExprEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4007); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getValidate_2008Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Validate_2008,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(ValidateSchemaEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4008); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getCancel_2009Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Cancel_2009,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(CancelSendidEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4009); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getSend_2010Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Send_2010, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(SendEventEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4011); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getParam_2011Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Param_2011, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(ParamNameEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4010); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getContent_2012Text(View view) {
+		return ""; //$NON-NLS-1$
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getContent_2013Text(View view) {
+		return ""; //$NON-NLS-1$
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getParam_2014Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Param_2014, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(ParamName2EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4012); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getScript_2015Text(View view) {
+
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Script_2015,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(WrappingLabel5EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getOnExit_2016Text(View view) {
+
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.OnExit_2016,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(WrappingLabel6EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getIf_2017Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.If_2017, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(IfCond2EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4015); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getAssign_2018Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Assign_2018,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(AssignDataid2EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4016); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getRaise_2019Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Raise_2019, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(RaiseEvent2EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4018); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getLog_2020Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Log_2020, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(LogExpr2EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4019); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getValidate_2021Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Validate_2021,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry
+						.getType(ValidateSchema2EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4020); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getCancel_2022Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Cancel_2022,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(CancelSendid2EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4021); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getParam_2023Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Param_2023, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(ParamName3EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4022); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getSend_2024Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Send_2024, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(SendEvent2EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4023); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getScript_2025Text(View view) {
+
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Script_2025,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(WrappingLabel7EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getInvoke_2026Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Invoke_2026,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(InvokeTypeEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4028); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getFinalize_2027Text(View view) {
+
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Finalize_2027,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(WrappingLabel8EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getParam_2028Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Param_2028, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(ParamName4EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4027); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getContent_2029Text(View view) {
+		return ""; //$NON-NLS-1$
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getInitialState_2030Text(View view) {
+
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.InitialState_2030,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(WrappingLabel9EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getHistoryState_2031Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.HistoryState_2031,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(HistoryStateIdEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4030); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getParallel_2032Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Parallel_2032,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(ParallelId2EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4044); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getHistoryState_2033Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.HistoryState_2033,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry
+						.getType(HistoryStateId2EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4031); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getAnchor_2034Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Anchor_2034,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(AnchorTypeEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4032); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getParallel_2035Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Parallel_2035,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(ParallelId3EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4043); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getOnEntry_2036Text(View view) {
+
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.OnEntry_2036,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry
+						.getType(WrappingLabel10EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getOnExit_2037Text(View view) {
+
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.OnExit_2037,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry
+						.getType(WrappingLabel11EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getState_2038Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.State_2038, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(StateId2EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4042); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getAnchor_2039Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Anchor_2039,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(AnchorType2EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4035); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getFinalState_2040Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.FinalState_2040,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry.getType(FinalStateId2EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4040); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getDonedata_2041Text(View view) {
+
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Donedata_2041,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry
+						.getType(WrappingLabel12EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getParam_2042Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Param_2042, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(ParamName5EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4036); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getContent_2043Text(View view) {
+		return ""; //$NON-NLS-1$
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getOnEntry_2044Text(View view) {
+
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.OnEntry_2044,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry
+						.getType(WrappingLabel13EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getOnExit_2045Text(View view) {
+
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.OnExit_2045,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry
+						.getType(WrappingLabel14EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getState_2046Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.State_2046, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(StateId3EditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4041); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getData_2047Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Data_2047, (view.getElement() != null ? view
+						.getElement() : view), ScxmlVisualIDRegistry
+						.getType(DataIdEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4049); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getContent_2048Text(View view) {
+		return ""; //$NON-NLS-1$
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getTranslation_3001Text(View view) {
+		IAdaptable hintAdapter = new ScxmlParserProvider.HintAdapter(
+				ScxmlElementTypes.Translation_3001,
+				(view.getElement() != null ? view.getElement() : view),
+				ScxmlVisualIDRegistry
+						.getType(TranslationEventEditPart.VISUAL_ID));
+		IParser parser = ParserService.getInstance().getParser(hintAdapter);
+
+		if (parser != null) {
+			return parser.getPrintString(hintAdapter, ParserOptions.NONE
+					.intValue());
+		} else {
+			ScxmlDiagramEditorPlugin.getInstance().logError(
+					"Parser was not found for label " + 4052); //$NON-NLS-1$
+			return ""; //$NON-NLS-1$
+		}
+
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getUnknownElementText(View view) {
+		return "<UnknownElement Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
+	}
+
+	/**
+	 * @generated
+	 */
+	private String getUnresolvedDomainElementProxyText(View view) {
+		return "<Unresolved domain element Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
+	}
+
+	/**
+	 * @generated
+	 */
+	public void init(ICommonContentExtensionSite aConfig) {
+	}
+
+	/**
+	 * @generated
+	 */
+	public void restoreState(IMemento aMemento) {
+	}
+
+	/**
+	 * @generated
+	 */
+	public void saveState(IMemento aMemento) {
+	}
+
+	/**
+	 * @generated
+	 */
+	public String getDescription(Object anElement) {
+		return null;
+	}
+
+	/**
+	 * @generated
+	 */
+	private boolean isOwnView(View view) {
+		return ServiceTemplateEditPart.MODEL_ID.equals(ScxmlVisualIDRegistry
+				.getModelID(view));
+	}
+
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorLabelProvider.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/navigator/ScxmlNavigatorLinkHelper.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/navigator/ScxmlNavigatorLinkHelper.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/navigator/ScxmlNavigatorLinkHelper.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorLinkHelper.java Mon May 17 14:38:45 2010
@@ -0,0 +1,144 @@
+/*
+ * 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.navigator;
+
+import java.util.Iterator;
+
+import org.apache.commons.scxml.diagram.part.ScxmlDiagramEditorPlugin;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.ui.URIEditorInput;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.navigator.ILinkHelper;
+import org.eclipse.ui.part.FileEditorInput;
+
+/**
+ * @generated
+ */
+public class ScxmlNavigatorLinkHelper implements ILinkHelper {
+
+	/**
+	 * @generated
+	 */
+	private static IEditorInput getEditorInput(Diagram diagram) {
+		Resource diagramResource = diagram.eResource();
+		for (Iterator it = diagramResource.getContents().iterator(); it
+				.hasNext();) {
+			EObject nextEObject = (EObject) it.next();
+			if (nextEObject == diagram) {
+				return new FileEditorInput(WorkspaceSynchronizer
+						.getFile(diagramResource));
+			}
+			if (nextEObject instanceof Diagram) {
+				break;
+			}
+		}
+		URI uri = EcoreUtil.getURI(diagram);
+		String editorName = uri.lastSegment()
+				+ "#" + diagram.eResource().getContents().indexOf(diagram); //$NON-NLS-1$
+		IEditorInput editorInput = new URIEditorInput(uri, editorName);
+		return editorInput;
+	}
+
+	/**
+	 * @generated
+	 */
+	public IStructuredSelection findSelection(IEditorInput anInput) {
+		IDiagramDocument document = ScxmlDiagramEditorPlugin.getInstance()
+				.getDocumentProvider().getDiagramDocument(anInput);
+		if (document == null) {
+			return StructuredSelection.EMPTY;
+		}
+		Diagram diagram = document.getDiagram();
+		IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
+		if (file != null) {
+			ScxmlNavigatorItem item = new ScxmlNavigatorItem(diagram, file,
+					false);
+			return new StructuredSelection(item);
+		}
+		return StructuredSelection.EMPTY;
+	}
+
+	/**
+	 * @generated
+	 */
+	public void activateEditor(IWorkbenchPage aPage,
+			IStructuredSelection aSelection) {
+		if (aSelection == null || aSelection.isEmpty()) {
+			return;
+		}
+		if (false == aSelection.getFirstElement() instanceof ScxmlAbstractNavigatorItem) {
+			return;
+		}
+
+		ScxmlAbstractNavigatorItem abstractNavigatorItem = (ScxmlAbstractNavigatorItem) aSelection
+				.getFirstElement();
+		View navigatorView = null;
+		if (abstractNavigatorItem instanceof ScxmlNavigatorItem) {
+			navigatorView = ((ScxmlNavigatorItem) abstractNavigatorItem)
+					.getView();
+		} else if (abstractNavigatorItem instanceof ScxmlNavigatorGroup) {
+			ScxmlNavigatorGroup navigatorGroup = (ScxmlNavigatorGroup) abstractNavigatorItem;
+			if (navigatorGroup.getParent() instanceof ScxmlNavigatorItem) {
+				navigatorView = ((ScxmlNavigatorItem) navigatorGroup
+						.getParent()).getView();
+			}
+		}
+		if (navigatorView == null) {
+			return;
+		}
+		IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
+		IEditorPart editor = aPage.findEditor(editorInput);
+		if (editor == null) {
+			return;
+		}
+		aPage.bringToTop(editor);
+		if (editor instanceof DiagramEditor) {
+			DiagramEditor diagramEditor = (DiagramEditor) editor;
+			ResourceSet diagramEditorResourceSet = diagramEditor
+					.getEditingDomain().getResourceSet();
+			EObject selectedView = diagramEditorResourceSet.getEObject(
+					EcoreUtil.getURI(navigatorView), true);
+			if (selectedView == null) {
+				return;
+			}
+			GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor
+					.getAdapter(GraphicalViewer.class);
+			EditPart selectedEditPart = (EditPart) graphicalViewer
+					.getEditPartRegistry().get(selectedView);
+			if (selectedEditPart != null) {
+				graphicalViewer.select(selectedEditPart);
+			}
+		}
+	}
+
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorLinkHelper.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/navigator/ScxmlNavigatorSorter.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/navigator/ScxmlNavigatorSorter.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/navigator/ScxmlNavigatorSorter.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorSorter.java Mon May 17 14:38:45 2010
@@ -0,0 +1,43 @@
+/*
+ * 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.navigator;
+
+import org.apache.commons.scxml.diagram.part.ScxmlVisualIDRegistry;
+import org.eclipse.jface.viewers.ViewerSorter;
+
+/**
+ * @generated
+ */
+public class ScxmlNavigatorSorter extends ViewerSorter {
+
+	/**
+	 * @generated
+	 */
+	private static final int GROUP_CATEGORY = 5029;
+
+	/**
+	 * @generated
+	 */
+	public int category(Object element) {
+		if (element instanceof ScxmlNavigatorItem) {
+			ScxmlNavigatorItem item = (ScxmlNavigatorItem) element;
+			return ScxmlVisualIDRegistry.getVisualID(item.getView());
+		}
+		return GROUP_CATEGORY;
+	}
+
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/navigator/ScxmlNavigatorSorter.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/parsers/AbstractParser.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/parsers/AbstractParser.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/parsers/AbstractParser.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/parsers/AbstractParser.java Mon May 17 14:38:45 2010
@@ -0,0 +1,456 @@
+/*
+ * 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.parsers;
+
+import java.util.Arrays;
+
+import org.apache.commons.scxml.diagram.part.Messages;
+import org.apache.commons.scxml.diagram.part.ScxmlDiagramEditorPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EEnumLiteral;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @generated
+ */
+public abstract class AbstractParser implements IParser {
+
+	/**
+	 * @generated
+	 */
+	protected final EAttribute[] features;
+
+	/**
+	 * @generated
+	 */
+	private String viewPattern;
+
+	/**
+	 * @generated
+	 */
+	private String editorPattern;
+
+	/**
+	 * @generated
+	 */
+	private String editPattern;
+
+	/**
+	 * @generated
+	 */
+	public AbstractParser(EAttribute[] features) {
+		if (features == null || Arrays.asList(features).contains(null)) {
+			throw new IllegalArgumentException();
+		}
+		this.features = features;
+	}
+
+	/**
+	 * @generated
+	 */
+	public String getViewPattern() {
+		return viewPattern;
+	}
+
+	/**
+	 * @generated
+	 */
+	public void setViewPattern(String viewPattern) {
+		this.viewPattern = viewPattern;
+	}
+
+	/**
+	 * @generated
+	 */
+	public String getEditorPattern() {
+		return editorPattern;
+	}
+
+	/**
+	 * @generated
+	 */
+	public void setEditorPattern(String editorPattern) {
+		this.editorPattern = editorPattern;
+	}
+
+	/**
+	 * @generated
+	 */
+	public String getEditPattern() {
+		return editPattern;
+	}
+
+	/**
+	 * @generated
+	 */
+	public void setEditPattern(String editPattern) {
+		this.editPattern = editPattern;
+	}
+
+	/**
+	 * @generated
+	 */
+	public boolean isAffectingEvent(Object event, int flags) {
+		if (event instanceof Notification) {
+			return isAffectingFeature(((Notification) event).getFeature());
+		}
+		return false;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected boolean isAffectingFeature(Object feature) {
+		for (int i = 0; i < features.length; i++) {
+			if (features[i] == feature) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * @generated
+	 */
+	public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
+		return null;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected Object[] getValues(EObject element) {
+		Object[] values = new Object[features.length];
+		for (int i = 0; i < features.length; i++) {
+			values[i] = getValue(element, features[i]);
+		}
+		return values;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected Object getValue(EObject element, EAttribute feature) {
+		Object value = element.eGet(feature);
+		Class iClass = feature.getEAttributeType().getInstanceClass();
+		if (String.class.equals(iClass)) {
+			if (value == null) {
+				value = ""; //$NON-NLS-1$
+			}
+		}
+		return value;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected ICommand getParseCommand(IAdaptable adapter, Object[] values,
+			int flags) {
+		if (values == null
+				|| validateNewValues(values).getCode() != IParserEditStatus.EDITABLE) {
+			return UnexecutableCommand.INSTANCE;
+		}
+		EObject element = (EObject) adapter.getAdapter(EObject.class);
+		TransactionalEditingDomain editingDomain = TransactionUtil
+				.getEditingDomain(element);
+		if (editingDomain == null) {
+			return UnexecutableCommand.INSTANCE;
+		}
+		CompositeTransactionalCommand command = new CompositeTransactionalCommand(
+				editingDomain, "Set Values"); //$NON-NLS-1$
+		for (int i = 0; i < values.length; i++) {
+			command.compose(getModificationCommand(element, features[i],
+					values[i]));
+		}
+		return command;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected ICommand getModificationCommand(EObject element,
+			EAttribute feature, Object value) {
+		value = getValidNewValue(feature, value);
+		if (value instanceof InvalidValue) {
+			return UnexecutableCommand.INSTANCE;
+		}
+		SetRequest request = new SetRequest(element, feature, value);
+		return new SetValueCommand(request);
+	}
+
+	/**
+	 * @generated
+	 */
+	protected IParserEditStatus validateNewValues(Object[] values) {
+		if (values.length != features.length) {
+			return ParserEditStatus.UNEDITABLE_STATUS;
+		}
+		for (int i = 0; i < values.length; i++) {
+			Object value = getValidNewValue(features[i], values[i]);
+			if (value instanceof InvalidValue) {
+				return new ParserEditStatus(ScxmlDiagramEditorPlugin.ID,
+						IParserEditStatus.UNEDITABLE, value.toString());
+			}
+		}
+		return ParserEditStatus.EDITABLE_STATUS;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected Object getValidNewValue(EAttribute feature, Object value) {
+		EClassifier type = feature.getEType();
+		if (type instanceof EDataType) {
+			Class iClass = type.getInstanceClass();
+			if (Boolean.TYPE.equals(iClass)) {
+				if (value instanceof Boolean) {
+					// ok
+				} else if (value instanceof String) {
+					value = Boolean.valueOf((String) value);
+				} else {
+					value = new InvalidValue(NLS.bind(
+							Messages.AbstractParser_UnexpectedValueTypeMessage,
+							iClass.getName()));
+				}
+			} else if (Character.TYPE.equals(iClass)) {
+				if (value instanceof Character) {
+					// ok
+				} else if (value instanceof String) {
+					String s = (String) value;
+					if (s.length() == 0) {
+						value = null;
+					} else {
+						value = new Character(s.charAt(0));
+					}
+				} else {
+					value = new InvalidValue(NLS.bind(
+							Messages.AbstractParser_UnexpectedValueTypeMessage,
+							iClass.getName()));
+				}
+			} else if (Byte.TYPE.equals(iClass)) {
+				if (value instanceof Byte) {
+					// ok
+				} else if (value instanceof Number) {
+					value = new Byte(((Number) value).byteValue());
+				} else if (value instanceof String) {
+					String s = (String) value;
+					if (s.length() == 0) {
+						value = null;
+					} else {
+						try {
+							value = Byte.valueOf(s);
+						} catch (NumberFormatException nfe) {
+							value = new InvalidValue(
+									NLS
+											.bind(
+													Messages.AbstractParser_WrongStringConversionMessage,
+													iClass.getName()));
+						}
+					}
+				} else {
+					value = new InvalidValue(NLS.bind(
+							Messages.AbstractParser_UnexpectedValueTypeMessage,
+							iClass.getName()));
+				}
+			} else if (Short.TYPE.equals(iClass)) {
+				if (value instanceof Short) {
+					// ok
+				} else if (value instanceof Number) {
+					value = new Short(((Number) value).shortValue());
+				} else if (value instanceof String) {
+					String s = (String) value;
+					if (s.length() == 0) {
+						value = null;
+					} else {
+						try {
+							value = Short.valueOf(s);
+						} catch (NumberFormatException nfe) {
+							value = new InvalidValue(
+									NLS
+											.bind(
+													Messages.AbstractParser_WrongStringConversionMessage,
+													iClass.getName()));
+						}
+					}
+				} else {
+					value = new InvalidValue(NLS.bind(
+							Messages.AbstractParser_UnexpectedValueTypeMessage,
+							iClass.getName()));
+				}
+			} else if (Integer.TYPE.equals(iClass)) {
+				if (value instanceof Integer) {
+					// ok
+				} else if (value instanceof Number) {
+					value = new Integer(((Number) value).intValue());
+				} else if (value instanceof String) {
+					String s = (String) value;
+					if (s.length() == 0) {
+						value = null;
+					} else {
+						try {
+							value = Integer.valueOf(s);
+						} catch (NumberFormatException nfe) {
+							value = new InvalidValue(
+									NLS
+											.bind(
+													Messages.AbstractParser_WrongStringConversionMessage,
+													iClass.getName()));
+						}
+					}
+				} else {
+					value = new InvalidValue(NLS.bind(
+							Messages.AbstractParser_UnexpectedValueTypeMessage,
+							iClass.getName()));
+				}
+			} else if (Long.TYPE.equals(iClass)) {
+				if (value instanceof Long) {
+					// ok
+				} else if (value instanceof Number) {
+					value = new Long(((Number) value).longValue());
+				} else if (value instanceof String) {
+					String s = (String) value;
+					if (s.length() == 0) {
+						value = null;
+					} else {
+						try {
+							value = Long.valueOf(s);
+						} catch (NumberFormatException nfe) {
+							value = new InvalidValue(
+									NLS
+											.bind(
+													Messages.AbstractParser_WrongStringConversionMessage,
+													iClass.getName()));
+						}
+					}
+				} else {
+					value = new InvalidValue(NLS.bind(
+							Messages.AbstractParser_UnexpectedValueTypeMessage,
+							iClass.getName()));
+				}
+			} else if (Float.TYPE.equals(iClass)) {
+				if (value instanceof Float) {
+					// ok
+				} else if (value instanceof Number) {
+					value = new Float(((Number) value).floatValue());
+				} else if (value instanceof String) {
+					String s = (String) value;
+					if (s.length() == 0) {
+						value = null;
+					} else {
+						try {
+							value = Float.valueOf(s);
+						} catch (NumberFormatException nfe) {
+							value = new InvalidValue(
+									NLS
+											.bind(
+													Messages.AbstractParser_WrongStringConversionMessage,
+													iClass.getName()));
+						}
+					}
+				} else {
+					value = new InvalidValue(NLS.bind(
+							Messages.AbstractParser_UnexpectedValueTypeMessage,
+							iClass.getName()));
+				}
+			} else if (Double.TYPE.equals(iClass)) {
+				if (value instanceof Double) {
+					// ok
+				} else if (value instanceof Number) {
+					value = new Double(((Number) value).doubleValue());
+				} else if (value instanceof String) {
+					String s = (String) value;
+					if (s.length() == 0) {
+						value = null;
+					} else {
+						try {
+							value = Double.valueOf(s);
+						} catch (NumberFormatException nfe) {
+							value = new InvalidValue(
+									NLS
+											.bind(
+													Messages.AbstractParser_WrongStringConversionMessage,
+													iClass.getName()));
+						}
+					}
+				} else {
+					value = new InvalidValue(NLS.bind(
+							Messages.AbstractParser_UnexpectedValueTypeMessage,
+							iClass.getName()));
+				}
+			} else if (type instanceof EEnum) {
+				if (value instanceof String) {
+					EEnumLiteral literal = ((EEnum) type)
+							.getEEnumLiteralByLiteral((String) value);
+					if (literal == null) {
+						value = new InvalidValue(NLS.bind(
+								Messages.AbstractParser_UnknownLiteralMessage,
+								value));
+					} else {
+						value = literal.getInstance();
+					}
+				} else {
+					value = new InvalidValue(NLS.bind(
+							Messages.AbstractParser_UnexpectedValueTypeMessage,
+							String.class.getName()));
+				}
+			}
+		}
+		return value;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected class InvalidValue {
+
+		/**
+		 * @generated
+		 */
+		private String description;
+
+		/**
+		 * @generated
+		 */
+		public InvalidValue(String description) {
+			this.description = description;
+		}
+
+		/**
+		 * @generated
+		 */
+		public String toString() {
+			return description;
+		}
+	}
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/parsers/AbstractParser.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/parsers/CompositeParser.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/parsers/CompositeParser.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/parsers/CompositeParser.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/parsers/CompositeParser.java Mon May 17 14:38:45 2010
@@ -0,0 +1,91 @@
+/*
+ * 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.parsers;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+
+/**
+ * @generated
+ */
+public class CompositeParser implements IParser {
+
+	/**
+	 * @generated
+	 */
+	private final IParser reader;
+
+	/**
+	 * @generated
+	 */
+	private final IParser writer;
+
+	/**
+	 * @generated
+	 */
+	public CompositeParser(IParser reader, IParser writer) {
+		this.reader = reader;
+		this.writer = writer;
+	}
+
+	/**
+	 * @generated
+	 */
+	public boolean isAffectingEvent(Object event, int flags) {
+		return reader.isAffectingEvent(event, flags);
+	}
+
+	/**
+	 * @generated
+	 */
+	public String getPrintString(IAdaptable adapter, int flags) {
+		return reader.getPrintString(adapter, flags);
+	}
+
+	/**
+	 * @generated
+	 */
+	public String getEditString(IAdaptable adapter, int flags) {
+		return reader.getEditString(adapter, flags);
+	}
+
+	/**
+	 * @generated
+	 */
+	public IParserEditStatus isValidEditString(IAdaptable adapter,
+			String editString) {
+		return writer.isValidEditString(adapter, editString);
+	}
+
+	/**
+	 * @generated
+	 */
+	public ICommand getParseCommand(IAdaptable adapter, String newString,
+			int flags) {
+		return writer.getParseCommand(adapter, newString, flags);
+	}
+
+	/**
+	 * @generated
+	 */
+	public IContentAssistProcessor getCompletionProcessor(IAdaptable adapter) {
+		return writer.getCompletionProcessor(adapter);
+	}
+}

Propchange: commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/parsers/CompositeParser.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/parsers/MessageFormatParser.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/parsers/MessageFormatParser.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/parsers/MessageFormatParser.java (added)
+++ commons/sandbox/gsoc/2010/scxml-eclipse/trunk/src/main/java/org.apache.commons.scxml.diagram/src/org/apache/commons/scxml/diagram/parsers/MessageFormatParser.java Mon May 17 14:38:45 2010
@@ -0,0 +1,226 @@
+/*
+ * 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.parsers;
+
+import java.text.FieldPosition;
+import java.text.MessageFormat;
+import java.text.ParsePosition;
+
+import org.apache.commons.scxml.diagram.part.Messages;
+import org.apache.commons.scxml.diagram.part.ScxmlDiagramEditorPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @generated
+ */
+public class MessageFormatParser extends AbstractParser {
+
+	/**
+	 * @generated
+	 */
+	private String defaultPattern;
+
+	/**
+	 * @generated
+	 */
+	private MessageFormat viewProcessor;
+
+	/**
+	 * @generated
+	 */
+	private MessageFormat editorProcessor;
+
+	/**
+	 * @generated
+	 */
+	private MessageFormat editProcessor;
+
+	/**
+	 * @generated
+	 */
+	public MessageFormatParser(EAttribute[] features) {
+		super(features);
+	}
+
+	/**
+	 * @generated
+	 */
+	protected String getDefaultPattern() {
+		if (defaultPattern == null) {
+			StringBuffer sb = new StringBuffer();
+			for (int i = 0; i < features.length; i++) {
+				if (i > 0) {
+					sb.append(' ');
+				}
+				sb.append('{');
+				sb.append(i);
+				sb.append('}');
+			}
+			defaultPattern = sb.toString();
+		}
+		return defaultPattern;
+	}
+
+	/**
+	 * @generated
+	 */
+	public String getViewPattern() {
+		String pattern = super.getViewPattern();
+		return pattern != null ? pattern : getDefaultPattern();
+	}
+
+	/**
+	 * @generated
+	 */
+	public void setViewPattern(String viewPattern) {
+		super.setViewPattern(viewPattern);
+		viewProcessor = null;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected MessageFormat createViewProcessor(String viewPattern) {
+		return new MessageFormat(viewPattern);
+	}
+
+	/**
+	 * @generated
+	 */
+	protected MessageFormat getViewProcessor() {
+		if (viewProcessor == null) {
+			viewProcessor = createViewProcessor(getViewPattern());
+		}
+		return viewProcessor;
+	}
+
+	/**
+	 * @generated
+	 */
+	public String getEditorPattern() {
+		String pattern = super.getEditorPattern();
+		return pattern != null ? pattern : getDefaultPattern();
+	}
+
+	/**
+	 * @generated
+	 */
+	public void setEditorPattern(String editorPattern) {
+		super.setEditorPattern(editorPattern);
+		editorProcessor = null;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected MessageFormat createEditorProcessor(String editorPattern) {
+		return new MessageFormat(editorPattern);
+	}
+
+	/**
+	 * @generated
+	 */
+	protected MessageFormat getEditorProcessor() {
+		if (editorProcessor == null) {
+			editorProcessor = createEditorProcessor(getEditorPattern());
+		}
+		return editorProcessor;
+	}
+
+	/**
+	 * @generated
+	 */
+	public String getEditPattern() {
+		String pattern = super.getEditPattern();
+		return pattern != null ? pattern : getDefaultPattern();
+	}
+
+	/**
+	 * @generated
+	 */
+	public void setEditPattern(String editPattern) {
+		super.setEditPattern(editPattern);
+		editProcessor = null;
+	}
+
+	/**
+	 * @generated
+	 */
+	protected MessageFormat createEditProcessor(String editPattern) {
+		return new MessageFormat(editPattern);
+	}
+
+	/**
+	 * @generated
+	 */
+	protected MessageFormat getEditProcessor() {
+		if (editProcessor == null) {
+			editProcessor = createEditProcessor(getEditPattern());
+		}
+		return editProcessor;
+	}
+
+	/**
+	 * @generated
+	 */
+	public String getPrintString(IAdaptable adapter, int flags) {
+		EObject element = (EObject) adapter.getAdapter(EObject.class);
+		return getViewProcessor().format(getValues(element),
+				new StringBuffer(), new FieldPosition(0)).toString();
+	}
+
+	/**
+	 * @generated
+	 */
+	public String getEditString(IAdaptable adapter, int flags) {
+		EObject element = (EObject) adapter.getAdapter(EObject.class);
+		return getEditorProcessor().format(getValues(element),
+				new StringBuffer(), new FieldPosition(0)).toString();
+	}
+
+	/**
+	 * @generated
+	 */
+	public IParserEditStatus isValidEditString(IAdaptable adapter,
+			String editString) {
+		ParsePosition pos = new ParsePosition(0);
+		Object[] values = getEditProcessor().parse(editString, pos);
+		if (values == null) {
+			return new ParserEditStatus(ScxmlDiagramEditorPlugin.ID,
+					IParserEditStatus.UNEDITABLE, NLS.bind(
+							Messages.MessageFormatParser_InvalidInputError,
+							new Integer(pos.getErrorIndex())));
+		}
+		return validateNewValues(values);
+	}
+
+	/**
+	 * @generated
+	 */
+	public ICommand getParseCommand(IAdaptable adapter, String newString,
+			int flags) {
+		Object[] values = getEditProcessor().parse(newString,
+				new ParsePosition(0));
+		return getParseCommand(adapter, values, flags);
+	}
+}

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



Mime
View raw message