*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse.xdebug.core / src / net / sourceforge / phpeclipse / xdebug / core / XDebugValue.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 XDebugValue  extends XDebugElement implements IValue {
20         
21         private String fValue;
22         
23         public XDebugValue(XDebugTarget target, String value) {
24                 super(target);
25                 fValue = value;
26         }
27         
28         /* (non-Javadoc)
29          * @see org.eclipse.debug.core.model.IValue#getReferenceTypeName()
30          */
31         public String getReferenceTypeName() throws DebugException {
32                 try {
33                         Integer.parseInt(fValue);
34                 } catch (NumberFormatException e) {
35                         return "text";
36                 }
37                 return "integer";
38         }
39         /* (non-Javadoc)
40          * @see org.eclipse.debug.core.model.IValue#getValueString()
41          */
42         public String getValueString() throws DebugException {
43                 return fValue;
44         }
45         /* (non-Javadoc)
46          * @see org.eclipse.debug.core.model.IValue#isAllocated()
47          */
48         public boolean isAllocated() throws DebugException {
49                 return true;
50         }
51         /* (non-Javadoc)
52          * @see org.eclipse.debug.core.model.IValue#getVariables()
53          */
54         public IVariable[] getVariables() throws DebugException {
55                 return new IVariable[0];
56         }
57         /* (non-Javadoc)
58          * @see org.eclipse.debug.core.model.IValue#hasVariables()
59          */
60         public boolean hasVariables() throws DebugException {
61                 return false;
62         }
63 }