Project

General

Profile

Download (1.19 KB) Statistics
| Branch: | Tag: | Revision:
1
package eu.etaxonomy.cdm.vaadin.util;
2

    
3
import java.util.Set;
4

    
5
import com.vaadin.server.VaadinSession;
6
import com.vaadin.ui.Notification;
7
import com.vaadin.ui.UI;
8

    
9
import eu.etaxonomy.cdm.model.common.TermVocabulary;
10
import eu.etaxonomy.cdm.model.location.NamedArea;
11
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
12

    
13
public class DistributionEditorUtil {
14

    
15
    public static final String SEPARATOR = ";;";
16

    
17
    public static final String SESSION_ABBREVIATED_LABELS = "abbreviatedLabels";
18

    
19
    public static void openDistributionView(TaxonNode taxonNode, TermVocabulary<NamedArea> term, Set<NamedArea> selectedAreas) {
20
		if(taxonNode==null){
21
			Notification.show("Please choose a classification and/or taxon", Notification.Type.HUMANIZED_MESSAGE);
22
			return;
23
		}
24
		if(term==null){
25
			Notification.show("Please choose a distribution area", Notification.Type.HUMANIZED_MESSAGE);
26
			return;
27
		}
28
	    VaadinSession.getCurrent().setAttribute("taxonNodeUUID", taxonNode.getUuid());
29
	    VaadinSession.getCurrent().setAttribute("selectedTerm", term.getUuid());
30
	    VaadinSession.getCurrent().setAttribute("selectedAreas", selectedAreas);
31

    
32
	    //navigate to table view
33
	    UI.getCurrent().getNavigator().navigateTo("table");
34
	}
35

    
36

    
37
}
(8-8/10)