package es.java.otro.view;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.ui.navigator.IDescriptionProvider;
import es.java.otro.model.Entry;
import es.java.otro.model.Feed;
import es.java.otro.model.Root;
public class RssTreeLabelProvider extends LabelProvider implements ILabelProvider, IDescriptionProvider{
@Override
public String getDescription(Object anElement) {
return "hardcoded description";
}
@Override
public String getText(Object element) {
if (element instanceof Feed) {
Feed feed = (Feed) element;
return feed.getName();
} else if (element instanceof Root) {
return "Feeds";
} else if (element instanceof Entry) {
Entry entry = (Entry) element;
return entry.getTitle();
} else
return element.toString();
}
}