KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > actions > OpenDeclaringTypeAction


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.debug.ui.actions;
12
13
14 import org.eclipse.core.runtime.CoreException;
15 import org.eclipse.debug.core.model.IDebugElement;
16 import org.eclipse.jdt.debug.core.IJavaStackFrame;
17 import org.eclipse.jdt.debug.core.IJavaType;
18
19 /**
20  * Opens the declaring type of a stack frame.
21  */

22 public class OpenDeclaringTypeAction extends OpenStackFrameAction {
23     
24     /* (non-Javadoc)
25      * @see org.eclipse.jdt.internal.debug.ui.actions.OpenTypeAction#getTypeToOpen(org.eclipse.debug.core.model.IDebugElement)
26      */

27     protected IJavaType getTypeToOpen(IDebugElement element) throws CoreException {
28         if (element instanceof IJavaStackFrame) {
29             IJavaStackFrame frame = (IJavaStackFrame) element;
30             return frame.getReferenceType();
31         }
32         return null;
33     }
34     
35 }
36
Popular Tags