KickJava   Java API By Example, From Geeks To Geeks.

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


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.IJavaType;
17 import org.eclipse.jdt.debug.core.IJavaValue;
18 import org.eclipse.jdt.debug.core.IJavaVariable;
19
20 /**
21  * Opens the concrete type of variable - i.e. it's value's actual type.
22  */

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

28     protected IJavaType getTypeToOpen(IDebugElement element) throws CoreException {
29         if (element instanceof IJavaVariable) {
30             IJavaVariable variable = (IJavaVariable) element;
31             return ((IJavaValue)variable.getValue()).getJavaType();
32         }
33         return null;
34     }
35     
36 }
37
Popular Tags