Project

General

Profile

Download (2.84 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.view.phycobank;
10

    
11
import java.util.UUID;
12

    
13
import org.springframework.beans.factory.annotation.Autowired;
14

    
15
import com.vaadin.navigator.View;
16
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
17
import com.vaadin.spring.annotation.SpringView;
18
import com.vaadin.ui.Button;
19
import com.vaadin.ui.CssLayout;
20
import com.vaadin.ui.Label;
21

    
22
import eu.etaxonomy.cdm.vaadin.component.phycobank.RegistrationWorkflowComponent;
23
import eu.etaxonomy.cdm.vaadin.presenter.phycobank.RegistrationType;
24
import eu.etaxonomy.cdm.vaadin.presenter.phycobank.RegistrationWorkflowPresenter;
25
import eu.etaxonomy.vaadin.mvp.AbstractView;
26

    
27
/**
28
 * @author a.kohlbecker
29
 * @since Mar 2, 2017
30
 *
31
 */
32
@SpringView(name=RegistrationWorkflowViewBean.NAME)
33
public class RegistrationWorkflowViewBean extends AbstractView<RegistrationWorkflowPresenter>
34
    implements RegistrationWorkflowView, View {
35

    
36
    private static final long serialVersionUID = -213040114015958970L;
37

    
38
    public static final String NAME = "workflow";
39

    
40
    public RegistrationType regType = null;
41

    
42
    RegistrationWorkflowComponent design;
43

    
44
    public RegistrationWorkflowViewBean() {
45
        design = new RegistrationWorkflowComponent();
46
        setCompositionRoot(design);
47
    }
48

    
49
    /**
50
     * {@inheritDoc}
51
     */
52
    @Override
53
    public void enter(ViewChangeEvent event) {
54
        if(event.getParameters() != null){
55
           String[] params = event.getParameters().split("/");
56
           if(params.length > 0){
57
               regType = RegistrationType.valueOf(params[0]);
58
               design.getTitle().setValue(design.getTitle().getValue() + "  " + regType.name() + " ...");
59
           }
60
        }
61

    
62
    }
63

    
64
    /**
65
     * {@inheritDoc}
66
     */
67
    @Autowired
68
    @Override
69
    protected void injectPresenter(RegistrationWorkflowPresenter presenter) {
70
        setPresenter(presenter);
71
    }
72

    
73
    /* ------- RegistrationWorkflowView implementation ------- */
74

    
75
    /**
76
     * @return the title
77
     */
78
    @Override
79
    public Label getTitle() {
80
        return design.getTitle();
81
    }
82

    
83
    /**
84
     * @return the workflow
85
     */
86
    @Override
87
    public CssLayout getWorkflow() {
88
        return design.getWorkflow();
89
    }
90

    
91
    /**
92
     * @return the stepIndex
93
     */
94
    @Override
95
    public Button getStepIndex() {
96
        return design.getStepIndex();
97
    }
98

    
99
    /**
100
     * @return the caption
101
     */
102

    
103
    @Override
104
    public Label getCaptionLabel() {
105
        return design.getCaptionLabel();
106
    }
107

    
108
    /**
109
     * {@inheritDoc}
110
     */
111
    @Override
112
    public void openNameEditor(UUID nameUuid) {
113
        // TODO Auto-generated method stub
114

    
115
    }
116
}
(4-4/7)