1 11 package org.eclipse.debug.internal.ui.model.elements; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.debug.core.model.IErrorReportingExpression; 15 import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; 16 import org.eclipse.jface.viewers.TreePath; 17 import org.eclipse.swt.graphics.RGB; 18 19 22 public class ExpressionLabelProvider extends VariableLabelProvider { 23 24 27 protected RGB getForeground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException { 28 Object element = elementPath.getLastSegment(); 29 if (element instanceof IErrorReportingExpression) { 30 IErrorReportingExpression expression = (IErrorReportingExpression) element; 31 if (expression.hasErrors()) { 32 return new RGB(255, 0, 0); 33 } 34 } 35 return super.getForeground(elementPath, presentationContext, columnId); 36 } 37 38 } 39 | Popular Tags |