Project

General

Profile

Download (3.05 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2017 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.editor.reference;
10

    
11
import org.springframework.beans.factory.annotation.Autowired;
12
import org.springframework.context.annotation.Scope;
13

    
14
import com.vaadin.spring.annotation.SpringComponent;
15
import com.vaadin.ui.GridLayout;
16
import com.vaadin.ui.TextField;
17

    
18
import eu.etaxonomy.cdm.model.reference.Reference;
19
import eu.etaxonomy.vaadin.mvp.AbstractPopupEditor;
20

    
21
/**
22
 * @author a.kohlbecker
23
 * @since Apr 4, 2017
24
 *
25
 */
26

    
27
@SpringComponent
28
@Scope("prototype")
29
public class ReferencePopupEditor extends AbstractPopupEditor<Reference, ReferenceEditorPresenter> implements ReferencePopupEditorView {
30

    
31
    private static final long serialVersionUID = -4347633563800758815L;
32

    
33
    private TextField titleField;
34

    
35
    /**
36
     * @param layout
37
     * @param dtoType
38
     */
39
    public ReferencePopupEditor() {
40
        super(new GridLayout(), Reference.class);
41
        /*
42
        "type",
43
        "uri",
44
        "abbrevTitleCache",
45
        "protectedAbbrevTitleCache",
46
        "nomenclaturallyRelevant",
47
        "authorship",
48
        "referenceAbstract",
49
        "title",
50
        "abbrevTitle",
51
        "editor",
52
        "volume",
53
        "pages",
54
        "edition",
55
        "isbn",
56
        "issn",
57
        "doi",
58
        "seriesPart",
59
        "datePublished",
60
        "publisher",
61
        "placePublished",
62
        "institution",
63
        "school",
64
        "organization",
65
        "inReference"
66
         */
67
        addTextField("Reference cache", "titleCache");
68
        addTextField("Abbrev. cache", "abbrevTitleCache");
69
        titleField = addTextField("Title", "title");
70
        titleField.setRequired(true);
71
        addTextField("NomenclaturalTitle", "abbrevTitle");
72
        // addTextField("Author(s)", "authorship").setRequired(true);
73
        addTextField("Editor", "editor");
74
        addTextField("Series", "seriesPart");
75
        addTextField("Volume", "volume");
76
        addTextField("Pages", "pages");
77
        addTextField("Place published", "placePublished");
78
        addTextField("Publisher", "publisher").setRequired(true);
79
        // TODO implement a TimePeriod component addDateField("DatePublished", "datePublished") // .setConverter(new JodaDateTimeConverter());
80
        addTextField("ISSN", "issn");
81
        addTextField("ISBN", "isbn");
82
        addTextField("DOI", "doi");
83

    
84
    }
85

    
86
    /**
87
     * {@inheritDoc}
88
     */
89
    @Override
90
    public String getWindowCaption() {
91
        return "Reference editor";
92
    }
93

    
94
    /**
95
     * {@inheritDoc}
96
     */
97
    @Override
98
    public void focusFirst() {
99
        titleField.focus();
100
    }
101

    
102
    /**
103
     * {@inheritDoc}
104
     */
105
    @Override
106
    public boolean isResizable() {
107
        return true;
108
    }
109

    
110
    /**
111
     * {@inheritDoc}
112
     */
113
    @Autowired
114
    @Override
115
    protected void injectPresenter(ReferenceEditorPresenter presenter) {
116
        setPresenter(presenter);
117
    }
118

    
119

    
120

    
121
}
(2-2/3)