Patches from user robekras to show the variables view
[phpeclipse.git] / net.sourceforge.phpeclipse.debug.core / src / net / sourceforge / phpdt / internal / debug / core / model / PHPStackFrame.java
index af564eb..b49de4e 100644 (file)
@@ -23,7 +23,7 @@ import org.eclipse.debug.core.model.IStackFrame;
 import org.eclipse.debug.core.model.IThread;
 import org.eclipse.debug.core.model.IVariable;
 
-public class PHPStackFrame implements IStackFrame {
+public class PHPStackFrame extends PHPDebugElement implements IStackFrame {
 
        private PHPThread thread;
        private String file;
@@ -34,36 +34,38 @@ public class PHPStackFrame implements IStackFrame {
        private String description;
 
        public PHPStackFrame(PHPThread thread, String file, int line, int index, String desc, int modno) {
+               super (null);
                this.lineNumber = line;
                this.index = index;
                this.file = file;
                this.thread = thread;
                this.description = desc;
                this.modno = modno;
-       } 
-       
+       }
+
        public PHPStackFrame(PHPThread thread, String file, int line, int index) {
+               super (null);
                this.lineNumber = line;
                this.index = index;
                this.file = file;
                this.thread = thread;
-       } 
-       
+       }
+
        public IThread getThread() {
                return thread;
        }
-       
+
        public void setThread(PHPThread thread) {
                this.thread = thread;
        }
-       
+
        public IVariable[] getVariables() throws DebugException {
                if (variables == null) {
                        variables = this.getPHPDBGProxy().readVariables(this);
                }
                return variables;
        }
-       
+
        public IVariable findVariable(String s) throws DebugException {
                if (this.hasVariables()) {
                        String name="$"+s;
@@ -72,31 +74,31 @@ public class PHPStackFrame implements IStackFrame {
                                if((variables[i].getName()).equals(name))
                                        return variables[i];
                        }
-               }       
+               }
                return null;
        }
-       
+
        public boolean hasVariables() throws DebugException {
                if (variables == null) {
                        return false;
                }
                return variables.length > 0;
        }
-       
+
        public int getLineNumber() {
                return lineNumber;
        }
-       
+
        public int getCharStart() throws DebugException {
                // not supported
                return -1;
        }
-       
+
        public int getCharEnd() throws DebugException {
                // not supported
                return -1;
        }
-       
+
        public String getName() {
                if(!this.getDescription().equals(""))
                        return this.getDescription() + " [line: " + this.getLineNumber() + "]";
@@ -107,7 +109,7 @@ public class PHPStackFrame implements IStackFrame {
        public String getFileName() {
                return file;
        }
-       
+
        public void setDescription(String desc) {
                this.description= desc;
        }
@@ -115,50 +117,50 @@ public class PHPStackFrame implements IStackFrame {
        public String getDescription() {
                return this.description;
        }
-       
+
        public IRegisterGroup[] getRegisterGroups() throws DebugException {
                return null;
        }
-       
+
        public boolean hasRegisterGroups() throws DebugException {
                return false;
        }
-       
+
        public String getModelIdentifier() {
                return this.getThread().getModelIdentifier();
        }
-       
+
        public IDebugTarget getDebugTarget() {
                return this.getThread().getDebugTarget();
        }
-       
+
        public ILaunch getLaunch() {
                return this.getDebugTarget().getLaunch();
        }
-       
+
        public boolean canStepInto() {
                return canResume();
        }
-       
+
        public boolean canStepOver() {
                return canResume();
        }
-       
+
        public boolean canStepReturn() {
                return canResume();
        }
-       
+
        public boolean isStepping() {
                return false;
        }
-       
+
        public void stepInto() throws DebugException {
                thread.prepareForResume() ;
-               this.getPHPDBGProxy().readStepIntoEnd(PHPStackFrame.this) ;             
+               this.getPHPDBGProxy().readStepIntoEnd(PHPStackFrame.this) ;
                DebugEvent ev = new DebugEvent(this.getThread(), DebugEvent.RESUME, DebugEvent.STEP_INTO);
                DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] { ev });
        }
-       
+
        public void stepOver() throws DebugException {
                thread.prepareForResume() ;
                this.getPHPDBGProxy().readStepOverEnd(PHPStackFrame.this) ;
@@ -168,48 +170,41 @@ public class PHPStackFrame implements IStackFrame {
 
        public void stepReturn() throws DebugException {
                thread.prepareForResume() ;
-               this.getPHPDBGProxy().readStepReturnEnd(PHPStackFrame.this) ;                           
+               this.getPHPDBGProxy().readStepReturnEnd(PHPStackFrame.this) ;
                DebugEvent ev = new DebugEvent(this.getThread(), DebugEvent.RESUME, DebugEvent.STEP_RETURN);
-               DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] { ev });            
+               DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] { ev });
        }
 
-       
+
        public boolean canResume() {
                return this.getThread().canResume();
        }
-       
+
        public boolean canSuspend() {
                return this.getThread().canSuspend();
        }
-       
+
        public boolean isSuspended() {
                return this.getThread().isSuspended();
-       } 
-       
+       }
+
        public void resume() throws DebugException {
                this.getThread().resume();
        }
-       
+
        public void suspend() throws DebugException {
        }
-       
+
        public boolean canTerminate() {
                return this.getThread().canTerminate();
        }
-       
+
        public boolean isTerminated() {
                return this.getThread().isTerminated();
-       } 
-       
+       }
+
        public void terminate() throws DebugException {
                getPHPDBGProxy().stop();
-       } 
-       
-       public Object getAdapter(Class arg0) {
-               if (arg0==PHPStackFrame.class)
-                       return this;
-               else
-                       return null;
        }
 
        public int getIndex() {
@@ -225,7 +220,7 @@ public class PHPStackFrame implements IStackFrame {
        public void setFile(String file) {
                this.file = file;
        }
-       
+
        public int getModNo() {
                return modno;
        }