1 11 package org.eclipse.debug.internal.ui.elements.adapters; 12 13 import org.eclipse.debug.core.DebugException; 14 import org.eclipse.debug.core.model.IErrorReportingExpression; 15 import org.eclipse.debug.core.model.IExpression; 16 import org.eclipse.debug.core.model.IValue; 17 18 public class DeferredExpression extends DeferredVariable { 19 20 23 public Object [] getChildren(Object parent) { 24 if (parent instanceof IErrorReportingExpression) { 25 IErrorReportingExpression expression= (IErrorReportingExpression) parent; 26 if (expression.hasErrors()) { 27 return expression.getErrorMessages(); 28 } 29 } 30 if (parent instanceof IExpression) { 31 IExpression expression = (IExpression)parent; 32 IValue value = expression.getValue(); 33 try { 34 return getValueChildren(expression, value); 35 } catch (DebugException e) { 36 } 37 } 38 return super.getChildren(parent); 39 } 40 41 protected boolean hasChildren(Object child) { 42 if (child instanceof IErrorReportingExpression) { 43 IErrorReportingExpression expression = (IErrorReportingExpression) child; 44 if (expression.hasErrors()) { 45 return true; 46 } 47 } 48 49 if (child instanceof IExpression) { 50 IExpression expression = (IExpression) child; 51 IValue value = expression.getValue(); 52 if (value != null) { 53 try { 54 return value.hasVariables(); 55 } catch (DebugException e) { 56 } 57 } 58 } 59 60 return super.hasChildren(child); 61 } 62 63 64 65 } 66 | Popular Tags |