carbidecpp22devenv/plugins/org.eclipse.gmf.templates.legacy_1.0.0.v20090614-0839/codegen.lite.templates/aspects/xpt/navigator/NavigatorLinkHelper.xpt
equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2006 Borland Software Corporation |
|
3 * |
|
4 * All rights reserved. This program and the accompanying materials |
|
5 * are made available under the terms of the Eclipse Public License v1.0 |
|
6 * which accompanies this distribution, and is available at |
|
7 * http://www.eclipse.org/legal/epl-v10.html |
|
8 * |
|
9 * Contributors: |
|
10 * Alexander Shatalin (Borland) - initial API and implementation |
|
11 */ |
|
12 |
|
13 «IMPORT "http://www.eclipse.org/gmf/2008/GenModel"» |
|
14 |
|
15 «AROUND diagramEditorClassFQName FOR gmfgen::GenNavigator»org.eclipse.gmf.runtime.lite.parts.DiagramEditor«ENDAROUND» |
|
16 |
|
17 «AROUND getViewFromShortcut FOR gmfgen::GenNavigator»«ENDAROUND» |
|
18 |
|
19 «AROUND getDiagram FOR gmfgen::GenEditorGenerator-» |
|
20 org.eclipse.gmf.runtime.notation.Diagram diagram = null; |
|
21 if (anInput instanceof org.eclipse.gmf.runtime.lite.parts.DiagramEditorInput) { |
|
22 diagram = ((org.eclipse.gmf.runtime.lite.parts.DiagramEditorInput) anInput).getDiagram(); |
|
23 } else { |
|
24 org.eclipse.ui.IWorkbenchWindow activeWindow = org.eclipse.ui.PlatformUI.getWorkbench().getActiveWorkbenchWindow(); |
|
25 if (activeWindow != null) { |
|
26 org.eclipse.ui.IWorkbenchPage activePage = activeWindow.getActivePage(); |
|
27 org.eclipse.ui.IEditorPart anEditor = activePage.findEditor(anInput); |
|
28 if (anEditor instanceof «diagram.editorGen.editor.getQualifiedClassName()») { |
|
29 diagram = ((«diagram.editorGen.editor.getQualifiedClassName()») anEditor).getDiagram(); |
|
30 } |
|
31 } |
|
32 } |
|
33 if (diagram == null) { |
|
34 return org.eclipse.jface.viewers.StructuredSelection.EMPTY; |
|
35 } |
|
36 «ENDAROUND» |
|
37 |
|
38 «AROUND defineDiagramDocument FOR gmfgen::GenPlugin-» |
|
39 «ENDAROUND» |