Revision b3e242fe
Added by Andreas Kohlbecker almost 7 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkflowViewBean.java | ||
---|---|---|
49 | 49 |
import eu.etaxonomy.cdm.vaadin.event.ShowDetailsEvent; |
50 | 50 |
import eu.etaxonomy.cdm.vaadin.event.TaxonNameEditorAction; |
51 | 51 |
import eu.etaxonomy.cdm.vaadin.event.TypeDesignationWorkingsetEditorAction; |
52 |
import eu.etaxonomy.cdm.vaadin.event.registration.RegistrationWorkflowEvent; |
|
53 | 52 |
import eu.etaxonomy.cdm.vaadin.model.registration.RegistrationWorkingSet; |
54 | 53 |
import eu.etaxonomy.cdm.vaadin.model.registration.WorkflowStep; |
55 | 54 |
import eu.etaxonomy.cdm.vaadin.security.AccessRestrictedView; |
... | ... | |
77 | 76 |
|
78 | 77 |
public static final String NAME = "workflow"; |
79 | 78 |
|
80 |
public static final String ACTION_NEW = "new"; |
|
81 |
|
|
82 |
public static final String ACTION_EDIT = "edit"; |
|
83 |
|
|
84 | 79 |
private static final boolean REG_ITEM_AS_BUTTON_GROUP = true; |
85 | 80 |
|
86 | 81 |
public RegistrationType regType = null; |
... | ... | |
94 | 89 |
|
95 | 90 |
private boolean addNameAndTypeEditButtons = false; |
96 | 91 |
|
92 |
private ViewParameters viewParameters; |
|
93 |
|
|
94 |
|
|
95 |
/** |
|
96 |
* @return the viewParameters |
|
97 |
*/ |
|
98 |
@Override |
|
99 |
public ViewParameters getViewParameters() { |
|
100 |
return viewParameters; |
|
101 |
} |
|
97 | 102 |
|
98 | 103 |
public RegistrationWorkflowViewBean() { |
99 | 104 |
super(); |
... | ... | |
113 | 118 |
@Override |
114 | 119 |
public void enter(ViewChangeEvent event) { |
115 | 120 |
if(event.getParameters() != null){ |
116 |
String[] params = event.getParameters().split("/"); |
|
117 |
|
|
118 |
if(params[0].equals(ACTION_NEW)) { |
|
119 |
regType = RegistrationType.valueOf(params[1]); |
|
120 |
headerText = regType.name() + " ..."; |
|
121 |
eventBus.publishEvent(new RegistrationWorkflowEvent(regType)); |
|
122 |
|
|
123 |
} else if( params[0].equals(ACTION_EDIT)) { |
|
124 |
headerText = params[1]; |
|
125 |
eventBus.publishEvent(new RegistrationWorkflowEvent(Integer.parseInt(params[1]))); |
|
126 |
} |
|
127 |
updateHeader(); |
|
121 |
this.viewParameters = new ViewParameters(event.getParameters().split("/")); |
|
122 |
|
|
123 |
getPresenter().handleViewEntered(); |
|
128 | 124 |
} |
129 | 125 |
} |
130 | 126 |
|
... | ... | |
202 | 198 |
*/ |
203 | 199 |
public Panel createRegistrationsList(RegistrationWorkingSet workingset) { |
204 | 200 |
// prepare name and type list |
205 |
GridLayout namesTypesList = new GridLayout(3, workingset.getRegistrationDTOs().size()); |
|
201 |
GridLayout namesTypesList = new GridLayout(3, workingset.getRegistrationDTOs().size() + 1);
|
|
206 | 202 |
int row = 0; |
207 | 203 |
for(RegistrationDTO dto : workingset.getRegistrationDTOs()) { |
208 | 204 |
registrationListComponent(namesTypesList, row++, dto); |
... | ... | |
448 | 444 |
@Override |
449 | 445 |
public void setHeaderText(String text) { |
450 | 446 |
this.headerText = text; |
447 |
updateHeader(); |
|
451 | 448 |
|
452 | 449 |
} |
453 | 450 |
|
... | ... | |
464 | 461 |
@Override |
465 | 462 |
public void setSubheaderText(String text) { |
466 | 463 |
subheaderText = text; |
464 |
updateHeader(); |
|
467 | 465 |
} |
468 | 466 |
|
469 | 467 |
/** |
... | ... | |
510 | 508 |
return null; |
511 | 509 |
} |
512 | 510 |
|
511 |
protected class ViewParameters { |
|
512 |
|
|
513 |
String action; |
|
514 |
Integer referenceId; |
|
515 |
|
|
516 |
public ViewParameters(String[] params){ |
|
517 |
action = params[0]; |
|
518 |
referenceId = Integer.parseInt(params[1]); |
|
519 |
} |
|
520 |
} |
|
521 |
|
|
513 | 522 |
} |
Also available in: Unified diff
fix #6810 View for starting new registrations implemented