Project

General

Profile

Download (1.83 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.component;
10

    
11
import com.vaadin.data.Property;
12
import com.vaadin.ui.TextField;
13

    
14
import eu.etaxonomy.cdm.vaadin.util.converter.JodaTimePartialConverter;
15

    
16
/**
17
 * The PartialDateField is just a simple TextField by now but will evolve to
18
 * a more user friendly widget with either selectors for year, month, day
19
 * or it will use calendar widget like the DateField which allows selecting only
20
 * the year or year + month.
21
 *
22
 * @author a.kohlbecker
23
 * @since Apr 7, 2017
24
 *
25
 */
26
public class PartialDateField extends TextField {
27

    
28
    JodaTimePartialConverter.DateFormat format = JodaTimePartialConverter.DateFormat.DAY_MONTH_YEAR_DOT;
29

    
30
    /**
31
     *
32
     */
33
    public PartialDateField() {
34
        super();
35
        setConverter(new JodaTimePartialConverter(format));
36
    }
37

    
38
    /**
39
     * @param dataSource
40
     */
41
    public PartialDateField(Property dataSource) {
42
        super(dataSource);
43
        setConverter(new JodaTimePartialConverter(format));
44
    }
45

    
46
    /**
47
     * @param caption
48
     * @param dataSource
49
     */
50
    public PartialDateField(String caption, Property dataSource) {
51
        super(caption, dataSource);
52
        setConverter(new JodaTimePartialConverter(format));
53
    }
54

    
55
    /**
56
     * @param caption
57
     * @param value
58
     */
59
    public PartialDateField(String caption, String value) {
60
        super(caption, value);
61
        setConverter(new JodaTimePartialConverter(format));
62
    }
63

    
64
    /**
65
     * @param caption
66
     */
67
    public PartialDateField(String caption) {
68
        super(caption);
69
        setConverter(new JodaTimePartialConverter(format));
70
    }
71

    
72

    
73

    
74
}
(5-5/7)