001: package org.drools.eclipse.debug;
002:
003: import org.eclipse.debug.core.DebugException;
004: import org.eclipse.debug.core.ILaunch;
005: import org.eclipse.debug.core.model.IDebugTarget;
006: import org.eclipse.debug.core.model.IVariable;
007: import org.eclipse.jdt.debug.core.IJavaFieldVariable;
008: import org.eclipse.jdt.debug.core.IJavaObject;
009: import org.eclipse.jdt.debug.core.IJavaThread;
010: import org.eclipse.jdt.debug.core.IJavaType;
011: import org.eclipse.jdt.debug.core.IJavaValue;
012: import org.eclipse.jdt.debug.core.IJavaVariable;
013:
014: /**
015: * Creates a IJavaObject from an IJavaObject and given variables.
016: *
017: * @author <a href="mailto:kris_verlaenen@hotmail.com">kris verlaenen </a>
018: */
019: public class ObjectWrapper implements IJavaObject {
020:
021: private IJavaObject object;
022: private IJavaVariable[] variables;
023:
024: public ObjectWrapper(IJavaObject object, IJavaVariable[] variables) {
025: this .object = object;
026: this .variables = variables;
027: }
028:
029: public IJavaValue sendMessage(String selector, String signature,
030: IJavaValue[] args, IJavaThread thread, boolean super Send)
031: throws DebugException {
032: return object.sendMessage(selector, signature, args, thread,
033: super Send);
034: }
035:
036: public IJavaValue sendMessage(String selector, String signature,
037: IJavaValue[] args, IJavaThread thread, String typeSignature)
038: throws DebugException {
039: return object.sendMessage(selector, signature, args, thread,
040: typeSignature);
041: }
042:
043: public IJavaFieldVariable getField(String name, boolean super Field)
044: throws DebugException {
045: return object.getField(name, super Field);
046: }
047:
048: public IJavaFieldVariable getField(String name, String typeSignature)
049: throws DebugException {
050: return object.getField(name, typeSignature);
051: }
052:
053: public String getSignature() throws DebugException {
054: return object.getSignature();
055: }
056:
057: public String getGenericSignature() throws DebugException {
058: return object.getGenericSignature();
059: }
060:
061: public IJavaType getJavaType() throws DebugException {
062: return object.getJavaType();
063: }
064:
065: public String getReferenceTypeName() throws DebugException {
066: return object.getReferenceTypeName();
067: }
068:
069: public String getValueString() throws DebugException {
070: return object.getValueString();
071: }
072:
073: public boolean isAllocated() throws DebugException {
074: return object.isAllocated();
075: }
076:
077: public IVariable[] getVariables() {
078: return variables;
079: }
080:
081: public boolean hasVariables() {
082: return variables.length > 0;
083: }
084:
085: protected void setVariables(IJavaVariable[] variables) {
086: this .variables = variables;
087: }
088:
089: public String getModelIdentifier() {
090: return object.getModelIdentifier();
091: }
092:
093: public IDebugTarget getDebugTarget() {
094: return object.getDebugTarget();
095: }
096:
097: public ILaunch getLaunch() {
098: return object.getLaunch();
099: }
100:
101: public Object getAdapter(Class adapter) {
102: return object.getAdapter(adapter);
103: }
104:
105: public IJavaThread[] getWaitingThreads() throws DebugException {
106: return null;
107: }
108:
109: public IJavaThread getOwningThread() throws DebugException {
110: return null;
111: }
112: }
|