Project

General

Profile

Revision 45e3e635

ID45e3e6351c764c3055344db6aba5f80e30f3a328
Parent 51e61d88
Child b3a39647

Added by Patrick Plitzner over 2 years ago

fix #6318 Truncate TextData in FactualData View

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveLabelProvider.java
15 15
import eu.etaxonomy.taxeditor.model.DescriptionHelper;
16 16

  
17 17
/**
18
 * <p>DescriptiveLabelProvider class.</p>
19
 *
20 18
 * @author p.ciardelli
21 19
 * @version $Id: $
22 20
 */
23 21
public class DescriptiveLabelProvider extends ColumnLabelProvider implements IStyledLabelProvider  {
24 22

  
25
	/** {@inheritDoc} */
23
    private static final String TRUNCATE_SIGN = "...";
24
    private static final int MAX_LENGTH = 60;
25

  
26 26
	@Override
27 27
    public String getText(Object element) {
28
		return DescriptionHelper.getLabel(element);
28
		String text = DescriptionHelper.getLabel(element);
29
		if(text.length()>MAX_LENGTH){
30
		    text = text.substring(0, MAX_LENGTH)+TRUNCATE_SIGN;
31
		}
32
        return text;
29 33
	}
30 34

  
31
	/* (non-Javadoc)
32
	 * @see org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider#getStyledText(java.lang.Object)
33
	 */
34
	/** {@inheritDoc} */
35 35
	@Override
36 36
    public StyledString getStyledText(Object element) {
37 37
		return new StyledString(getText(element), StyledString.QUALIFIER_STYLER);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)