1 11 package org.eclipse.jdt.internal.debug.core.logicalstructures; 12 13 import org.eclipse.debug.core.DebugException; 14 import org.eclipse.debug.core.ILaunch; 15 import org.eclipse.debug.core.model.IDebugTarget; 16 import org.eclipse.debug.core.model.IVariable; 17 import org.eclipse.jdt.debug.core.IJavaType; 18 import org.eclipse.jdt.debug.core.IJavaValue; 19 import org.eclipse.jdt.debug.core.JDIDebugModel; 20 21 24 public class JavaStructureErrorValue implements IJavaValue { 25 26 private String [] fMessages; 27 private IJavaValue fValue; 28 29 public JavaStructureErrorValue(String errorMessage, IJavaValue value) { 30 fMessages= new String [] { errorMessage }; 31 fValue= value; 32 } 33 34 public JavaStructureErrorValue(String [] errorMessages, IJavaValue value) { 35 fMessages= errorMessages; 36 fValue= value; 37 } 38 39 44 public IJavaValue getParentValue() { 45 return fValue; 46 } 47 48 51 public String getSignature() throws DebugException { 52 return null; 53 } 54 55 58 public String getGenericSignature() throws DebugException { 59 return null; 60 } 61 62 65 public IJavaType getJavaType() throws DebugException { 66 return null; 67 } 68 69 72 public String getReferenceTypeName() throws DebugException { 73 return ""; } 75 76 79 public String getValueString() throws DebugException { 80 return fMessages[0]; 81 } 82 83 86 public boolean isAllocated() throws DebugException { 87 return false; 88 } 89 90 93 public IVariable[] getVariables() throws DebugException { 94 IVariable[] variables= new IVariable[fMessages.length]; 95 for (int i = 0; i < variables.length; i++) { 96 StringBuffer varName= new StringBuffer (); 97 if (variables.length > 1) { 98 varName.append(LogicalStructuresMessages.JavaStructureErrorValue_0).append('[').append(i).append(']'); 99 } else { 100 varName.append(LogicalStructuresMessages.JavaStructureErrorValue_1); 101 } 102 variables[i]= new JDIPlaceholderVariable(varName.toString(), new JavaStructureErrorValue(fMessages[i], fValue)); 103 } 104 return variables; 105 } 106 107 110 public boolean hasVariables() throws DebugException { 111 return false; 112 } 113 114 117 public String getModelIdentifier() { 118 return JDIDebugModel.getPluginIdentifier(); 119 } 120 121 124 public IDebugTarget getDebugTarget() { 125 return fValue.getDebugTarget(); 126 } 127 128 131 public ILaunch getLaunch() { 132 return getDebugTarget().getLaunch(); 133 } 134 135 138 public Object getAdapter(Class adapter) { 139 return null; 140 } 141 142 } 143 | Popular Tags |