Project

General

Profile

« Previous | Next » 

Revision c872869c

Added by Patrick Plitzner over 5 years ago

ref #7923 Set character representation during creation

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/CharacterTransfer.java
23 23
import org.eclipse.swt.dnd.TransferData;
24 24

  
25 25
import eu.etaxonomy.cdm.api.service.IFeatureNodeService;
26
import eu.etaxonomy.cdm.model.common.Representation;
26 27
import eu.etaxonomy.cdm.model.description.Character;
27 28
import eu.etaxonomy.cdm.model.description.FeatureNode;
29
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
28 30
import eu.etaxonomy.taxeditor.store.CdmStore;
29 31

  
30 32
/**
......
100 102
                        IFeatureNodeService featureNodeService = CdmStore.getService(IFeatureNodeService.class);
101 103
                        FeatureNode structure = featureNodeService.load(UUID.fromString(split[0]));
102 104
                        FeatureNode property = featureNodeService.load(UUID.fromString(split[1]));
103
                        characters.add(Character.NewInstance(structure, property));
105
                        Representation structureRepresentation = structure.getFeature().getRepresentation(PreferencesUtil.getGlobalLanguage());
106
                        Representation propertyRepresentation = property.getFeature().getRepresentation(PreferencesUtil.getGlobalLanguage());
107
                        String label = null;
108
                        String abbrevLabel = null;
109
                        if(structureRepresentation.getLabel()!=null && propertyRepresentation.getLabel()!=null){
110
                            label = structureRepresentation.getLabel()+" "+propertyRepresentation.getLabel();
111
                        }
112
                        if(structureRepresentation.getAbbreviatedLabel()!=null && propertyRepresentation.getAbbreviatedLabel()!=null){
113
                            abbrevLabel = structureRepresentation.getAbbreviatedLabel()+" "+propertyRepresentation.getAbbreviatedLabel();
114
                        }
115
                        characters.add(Character.NewInstance(structure, property, null, label, abbrevLabel));
104 116
                    }
105 117
                }catch(EOFException e){
106 118
                    return characters.toArray();

Also available in: Unified diff