Revision bc74cf95
Added by Andreas Kohlbecker about 7 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/phycobank/RegistrationWorkflowViewBean.java | ||
---|---|---|
15 | 15 |
import com.vaadin.navigator.View; |
16 | 16 |
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; |
17 | 17 |
import com.vaadin.spring.annotation.SpringView; |
18 |
import com.vaadin.ui.Button; |
|
19 | 18 |
import com.vaadin.ui.CssLayout; |
20 | 19 |
import com.vaadin.ui.Label; |
21 | 20 |
|
22 | 21 |
import eu.etaxonomy.cdm.vaadin.component.phycobank.RegistrationWorkflowComponent; |
22 |
import eu.etaxonomy.cdm.vaadin.component.phycobank.WorkflowSteps; |
|
23 | 23 |
import eu.etaxonomy.cdm.vaadin.presenter.phycobank.RegistrationType; |
24 | 24 |
import eu.etaxonomy.cdm.vaadin.presenter.phycobank.RegistrationWorkflowPresenter; |
25 | 25 |
import eu.etaxonomy.vaadin.mvp.AbstractView; |
... | ... | |
61 | 61 |
if(params[0].equals(ACTION_NEW)) { |
62 | 62 |
regType = RegistrationType.valueOf(params[1]); |
63 | 63 |
design.getTitle().setValue(design.getTitle().getValue() + " " + regType.name() + " ..."); |
64 |
makeWorflow(regType); |
|
64 | 65 |
} else if( params[0].equals(ACTION_EDIT)) { |
65 | 66 |
design.getTitle().setValue(design.getTitle().getValue() + " " + params[1]); |
66 | 67 |
} |
68 |
|
|
67 | 69 |
} |
70 |
} |
|
68 | 71 |
|
72 |
private void makeWorflow(RegistrationType type){ |
|
73 |
switch (type) { |
|
74 |
case name: |
|
75 |
addNameWorkflow(); |
|
76 |
break; |
|
77 |
case typification: |
|
78 |
addTypificationWorkflow(); |
|
79 |
break; |
|
80 |
default: |
|
81 |
break; |
|
82 |
} |
|
69 | 83 |
} |
70 | 84 |
|
85 |
/** |
|
86 |
* |
|
87 |
*/ |
|
88 |
private void addNameWorkflow() { |
|
89 |
WorkflowSteps steps = new WorkflowSteps(); |
|
90 |
steps.appendNewWorkflowItem(1, "Nomenclatural reference", null); |
|
91 |
steps.appendNewWorkflowItem(2, "Name", null); |
|
92 |
steps.appendNewWorkflowItem(3, "Publisher Details", null); |
|
93 |
steps.appendNewWorkflowItem(4, "Data curation", null); |
|
94 |
steps.appendNewWorkflowItem(5, "Awaiting publication", null); |
|
95 |
getWorkflow().addComponent(steps); |
|
96 |
} |
|
97 |
|
|
98 |
/** |
|
99 |
* |
|
100 |
*/ |
|
101 |
private void addTypificationWorkflow() { |
|
102 |
WorkflowSteps steps = new WorkflowSteps(); |
|
103 |
steps.appendNewWorkflowItem(1, "Name", null); |
|
104 |
steps.appendNewWorkflowItem(2, "Type information", null); |
|
105 |
steps.appendNewWorkflowItem(3, "Publisher Details", null); |
|
106 |
steps.appendNewWorkflowItem(4, "Data curation", null); |
|
107 |
steps.appendNewWorkflowItem(5, "Awaiting publication", null); |
|
108 |
getWorkflow().addComponent(steps); |
|
109 |
} |
|
110 |
|
|
71 | 111 |
/** |
72 | 112 |
* {@inheritDoc} |
73 | 113 |
*/ |
... | ... | |
95 | 135 |
return design.getWorkflow(); |
96 | 136 |
} |
97 | 137 |
|
98 |
/** |
|
99 |
* @return the stepIndex |
|
100 |
*/ |
|
101 |
@Override |
|
102 |
public Button getStepIndex() { |
|
103 |
return design.getStepIndex(); |
|
104 |
} |
|
105 |
|
|
106 |
/** |
|
107 |
* @return the caption |
|
108 |
*/ |
|
109 |
|
|
110 |
@Override |
|
111 |
public Label getCaptionLabel() { |
|
112 |
return design.getCaptionLabel(); |
|
113 |
} |
|
114 |
|
|
115 | 138 |
/** |
116 | 139 |
* {@inheritDoc} |
117 | 140 |
*/ |
... | ... | |
120 | 143 |
// TODO Auto-generated method stub |
121 | 144 |
|
122 | 145 |
} |
146 |
|
|
123 | 147 |
} |
Also available in: Unified diff
ref #6169 generic workflows