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 org.springframework.beans.factory.annotation.Autowired;
|
12
|
|
13
|
import com.vaadin.navigator.View;
|
14
|
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
|
15
|
import com.vaadin.spring.annotation.SpringView;
|
16
|
import com.vaadin.ui.Button;
|
17
|
import com.vaadin.ui.CssLayout;
|
18
|
import com.vaadin.ui.Label;
|
19
|
|
20
|
import eu.etaxonomy.cdm.vaadin.component.phycobank.RegistrationWorkflowComponent;
|
21
|
import eu.etaxonomy.cdm.vaadin.presenter.phycobank.RegistrationType;
|
22
|
import eu.etaxonomy.cdm.vaadin.presenter.phycobank.RegistrationWorkflowPresenter;
|
23
|
import eu.etaxonomy.vaadin.mvp.AbstractView;
|
24
|
|
25
|
/**
|
26
|
* @author a.kohlbecker
|
27
|
* @since Mar 2, 2017
|
28
|
*
|
29
|
*/
|
30
|
@SpringView(name=RegistrationWorkflowViewBean.NAME)
|
31
|
public class RegistrationWorkflowViewBean extends AbstractView<RegistrationWorkflowPresenter>
|
32
|
implements RegistrationWorkflowView, View {
|
33
|
|
34
|
private static final long serialVersionUID = -213040114015958970L;
|
35
|
|
36
|
public static final String NAME = "workflow";
|
37
|
|
38
|
public RegistrationType regType = null;
|
39
|
|
40
|
RegistrationWorkflowComponent design;
|
41
|
|
42
|
public RegistrationWorkflowViewBean() {
|
43
|
design = new RegistrationWorkflowComponent();
|
44
|
setCompositionRoot(design);
|
45
|
}
|
46
|
|
47
|
/**
|
48
|
* {@inheritDoc}
|
49
|
*/
|
50
|
@Override
|
51
|
public void enter(ViewChangeEvent event) {
|
52
|
if(event.getParameters() != null){
|
53
|
String[] params = event.getParameters().split("/");
|
54
|
if(params.length > 0){
|
55
|
regType = RegistrationType.valueOf(params[0]);
|
56
|
design.getTitle().setValue(design.getTitle().getValue() + " " + regType.name() + " ...");
|
57
|
}
|
58
|
}
|
59
|
|
60
|
}
|
61
|
|
62
|
/**
|
63
|
* {@inheritDoc}
|
64
|
*/
|
65
|
@Autowired
|
66
|
@Override
|
67
|
protected void injectPresenter(RegistrationWorkflowPresenter presenter) {
|
68
|
setPresenter(presenter);
|
69
|
}
|
70
|
|
71
|
/* ------- RegistrationWorkflowView implementation ------- */
|
72
|
|
73
|
/**
|
74
|
* @return the title
|
75
|
*/
|
76
|
@Override
|
77
|
public Label getTitle() {
|
78
|
return design.getTitle();
|
79
|
}
|
80
|
|
81
|
/**
|
82
|
* @return the workflow
|
83
|
*/
|
84
|
@Override
|
85
|
public CssLayout getWorkflow() {
|
86
|
return design.getWorkflow();
|
87
|
}
|
88
|
|
89
|
/**
|
90
|
* @return the stepIndex
|
91
|
*/
|
92
|
@Override
|
93
|
public Button getStepIndex() {
|
94
|
return design.getStepIndex();
|
95
|
}
|
96
|
|
97
|
/**
|
98
|
* @return the caption
|
99
|
*/
|
100
|
|
101
|
@Override
|
102
|
public Label getCaptionLabel() {
|
103
|
return design.getCaptionLabel();
|
104
|
}
|
105
|
}
|