Project

General

Profile

« Previous | Next » 

Revision 3f6f86d5

Added by Patrick Plitzner over 7 years ago

ref #5458 Replace term dropdown with popup window for performance

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/presenter/dbstatus/DistributionTablePresenter.java
12 12
import java.util.UUID;
13 13

  
14 14
import com.vaadin.server.VaadinSession;
15
import com.vaadin.ui.Notification;
15 16

  
16 17
import eu.etaxonomy.cdm.api.service.IClassificationService;
17 18
import eu.etaxonomy.cdm.api.service.IDescriptionService;
......
64 65
	    Set<DefinedTermBase> chosenTerms = getChosenTerms();
65 66
	    NamedArea namedArea = null;
66 67
	    for(DefinedTermBase term:chosenTerms){
67
	        if(term.getRepresentation(Language.DEFAULT()).getAbbreviatedLabel().equalsIgnoreCase(distributionAreaString)){
68
	            namedArea = (NamedArea) term;
69
	            break;
70
	        }
68
	    	Representation representation = term.getRepresentation(Language.DEFAULT());
69
	    	if(representation!=null){
70
	    		if(DistributionEditorUtil.isAbbreviatedLabels()){
71
	    			String label = representation.getLabel();
72
	    			String abbreviatedLabel = representation.getAbbreviatedLabel();
73
					if(abbreviatedLabel!=null && abbreviatedLabel.equalsIgnoreCase(distributionAreaString)){
74
	    				namedArea = (NamedArea) term;
75
	    				break;
76
	    			}
77
					else if(label!=null && label.equalsIgnoreCase(distributionAreaString)){
78
						namedArea = (NamedArea) term;
79
						break;
80
					}
81
	    		}
82
	    	}
71 83
	        if(term.getTitleCache().equalsIgnoreCase(distributionAreaString)){
72 84
	        	namedArea = (NamedArea) term;
73 85
	        	break;
74 86
	        }
75 87
	    }
88
	    if(namedArea==null){
89
	    	Notification.show("Error during update of distribution term!");
90
	    	return -1;
91
	    }
76 92
	    List<Distribution> distributions = getDistributions(taxon);
77 93
	    Distribution distribution = null;
78 94
	    for(Distribution dist : distributions){

Also available in: Unified diff