-// $Id$
/**
* Copyright (C) 2017 EDIT
* European Distributed Institute of Taxonomy
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
/**
* @author pplitzner
* @date 05.09.2017
- *
*/
-public class TaxonTreeNodeLabelProvider extends ColumnLabelProvider
-implements IStyledLabelProvider {
+public class TaxonTreeNodeLabelProvider
+ extends ColumnLabelProvider
+ implements IStyledLabelProvider {
protected Styler notGrantedStyler = null;
- /**
- * {@inheritDoc}
- */
@Override
public String getText(Object element) {
//classification
if(element instanceof Classification){
String text = ((Classification) element).getName().getText();
- return text != null ? text : "Unnamed Taxonomic Tree";
+ return text != null ? text : "Unnamed Classification";
}
//taxon node
else if (element instanceof TaxonNode){
}else{
try{
String text = "";
- if (taxonNode.getStatus() != null){
- text += taxonNode.getStatus().getSymbol() + " ";
- }
- text += taxon.getName() != null ? ((IIdentifiableEntity) HibernateProxyHelper.deproxy(taxon.getName())).getTitleCache() : new String();
+ if (taxonNode.getStatus() != null){
+ text = taxonNode.getStatus().getSymbol() + " ";
+ }
+ if (taxonNode.getTaxon() != null && !taxonNode.getTaxon().isPublish()) {
+ text = text + "\\u20ac";
+ }
+ text += taxon.getName() != null ? taxon.getName().getTitleCache() : "";
return text;
}catch(Exception e){
MessagingUtils.error(getClass(), e);
else if (element instanceof TaxonNodeDto){
TaxonNodeDto taxonNode = (TaxonNodeDto) element;
String text= "";
- if (taxonNode.isUnplaced()){
- text += Character.toString((char)63) + Character.toString((char)63) + " ";
- }
- if (taxonNode.isExcluded()) {
- text +=Character.toString((char)248) + " ";
+ if (taxonNode.getStatus() != null){
+ text = taxonNode.getStatus().getSymbol() + " ";
}
- if (taxonNode.isDoubtful()) {
- text +=Character.toString((char)63) + " ";
+ if (!taxonNode.isPublish() ) {
+ text = text + "\u26D4 ";
}
+ //TODO if symbols contain non-ASCII this may create problems
+ // if so we may use ASCII like text +=Character.toString((char)248) + " ";
+
text += taxonNode.getTitleCache();
return text;
}
return new String();
}
- /**
- * {@inheritDoc}
- */
@Override
public StyledString getStyledText(Object element) {
//classification
}
return notGrantedStyler;
}
-}
+
+}
\ No newline at end of file