import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.swt.graphics.Image;
+import eu.etaxonomy.cdm.model.description.DescriptionBase;
+import eu.etaxonomy.cdm.model.description.DescriptionType;
+import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.MatrixUtility;
import eu.etaxonomy.taxeditor.model.DescriptionHelper;
/**
public class DescriptiveLabelProvider extends ColumnLabelProvider implements IStyledLabelProvider {
private static final String TRUNCATE_SIGN = "..."; //$NON-NLS-1$
- private static final int MAX_LENGTH = 60;
+ private static final int MAX_LENGTH = 150;
@Override
public String getText(Object element) {
public StyledString getStyledText(Object element) {
return new StyledString(getText(element), StyledString.QUALIFIER_STYLER);
}
+
+ @Override
+ public Image getImage(Object element) {
+ if(element instanceof DescriptionBase){
+ DescriptionBase description = (DescriptionBase)element;
+ if(description.getTypes().contains(DescriptionType.AGGREGATED_STRUC_DESC)){
+ return MatrixUtility.getAggregatedDescriptionIcon();
+ }
+ else if(description.getTypes().contains(DescriptionType.SECONDARY_DATA)){
+ return MatrixUtility.getLiteratureDescriptionIcon();
+ }
+ else if(description.getTypes().contains(DescriptionType.DEFAULT_VALUES_FOR_AGGREGATION)){
+ return MatrixUtility.getDefaultDescriptionIcon();
+ }
+ }
+ return null;
+ }
}