KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > core > logicalstructures > MapEntryStructureType


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

11 package org.eclipse.jdt.internal.debug.core.logicalstructures;
12
13 import org.eclipse.core.runtime.IProgressMonitor;
14 import org.eclipse.debug.core.DebugException;
15 import org.eclipse.jdt.debug.core.IEvaluationRunnable;
16 import org.eclipse.jdt.debug.core.IJavaThread;
17 import org.eclipse.jdt.debug.core.IJavaValue;
18 import org.eclipse.jdt.debug.core.IJavaVariable;
19
20 /**
21  * Logical structure type for map entries
22  */

23 public class MapEntryStructureType extends LogicalObjectStructureInterfaceType {
24
25     /* (non-Javadoc)
26      * @see org.eclipse.jdt.internal.debug.core.logicalstructures.LogicalObjectStructureType#getEvaluation()
27      */

28     protected IEvaluationRunnable getEvaluation() {
29         return new IEvaluationRunnable() {
30             /* (non-Javadoc)
31              * @see org.eclipse.jdt.debug.core.IEvaluationRunnable#run(org.eclipse.jdt.debug.core.IJavaThread, org.eclipse.core.runtime.IProgressMonitor)
32              */

33             public void run(IJavaThread thread, IProgressMonitor monitor) throws DebugException {
34                 IJavaValue key = getObject().sendMessage("getKey", "()Ljava/lang/Object;", null, thread, false); //$NON-NLS-1$ //$NON-NLS-2$
35
IJavaValue value = getObject().sendMessage("getValue", "()Ljava/lang/Object;", null, thread, false); //$NON-NLS-1$ //$NON-NLS-2$
36
IJavaVariable[] javaVars = new IJavaVariable[2];
37                 javaVars[0] = new JDIPlaceholderVariable("key", key); //$NON-NLS-1$
38
javaVars[1] = new JDIPlaceholderVariable("value", value); //$NON-NLS-1$
39
LogicalObjectStructureValue structure = new LogicalObjectStructureValue(getObject(), javaVars);
40                 setLogicalStructure(structure);
41             }
42             
43         };
44     }
45
46     /* (non-Javadoc)
47      * @see org.eclipse.jdt.internal.debug.core.logicalstructures.LogicalObjectStructureType#getTargetInterfaceName()
48      */

49     protected String JavaDoc getTargetInterfaceName() {
50         return "java.util.Map$Entry"; //$NON-NLS-1$
51
}
52
53 }
54
Popular Tags