blob: 0eb533527f12e5ed950abba0702da52d45d733e0 [file] [log] [blame]
/**********************************************************************
* Copyright (c) 2002 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
package org.eclipse.ant.internal.ui;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.swt.graphics.Image;
/**
* Label provider for the tree viewer of the Ant Console.
*/
public class AntTreeLabelProvider implements ILabelProvider {
private AntConsole console;
public AntTreeLabelProvider(AntConsole console) {
this.console = console;
}
/**
* @see ILabelProvider#getImage(Object)
*/
public Image getImage(Object element) {
return null;
}
/**
* @see ILabelProvider#getText(Object)
*/
public String getText(Object element) {
String text = ((OutputStructureElement) element).getName();
if ( text == null)
// this can happen if the userwrites a task name that doesn't exist => the #taskStarted will be triggered
// but null will be given as a name to the current task, and then only, the exception will be raised
return Policy.bind("antTreeLabelProvider.invalidTaskName");
return text;
}
/**
* @see IBaseLabelProvider#addListener(ILabelProviderListener)
*/
public void addListener(ILabelProviderListener listener) {
}
/**
* @see IBaseLabelProvider#dispose()
*/
public void dispose() {
}
/**
* @see IBaseLabelProvider#isLabelProperty(Object, String)
*/
public boolean isLabelProperty(Object arg0, String arg1) {
return false;
}
/**
* @see IBaseLabelProvider#removeListener(ILabelProviderListener)
*/
public void removeListener(ILabelProviderListener listener) {
}
}