cdt/cdt_6_0_x/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DebugTextHover.java
equal
deleted
inserted
replaced
14 |
14 |
15 import org.eclipse.cdt.debug.core.model.ICStackFrame; |
15 import org.eclipse.cdt.debug.core.model.ICStackFrame; |
16 import org.eclipse.cdt.debug.ui.editors.AbstractDebugTextHover; |
16 import org.eclipse.cdt.debug.ui.editors.AbstractDebugTextHover; |
17 import org.eclipse.core.runtime.IAdaptable; |
17 import org.eclipse.core.runtime.IAdaptable; |
18 import org.eclipse.debug.core.DebugException; |
18 import org.eclipse.debug.core.DebugException; |
19 import org.eclipse.jface.viewers.IStructuredSelection; |
|
20 |
19 |
21 /** |
20 /** |
22 * The text hovering support for C/C++ debugger. |
21 * The text hovering support for C/C++ debugger. |
23 */ |
22 */ |
24 |
23 |
28 * Returns the evaluation stack frame, or <code>null</code> if none. |
27 * Returns the evaluation stack frame, or <code>null</code> if none. |
29 * |
28 * |
30 * @return the evaluation stack frame, or <code>null</code> if none |
29 * @return the evaluation stack frame, or <code>null</code> if none |
31 */ |
30 */ |
32 protected ICStackFrame getFrame() { |
31 protected ICStackFrame getFrame() { |
33 if (fSelection instanceof IStructuredSelection) { |
32 IAdaptable adaptable = getSelectionAdaptable(); |
34 IStructuredSelection selection = (IStructuredSelection) fSelection; |
33 if (adaptable != null) { |
35 if (selection.size() == 1) { |
34 return (ICStackFrame) adaptable.getAdapter(ICStackFrame.class); |
36 Object el = selection.getFirstElement(); |
35 } |
37 if (el instanceof IAdaptable) { |
36 return null; |
38 return (ICStackFrame) ((IAdaptable) el) |
|
39 .getAdapter(ICStackFrame.class); |
|
40 } |
|
41 } |
|
42 } |
|
43 return null; |
|
44 } |
37 } |
45 |
38 |
46 @Override |
39 @Override |
47 protected boolean canEvaluate() { |
40 protected boolean canEvaluate() { |
48 ICStackFrame frame = getFrame(); |
41 ICStackFrame frame = getFrame(); |