package es.java.otro.view;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.StyledCellLabelProvider;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.swt.graphics.Image;
import es.java.otro.model.Entry;
public class EntryTableLableProvider implements
ITableLabelProvider{
private static final int COLUMN_TITLE = 1;
private static final int COLUMN_PUBLISHED = 2;
private static final int COLUMN_AUTHOR = 3;
public String getColumnText(Object element, int columnIndex) {
String ret = null;
if (element instanceof Entry) {
Entry entry = (Entry) element;
switch (columnIndex) {
case COLUMN_TITLE:
ret = entry.getTitle();
break;
case COLUMN_PUBLISHED:
ret = (entry.getPublishDate() == null) ? "" : entry.getPublishDate().toString();
case COLUMN_AUTHOR:
ret = entry.getAuthor();
default:
break;
}
}
return ret;
}
@Override
public void addListener(ILabelProviderListener listener) {
// TODO Auto-generated method stub
}
@Override
public void dispose() {
// TODO Auto-generated method stub
}
@Override
public boolean isLabelProperty(Object element, String property) {
// TODO Auto-generated method stub
return false;
}
@Override
public void removeListener(ILabelProviderListener listener) {
// TODO Auto-generated method stub
}
@Override
public Image getColumnImage(Object element, int columnIndex) {
// TODO Auto-generated method stub
return null;
}
}