Project

General

Profile

Download (1.69 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.cdm.vaadin.ui.config;
10

    
11
import eu.etaxonomy.cdm.vaadin.view.name.TaxonNamePopupEditorMode;
12
import eu.etaxonomy.cdm.vaadin.view.name.TaxonNamePopupEditorView;
13

    
14
/**
15
 * @author a.kohlbecker
16
 * @since Sep 25, 2018
17
 *
18
 */
19
public class TaxonNamePopupEditorConfig {
20

    
21
    /**
22
     * Configures the TaxonNamePopupEditorView for nomenclatural act editing.
23
     *
24
     * TODO consider putting this into a Configurer Bean per UIScope.
25
     * In the configurator bean this methods popup parameter should be of the type
26
     * AbstractPopupEditor
27
     *
28
     * @param popup
29
     */
30
    public static void configureForNomenclaturalAct(TaxonNamePopupEditorView popup) {
31
        popup.enableMode(TaxonNamePopupEditorMode.AUTOFILL_AUTHORSHIP_DATA);
32
        popup.enableMode(TaxonNamePopupEditorMode.NOMENCLATURALREFERENCE_SECTION_EDITING_ONLY);
33
        popup.enableMode(TaxonNamePopupEditorMode.VALIDATE_AGAINST_HIGHER_NAME_PART);
34
        popup.enableMode(TaxonNamePopupEditorMode.REQUIRE_NOMENCLATURALREFERENCE);
35
    }
36

    
37
    /**
38
     * Configures the TaxonNamePopupEditorView for general purpose editing.
39
     *
40
     * @param popup
41
     */
42
    public static void configure(TaxonNamePopupEditorView popup) {
43
        popup.enableMode(TaxonNamePopupEditorMode.AUTOFILL_AUTHORSHIP_DATA);
44
        popup.enableMode(TaxonNamePopupEditorMode.VALIDATE_AGAINST_HIGHER_NAME_PART);
45
        popup.enableMode(TaxonNamePopupEditorMode.REQUIRE_NOMENCLATURALREFERENCE);
46
    }
47

    
48
}
    (1-1/1)