carbidecpp22devenv/plugins/org.eclipse.gmf.templates.legacy_1.0.0.v20090614-0839/codegen.lite.templates/aspects/xpt/navigator/NavigatorLinkHelper.xpt
changeset 422 033392511bf7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/carbidecpp22devenv/plugins/org.eclipse.gmf.templates.legacy_1.0.0.v20090614-0839/codegen.lite.templates/aspects/xpt/navigator/NavigatorLinkHelper.xpt	Fri Dec 04 11:06:59 2009 -0600
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2006 Borland Software Corporation
+ * 
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Alexander Shatalin (Borland) - initial API and implementation
+ */
+
+«IMPORT "http://www.eclipse.org/gmf/2008/GenModel"»
+
+«AROUND diagramEditorClassFQName FOR gmfgen::GenNavigator»org.eclipse.gmf.runtime.lite.parts.DiagramEditor«ENDAROUND»
+
+«AROUND getViewFromShortcut FOR gmfgen::GenNavigator»«ENDAROUND»
+
+«AROUND getDiagram FOR gmfgen::GenEditorGenerator-»
+org.eclipse.gmf.runtime.notation.Diagram diagram = null;
+if (anInput instanceof org.eclipse.gmf.runtime.lite.parts.DiagramEditorInput) {
+	diagram = ((org.eclipse.gmf.runtime.lite.parts.DiagramEditorInput) anInput).getDiagram();
+} else {
+	org.eclipse.ui.IWorkbenchWindow activeWindow = org.eclipse.ui.PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+	if (activeWindow != null) {
+		org.eclipse.ui.IWorkbenchPage activePage = activeWindow.getActivePage();
+		org.eclipse.ui.IEditorPart anEditor = activePage.findEditor(anInput);
+		if (anEditor instanceof «diagram.editorGen.editor.getQualifiedClassName()») {
+			diagram = ((«diagram.editorGen.editor.getQualifiedClassName()») anEditor).getDiagram();
+		}
+	}
+}
+if (diagram == null) {
+	return org.eclipse.jface.viewers.StructuredSelection.EMPTY;
+}
+«ENDAROUND»
+
+«AROUND defineDiagramDocument FOR gmfgen::GenPlugin-»
+«ENDAROUND»