|
From: Markus B. <mba...@us...> - 2005-08-29 16:06:01
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2766/src/org/rubypeople/rdt/internal/debug/core/model Modified Files: RubyThread.java RubyStackFrame.java RubyVariable.java RubyExpression.java RubyValue.java RubyDebugTarget.java Log Message: inherit from PlatformObject in order to get adapters for the DebugView Index: RubyDebugTarget.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyDebugTarget.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RubyDebugTarget.java 9 Jan 2005 09:25:45 -0000 1.8 --- RubyDebugTarget.java 29 Aug 2005 16:05:48 -0000 1.9 *************** *** 3,6 **** --- 3,7 ---- import org.eclipse.core.resources.IMarkerDelta; import org.eclipse.core.runtime.IStatus; + import org.eclipse.core.runtime.PlatformObject; import org.eclipse.debug.core.DebugEvent; import org.eclipse.debug.core.DebugException; *************** *** 17,22 **** import org.rubypeople.rdt.internal.debug.core.SuspensionPoint; ! public class RubyDebugTarget implements IRubyDebugTarget { private IProcess process; --- 18,27 ---- import org.rubypeople.rdt.internal.debug.core.SuspensionPoint; + // RubyDebugTarget extends PlatformObject in order to benefit from the getAdapter Implementation + // provided there. This is crucial for displaying the RubyDebugTarget in the DebugView when + // the TreeContentManager asks for an IDeferredWorkbenchAdapter or IWorkbenchAdapter + // This kind of Adapter is deliverd from the DebugElementAdapterFactory. ! public class RubyDebugTarget extends PlatformObject implements IRubyDebugTarget { private IProcess process; *************** *** 192,199 **** } - public Object getAdapter(Class arg0) { - return null; - } - public IProcess getProcess() { return process; --- 197,200 ---- Index: RubyVariable.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyVariable.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RubyVariable.java 11 Mar 2005 03:21:16 -0000 1.9 --- RubyVariable.java 29 Aug 2005 16:05:48 -0000 1.10 *************** *** 2,5 **** --- 2,6 ---- import org.eclipse.core.runtime.Platform; + import org.eclipse.core.runtime.PlatformObject; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.ILaunch; *************** *** 8,12 **** import org.eclipse.debug.core.model.IVariable; ! public class RubyVariable implements IVariable { private boolean isStatic; --- 9,14 ---- import org.eclipse.debug.core.model.IVariable; ! //see RubyDebugTarget for the reason why PlatformObject is being extended ! public class RubyVariable extends PlatformObject implements IVariable { private boolean isStatic; *************** *** 121,131 **** } - /** - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) - */ - public Object getAdapter(Class adapter) { - return Platform.getAdapterManager().getAdapter(this, adapter); - } - public String toString() { if (this.isHashValue()) { --- 123,126 ---- Index: RubyStackFrame.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyStackFrame.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RubyStackFrame.java 14 Nov 2004 13:07:22 -0000 1.9 --- RubyStackFrame.java 29 Aug 2005 16:05:48 -0000 1.10 *************** *** 1,4 **** --- 1,5 ---- package org.rubypeople.rdt.internal.debug.core.model; + import org.eclipse.core.runtime.PlatformObject; import org.eclipse.debug.core.DebugEvent; import org.eclipse.debug.core.DebugException; *************** *** 12,16 **** import org.rubypeople.rdt.internal.debug.core.RubyDebuggerProxy; ! public class RubyStackFrame implements IStackFrame { private RubyThread thread; --- 13,18 ---- import org.rubypeople.rdt.internal.debug.core.RubyDebuggerProxy; ! //see RubyDebugTarget for the reason why PlatformObject is being extended ! public class RubyStackFrame extends PlatformObject implements IStackFrame { private RubyThread thread; *************** *** 164,171 **** this.getThread().terminate() ; } - - public Object getAdapter(Class arg0) { - return null; - } public int getIndex() { --- 166,169 ---- Index: RubyValue.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyValue.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RubyValue.java 20 Mar 2004 15:37:09 -0000 1.4 --- RubyValue.java 29 Aug 2005 16:05:48 -0000 1.5 *************** *** 1,4 **** --- 1,5 ---- package org.rubypeople.rdt.internal.debug.core.model; + import org.eclipse.core.runtime.PlatformObject; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.ILaunch; *************** *** 15,19 **** * Window>Preferences>Java>Code Generation. */ ! public class RubyValue implements IValue { private String valueString ; --- 16,23 ---- * Window>Preferences>Java>Code Generation. */ ! ! //see RubyDebugTarget for the reason why PlatformObject is being extended ! ! public class RubyValue extends PlatformObject implements IValue { private String valueString ; *************** *** 96,106 **** return this.getDebugTarget().getLaunch(); } - - /** - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) - */ - public Object getAdapter(Class adapter) { - return null; - } public String toString() { --- 100,103 ---- Index: RubyThread.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyThread.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RubyThread.java 11 Mar 2005 03:21:16 -0000 1.10 --- RubyThread.java 29 Aug 2005 16:05:48 -0000 1.11 *************** *** 1,4 **** --- 1,5 ---- package org.rubypeople.rdt.internal.debug.core.model; + import org.eclipse.core.runtime.PlatformObject; import org.eclipse.debug.core.DebugEvent; import org.eclipse.debug.core.DebugException; *************** *** 12,16 **** import org.rubypeople.rdt.internal.debug.core.SuspensionPoint; ! public class RubyThread implements IThread { private RubyStackFrame[] frames; private IDebugTarget target; --- 13,18 ---- import org.rubypeople.rdt.internal.debug.core.SuspensionPoint; ! // see RubyDebugTarget for the reason why PlatformObject is being extended ! public class RubyThread extends PlatformObject implements IThread { private RubyStackFrame[] frames; private IDebugTarget target; *************** *** 28,32 **** public IStackFrame[] getStackFrames() throws DebugException { ! return frames; } --- 30,39 ---- public IStackFrame[] getStackFrames() throws DebugException { ! // Not all clients ask hasStackFrames before calling this method (DeferredThread) ! // Therefore we must not return null ! if (frames == null) { ! return new RubyStackFrame[0]; ! } ! return frames ; } *************** *** 55,59 **** public IBreakpoint[] getBreakpoints() { ! return null; } --- 62,67 ---- public IBreakpoint[] getBreakpoints() { ! // TODO: Experimental Code ! return new IBreakpoint[] { DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IRubyDebugTarget.MODEL_IDENTIFIER)[0] } ; } *************** *** 159,166 **** } - public Object getAdapter(Class arg0) { - return null; - } - public RubyDebuggerProxy getRubyDebuggerProxy() { return ((RubyDebugTarget) this.getDebugTarget()).getRubyDebuggerProxy(); --- 167,170 ---- Index: RubyExpression.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyExpression.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RubyExpression.java 20 Mar 2004 15:37:09 -0000 1.3 --- RubyExpression.java 29 Aug 2005 16:05:48 -0000 1.4 *************** *** 1,4 **** --- 1,5 ---- package org.rubypeople.rdt.internal.debug.core.model; + import org.eclipse.core.runtime.PlatformObject; import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.model.IDebugTarget; *************** *** 6,10 **** import org.eclipse.debug.core.model.IValue; ! public class RubyExpression implements IExpression { private RubyVariable inspectionResult; --- 7,12 ---- import org.eclipse.debug.core.model.IValue; ! //see RubyDebugTarget for the reason why PlatformObject is being extended ! public class RubyExpression extends PlatformObject implements IExpression { private RubyVariable inspectionResult; *************** *** 40,46 **** } - public Object getAdapter(Class arg0) { - return null; - } - } --- 42,44 ---- |