*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse.xdebug.core / src / net / sourceforge / phpeclipse / xdebug / core / XDebugVariable.java
1 /*
2  * Created on 23.11.2004
3  *
4  * TODO To change the template for this generated file go to
5  * Window - Preferences - Java - Code Style - Code Templates
6  */
7 package net.sourceforge.phpeclipse.xdebug.core;
8
9 import org.eclipse.debug.core.DebugException;
10 import org.eclipse.debug.core.model.IValue;
11 import org.eclipse.debug.core.model.IVariable;
12
13 /**
14  * @author Axel
15  *
16  * TODO To change the template for this generated type comment go to
17  * Window - Preferences - Java - Code Style - Code Templates
18  */
19 public class XDebugVariable  extends XDebugElement implements IVariable {
20         
21         // name & stack frmae
22         private String fName;
23         private XDebugStackFrame fFrame;
24         
25         /**
26          * Constructs a variable contained in the given stack frame
27          * with the given name.
28          * 
29          * @param frame owning stack frame
30          * @param name variable name
31          */
32         public XDebugVariable(XDebugStackFrame frame, String name) {
33                 super((XDebugTarget) frame.getDebugTarget());
34                 fFrame = frame;
35                 fName = name;
36         }
37         /* (non-Javadoc)
38          * @see org.eclipse.debug.core.model.IVariable#getValue()
39          */
40         public IValue getValue() throws DebugException {
41                 return ((XDebugTarget)getDebugTarget()).getVariableValue(this);
42         }
43         /* (non-Javadoc)
44          * @see org.eclipse.debug.core.model.IVariable#getName()
45          */
46         public String getName() throws DebugException {
47                 return fName;
48         }
49         /* (non-Javadoc)
50          * @see org.eclipse.debug.core.model.IVariable#getReferenceTypeName()
51          */
52         public String getReferenceTypeName() throws DebugException {
53                 // TODO Auto-generated method stub
54                 return "Thing";
55         }
56         /* (non-Javadoc)
57          * @see org.eclipse.debug.core.model.IVariable#hasValueChanged()
58          */
59         public boolean hasValueChanged() throws DebugException {
60                 // TODO Auto-generated method stub
61                 return false;
62         }
63         /* (non-Javadoc)
64          * @see org.eclipse.debug.core.model.IValueModification#setValue(java.lang.String)
65          */
66         public void setValue(String expression) throws DebugException {
67         }
68         /* (non-Javadoc)
69          * @see org.eclipse.debug.core.model.IValueModification#setValue(org.eclipse.debug.core.model.IValue)
70          */
71         public void setValue(IValue value) throws DebugException {
72         }
73         /* (non-Javadoc)
74          * @see org.eclipse.debug.core.model.IValueModification#supportsValueModification()
75          */
76         public boolean supportsValueModification() {
77                 return false;
78         }
79         /* (non-Javadoc)
80          * @see org.eclipse.debug.core.model.IValueModification#verifyValue(java.lang.String)
81          */
82         public boolean verifyValue(String expression) throws DebugException {
83                 return false;
84         }
85         /* (non-Javadoc)
86          * @see org.eclipse.debug.core.model.IValueModification#verifyValue(org.eclipse.debug.core.model.IValue)
87          */
88         public boolean verifyValue(IValue value) throws DebugException {
89                 return false;
90         }
91         
92         /**
93          * Returns the stack frame owning this variable.
94          * 
95          * @return the stack frame owning this variable
96          */
97         protected XDebugStackFrame getStackFrame() {
98                 return fFrame;
99         }
100
101 }