001: /*******************************************************************************
002: * Copyright (c) 2000, 2007 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.jdt.internal.debug.core.logicalstructures;
011:
012: import org.eclipse.debug.core.DebugException;
013: import org.eclipse.debug.core.ILaunch;
014: import org.eclipse.debug.core.model.IDebugTarget;
015: import org.eclipse.debug.core.model.IVariable;
016: import org.eclipse.jdt.debug.core.IJavaFieldVariable;
017: import org.eclipse.jdt.debug.core.IJavaObject;
018: import org.eclipse.jdt.debug.core.IJavaThread;
019: import org.eclipse.jdt.debug.core.IJavaType;
020: import org.eclipse.jdt.debug.core.IJavaValue;
021: import org.eclipse.jdt.debug.core.IJavaVariable;
022:
023: /**
024: * A proxy to an object representing the logical structure of that object.
025: */
026: public class LogicalObjectStructureValue implements IJavaObject {
027:
028: private IJavaObject fObject;
029: private IJavaVariable[] fVariables;
030:
031: /**
032: * Constructs a proxy to the given object, with the given variables
033: * as children.
034: *
035: * @param object original object
036: * @param variables java variables to add as children to this object
037: */
038: public LogicalObjectStructureValue(IJavaObject object,
039: IJavaVariable[] variables) {
040: fObject = object;
041: fVariables = variables;
042: }
043:
044: /* (non-Javadoc)
045: * @see org.eclipse.jdt.debug.core.IJavaObject#sendMessage(java.lang.String, java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[], org.eclipse.jdt.debug.core.IJavaThread, boolean)
046: */
047: public IJavaValue sendMessage(String selector, String signature,
048: IJavaValue[] args, IJavaThread thread, boolean super Send)
049: throws DebugException {
050: return fObject.sendMessage(selector, signature, args, thread,
051: super Send);
052: }
053:
054: /* (non-Javadoc)
055: * @see org.eclipse.jdt.debug.core.IJavaObject#sendMessage(java.lang.String, java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[], org.eclipse.jdt.debug.core.IJavaThread, java.lang.String)
056: */
057: public IJavaValue sendMessage(String selector, String signature,
058: IJavaValue[] args, IJavaThread thread, String typeSignature)
059: throws DebugException {
060: return fObject.sendMessage(selector, signature, args, thread,
061: typeSignature);
062: }
063:
064: /* (non-Javadoc)
065: * @see org.eclipse.jdt.debug.core.IJavaObject#getField(java.lang.String, boolean)
066: */
067: public IJavaFieldVariable getField(String name, boolean super Field)
068: throws DebugException {
069: return fObject.getField(name, super Field);
070: }
071:
072: /* (non-Javadoc)
073: * @see org.eclipse.jdt.debug.core.IJavaObject#getField(java.lang.String, java.lang.String)
074: */
075: public IJavaFieldVariable getField(String name, String typeSignature)
076: throws DebugException {
077: return fObject.getField(name, typeSignature);
078: }
079:
080: /* (non-Javadoc)
081: * @see org.eclipse.jdt.debug.core.IJavaValue#getSignature()
082: */
083: public String getSignature() throws DebugException {
084: return fObject.getSignature();
085: }
086:
087: /* (non-Javadoc)
088: * @see org.eclipse.jdt.debug.core.IJavaValue#getGenericSignature()
089: */
090: public String getGenericSignature() throws DebugException {
091: return fObject.getGenericSignature();
092: }
093:
094: /* (non-Javadoc)
095: * @see org.eclipse.jdt.debug.core.IJavaValue#getJavaType()
096: */
097: public IJavaType getJavaType() throws DebugException {
098: return fObject.getJavaType();
099: }
100:
101: /* (non-Javadoc)
102: * @see org.eclipse.debug.core.model.IValue#getReferenceTypeName()
103: */
104: public String getReferenceTypeName() throws DebugException {
105: return fObject.getReferenceTypeName();
106: }
107:
108: /* (non-Javadoc)
109: * @see org.eclipse.debug.core.model.IValue#getValueString()
110: */
111: public String getValueString() throws DebugException {
112: return fObject.getValueString();
113: }
114:
115: /* (non-Javadoc)
116: * @see org.eclipse.debug.core.model.IValue#isAllocated()
117: */
118: public boolean isAllocated() throws DebugException {
119: return fObject.isAllocated();
120: }
121:
122: /* (non-Javadoc)
123: * @see org.eclipse.debug.core.model.IValue#getVariables()
124: */
125: public IVariable[] getVariables() {
126: return fVariables;
127: }
128:
129: /* (non-Javadoc)
130: * @see org.eclipse.debug.core.model.IValue#hasVariables()
131: */
132: public boolean hasVariables() {
133: return fVariables.length > 0;
134: }
135:
136: /* (non-Javadoc)
137: * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
138: */
139: public String getModelIdentifier() {
140: return fObject.getModelIdentifier();
141: }
142:
143: /* (non-Javadoc)
144: * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
145: */
146: public IDebugTarget getDebugTarget() {
147: return fObject.getDebugTarget();
148: }
149:
150: /* (non-Javadoc)
151: * @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
152: */
153: public ILaunch getLaunch() {
154: return fObject.getLaunch();
155: }
156:
157: /* (non-Javadoc)
158: * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
159: */
160: public Object getAdapter(Class adapter) {
161: return fObject.getAdapter(adapter);
162: }
163:
164: /* (non-Javadoc)
165: * @see org.eclipse.jdt.debug.core.IJavaObject#getWaitingThreads()
166: */
167: public IJavaThread[] getWaitingThreads() throws DebugException {
168: return null;
169: }
170:
171: /* (non-Javadoc)
172: * @see org.eclipse.jdt.debug.core.IJavaObject#getOwningThread()
173: */
174: public IJavaThread getOwningThread() throws DebugException {
175: return null;
176: }
177:
178: /* (non-Javadoc)
179: * @see org.eclipse.jdt.debug.core.IJavaObject#getReferringObjects(long)
180: */
181: public IJavaObject[] getReferringObjects(long max)
182: throws DebugException {
183: return fObject.getReferringObjects(max);
184: }
185:
186: /* (non-Javadoc)
187: * @see org.eclipse.jdt.debug.core.IJavaObject#disableCollection()
188: */
189: public void disableCollection() throws DebugException {
190: fObject.disableCollection();
191: }
192:
193: /* (non-Javadoc)
194: * @see org.eclipse.jdt.debug.core.IJavaObject#enableCollection()
195: */
196: public void enableCollection() throws DebugException {
197: fObject.enableCollection();
198: }
199:
200: /* (non-Javadoc)
201: * @see org.eclipse.jdt.debug.core.IJavaObject#getUniqueId()
202: */
203: public long getUniqueId() throws DebugException {
204: return fObject.getUniqueId();
205: }
206: }
|