|
Lines 11-17
Link Here
|
| 11 |
**********************************************************************/ |
11 |
**********************************************************************/ |
| 12 |
package org.eclipse.hyades.trace.views.actions.internal; |
12 |
package org.eclipse.hyades.trace.views.actions.internal; |
| 13 |
|
13 |
|
|
|
14 |
import org.eclipse.emf.ecore.EObject; |
| 15 |
import org.eclipse.hyades.models.trace.TRCClass; |
| 16 |
import org.eclipse.hyades.models.trace.TRCMethod; |
| 17 |
import org.eclipse.hyades.models.trace.TRCMethodInvocation; |
| 18 |
import org.eclipse.hyades.models.trace.TRCObject; |
| 14 |
import org.eclipse.hyades.trace.views.util.internal.OpenSource; |
19 |
import org.eclipse.hyades.trace.views.util.internal.OpenSource; |
|
|
20 |
import org.eclipse.hyades.uml2sd.trace.selection.IEObjectSelection; |
| 15 |
import org.eclipse.jface.action.Action; |
21 |
import org.eclipse.jface.action.Action; |
| 16 |
import org.eclipse.jface.action.IAction; |
22 |
import org.eclipse.jface.action.IAction; |
| 17 |
import org.eclipse.jface.resource.ImageDescriptor; |
23 |
import org.eclipse.jface.resource.ImageDescriptor; |
|
Lines 31-37
Link Here
|
| 31 |
implements IWorkbenchWindowActionDelegate, IViewActionDelegate |
37 |
implements IWorkbenchWindowActionDelegate, IViewActionDelegate |
| 32 |
//extends OpenTraceViewAction |
38 |
//extends OpenTraceViewAction |
| 33 |
{ |
39 |
{ |
| 34 |
protected ISelection selection; |
40 |
protected ISelection _selection; |
| 35 |
|
41 |
|
| 36 |
/** |
42 |
/** |
| 37 |
* OpenReferencePatternView constructor comment. |
43 |
* OpenReferencePatternView constructor comment. |
|
Lines 62-82
Link Here
|
| 62 |
public void run() |
68 |
public void run() |
| 63 |
{ |
69 |
{ |
| 64 |
Object sel = null; |
70 |
Object sel = null; |
| 65 |
|
71 |
|
| 66 |
if(selection != null && !selection.isEmpty()) |
72 |
if ( _selection != null && !_selection.isEmpty() ) { |
| 67 |
{ |
73 |
sel = ((IStructuredSelection)_selection).getFirstElement(); |
| 68 |
sel = ((IStructuredSelection)selection).getFirstElement(); |
74 |
|
|
|
75 |
if ( sel instanceof IEObjectSelection ) { |
| 76 |
EObject eObject = ((IEObjectSelection) sel).getEObject(); |
| 77 |
|
| 78 |
if (eObject instanceof TRCMethodInvocation || |
| 79 |
eObject instanceof TRCMethod || |
| 80 |
eObject instanceof TRCClass || |
| 81 |
eObject instanceof TRCObject) { |
| 82 |
sel = eObject; |
| 83 |
} |
| 84 |
} |
| 69 |
} |
85 |
} |
| 70 |
|
86 |
|
| 71 |
OpenSource.openSource(sel); |
87 |
OpenSource.openSource(sel); |
| 72 |
|
88 |
|
| 73 |
sel = null; |
89 |
sel = null; |
| 74 |
|
|
|
| 75 |
} |
90 |
} |
| 76 |
|
91 |
|
| 77 |
public void selectionChanged(IAction action, ISelection selection) { |
92 |
public void selectionChanged(IAction action, ISelection selection) { |
| 78 |
|
93 |
|
| 79 |
this.selection = selection; |
94 |
this._selection = selection; |
| 80 |
} |
95 |
} |
| 81 |
|
96 |
|
| 82 |
/* |
97 |
/* |
|
Lines 91-97
Link Here
|
| 91 |
{ |
106 |
{ |
| 92 |
//super.dispose(); |
107 |
//super.dispose(); |
| 93 |
|
108 |
|
| 94 |
selection = null; |
109 |
_selection = null; |
| 95 |
|
110 |
|
| 96 |
} |
111 |
} |
| 97 |
|
112 |
|