Project

General

Profile

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

    
12
import com.vaadin.annotations.AutoGenerated;
13
import com.vaadin.data.Container;
14
import com.vaadin.ui.AbsoluteLayout;
15
import com.vaadin.ui.Button;
16
import com.vaadin.ui.ComboBox;
17
import com.vaadin.ui.CustomComponent;
18
import com.vaadin.ui.Label;
19
import com.vaadin.ui.TwinColSelect;
20
import com.vaadin.ui.Window;
21

    
22
import eu.etaxonomy.cdm.model.common.TermVocabulary;
23
import eu.etaxonomy.cdm.vaadin.container.TaxonNodeContainer;
24
import eu.etaxonomy.cdm.vaadin.presenter.dbstatus.settings.SettingsPresenter;
25

    
26
/**
27
 * @author alex
28
 * @date 22.04.2015
29
 *
30
 */
31
public class SettingsConfigWindow extends CustomComponent {
32

    
33
    /*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */
34

    
35
	private static final long serialVersionUID = -8220442386869594032L;
36
	@AutoGenerated
37
    private AbsoluteLayout mainLayout;
38
    @AutoGenerated
39
    private Label label_4;
40
    @AutoGenerated
41
    private TwinColSelect distStatusSelect;
42
    @AutoGenerated
43
    private Label label_3;
44
    @AutoGenerated
45
    private Label label_2;
46
    @AutoGenerated
47
    private ComboBox distAreaBox;
48
    @AutoGenerated
49
    private ComboBox taxoNodeBox;
50
    @AutoGenerated
51
    private Button okButton;
52
    @AutoGenerated
53
    private Button cancelButton;
54
    @AutoGenerated
55
    private Label label_1;
56
    private final SettingsPresenter presenter;
57
    /**
58
     * The constructor should first build the main layout, set the
59
     * composition root and then do any custom initialization.
60
     *
61
     * The constructor will not be automatically regenerated by the
62
     * visual editor.
63
     */
64
    public SettingsConfigWindow() {
65
        buildMainLayout();
66
//        setCompositionRoot(mainLayout);
67
        presenter = new SettingsPresenter();
68
        init();
69
    }
70

    
71
    private void init() {
72
        Container taxonNodeContainer = new TaxonNodeContainer(null);
73
        Container distributionContainer = presenter.getDistributionContainer();
74
        TermVocabulary chosenArea = presenter.getChosenArea();
75
        taxoNodeBox.setItemCaptionPropertyId(TaxonNodeContainer.LABEL);
76
        taxoNodeBox.setContainerDataSource(taxonNodeContainer);
77
        taxoNodeBox.setValue(presenter.getChosenTaxonNode());
78
        distAreaBox.setContainerDataSource(distributionContainer);
79
        distAreaBox.setValue(chosenArea);
80
        distStatusSelect.setContainerDataSource(presenter.getDistributionStatusContainer());
81
    }
82

    
83
    public Window createWindow(){
84
        Window window = new Window();
85
        window.setModal(true);
86
        window.setHeight("600px");
87
        window.setWidth("500px");
88
        window.setCaption("Settings");
89
        window.setContent(mainLayout);
90
        return window;
91
    }
92

    
93
    @AutoGenerated
94
    private AbsoluteLayout buildMainLayout() {
95
        // common part: create layout
96
        mainLayout = new AbsoluteLayout();
97
        mainLayout.setImmediate(false);
98
        mainLayout.setWidth("100%");
99
        mainLayout.setHeight("100%");
100

    
101
        // top-level component properties
102
        setWidth("100.0%");
103
        setHeight("100.0%");
104

    
105
        // label_1
106
        label_1 = new Label();
107
        label_1.setImmediate(false);
108
        label_1.setWidth("100.0%");
109
        label_1.setHeight("40px");
110
        mainLayout.addComponent(label_1, "top:0.0px;left:0.0px;");
111

    
112
        // cancelButton
113
        cancelButton = new Button();
114
        cancelButton.setCaption("Cancel");
115
        cancelButton.setImmediate(true);
116
        cancelButton.setWidth("-1px");
117
        cancelButton.setHeight("-1px");
118
        mainLayout.addComponent(cancelButton, "top:380.0px;left:273.0px;");
119

    
120
        // okButton
121
        okButton = new Button();
122
        okButton.setCaption("OK");
123
        okButton.setImmediate(true);
124
        okButton.setWidth("67px");
125
        okButton.setHeight("-1px");
126
        mainLayout.addComponent(okButton, "top:380.0px;left:364.0px;");
127

    
128
        // classificationBox
129
        taxoNodeBox = new ComboBox();
130
        taxoNodeBox.setImmediate(false);
131
        taxoNodeBox.setWidth("-1px");
132
        taxoNodeBox.setHeight("-1px");
133
        mainLayout.addComponent(taxoNodeBox, "top:97.0px;left:258.0px;");
134

    
135
        // distAreaBox
136
        distAreaBox = new ComboBox();
137
        distAreaBox.setImmediate(false);
138
        distAreaBox.setWidth("-1px");
139
        distAreaBox.setHeight("-1px");
140
        mainLayout.addComponent(distAreaBox, "top:141.0px;left:258.0px;");
141

    
142
        // label_2
143
        label_2 = new Label();
144
        label_2.setImmediate(false);
145
        label_2.setWidth("-1px");
146
        label_2.setHeight("-1px");
147
        label_2.setValue("Classification/Taxon: ");
148
        mainLayout.addComponent(label_2, "top:97.0px;left:24.0px;");
149

    
150
        // label_3
151
        label_3 = new Label();
152
        label_3.setImmediate(false);
153
        label_3.setWidth("-1px");
154
        label_3.setHeight("-1px");
155
        label_3.setValue("Distribution Area:");
156
        mainLayout.addComponent(label_3, "top:141.0px;left:24.0px;");
157

    
158
        // distStatusSelect
159
        distStatusSelect = new TwinColSelect();
160
        distStatusSelect.setImmediate(false);
161
        distStatusSelect.setWidth("-1px");
162
        distStatusSelect.setHeight("-1px");
163
        mainLayout.addComponent(distStatusSelect, "top:188.0px;left:152.0px;");
164

    
165
        // label_4
166
        label_4 = new Label();
167
        label_4.setImmediate(false);
168
        label_4.setWidth("-1px");
169
        label_4.setHeight("-1px");
170
        label_4.setValue("Distribution Status:");
171
        mainLayout.addComponent(label_4, "top:202.0px;left:20.0px;");
172

    
173
        return mainLayout;
174
    }
175

    
176
}
(5-5/5)