blob: 8788f0cd66a1d292b050f7ff3c416f84f3006612 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.debug.internal.ui.model.elements;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.model.IErrorReportingExpression;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.swt.graphics.RGB;
/**
* @since 3.3
*/
public class ExpressionLabelProvider extends VariableLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.VariableLabelProvider#getForeground(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
*/
protected RGB getForeground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
Object element = elementPath.getLastSegment();
if (element instanceof IErrorReportingExpression) {
IErrorReportingExpression expression = (IErrorReportingExpression) element;
if (expression.hasErrors()) {
return new RGB(255, 0, 0);
}
}
return super.getForeground(elementPath, presentationContext, columnId);
}
}