Revision 785fc5d7
Added by Patrick Plitzner over 7 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/util/DistributionEditorUtil.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.util.Set; |
4 | 4 |
|
5 |
import org.apache.commons.lang.StringUtils; |
|
6 |
|
|
7 | 5 |
import com.vaadin.server.VaadinSession; |
8 | 6 |
import com.vaadin.ui.Notification; |
9 | 7 |
import com.vaadin.ui.UI; |
10 | 8 |
|
11 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
|
12 | 9 |
import eu.etaxonomy.cdm.model.common.TermVocabulary; |
13 | 10 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
14 | 11 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
15 | 12 |
|
16 | 13 |
public class DistributionEditorUtil { |
17 | 14 |
|
18 |
public static void openDistributionView(TaxonNode taxonNode, TermVocabulary<DefinedTermBase> term, Set<NamedArea> selectedAreas) { |
|
15 |
public static final String SEPARATOR = ";;"; |
|
16 |
|
|
17 |
public static void openDistributionView(TaxonNode taxonNode, TermVocabulary<NamedArea> term, Set<NamedArea> selectedAreas) { |
|
19 | 18 |
if(taxonNode==null){ |
20 | 19 |
Notification.show("Please choose a classification and/or taxon", Notification.Type.HUMANIZED_MESSAGE); |
21 | 20 |
return; |
... | ... | |
26 | 25 |
} |
27 | 26 |
VaadinSession.getCurrent().setAttribute("taxonNodeUUID", taxonNode.getUuid()); |
28 | 27 |
VaadinSession.getCurrent().setAttribute("selectedTerm", term.getUuid()); |
29 |
String selectedAreaUuids = ""; |
|
30 |
for (NamedArea namedArea : selectedAreas) { |
|
31 |
selectedAreaUuids += namedArea.getTitleCache()+",";
|
|
32 |
} |
|
33 |
selectedAreaUuids = StringUtils.stripEnd(selectedAreaUuids, ",");
|
|
34 |
VaadinSession.getCurrent().setAttribute("selectedAreas", selectedAreaUuids);
|
|
28 |
// String selectedAreaUuids = "";
|
|
29 |
// for (NamedArea namedArea : selectedAreas) {
|
|
30 |
// selectedAreaUuids += namedArea.getTitleCache()+SEPARATOR;
|
|
31 |
// }
|
|
32 |
// selectedAreaUuids = StringUtils.stripEnd(selectedAreaUuids, SEPARATOR);
|
|
33 |
VaadinSession.getCurrent().setAttribute("selectedAreas", selectedAreas); |
|
35 | 34 |
|
36 | 35 |
//navigate to table view |
37 | 36 |
UI.getCurrent().getNavigator().navigateTo("table"); |
Also available in: Unified diff
ref #5458 Add abbreviated labels to distribution table