Revision a510c562
Added by Andreas Kohlbecker almost 7 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItem.java | ||
---|---|---|
69 | 69 |
private TimePeriodFormatter timePeriodFormatter = new TimePeriodFormatter(DateTimeFormat.ISO8601_DATE); |
70 | 70 |
|
71 | 71 |
// -------------------------------------------------- |
72 |
private TypeStateLabel typeStateLabel = new TypeStateLabel(); |
|
72 |
|
|
73 |
private RegistrationStateLabel stateLabel = new RegistrationStateLabel(); |
|
73 | 74 |
private Link identifierLink = new Link(); |
74 | 75 |
private Label citationSummaryLabel = new Label(); |
75 | 76 |
private Button blockedByButton = new Button(FontAwesome.WARNING); |
... | ... | |
104 | 105 |
addStyleName("registration-list-item"); |
105 | 106 |
|
106 | 107 |
CssLayout stateUserContainer = new CssLayout(); |
107 |
typeStateLabel.setStyleName(LABEL_NOWRAP + " registration-state");
|
|
108 |
typeStateLabel.setVisible(false);
|
|
108 |
stateLabel.setStyleName(LABEL_NOWRAP + " registration-state");
|
|
109 |
stateLabel.setVisible(false);
|
|
109 | 110 |
|
110 | 111 |
submitterLabel.setStyleName(LABEL_NOWRAP + " submitter"); |
111 | 112 |
submitterLabel.setIcon(FontAwesome.USER); |
112 | 113 |
submitterLabel.setContentMode(ContentMode.HTML); |
113 | 114 |
submitterLabel.setVisible(false); |
114 | 115 |
|
115 |
stateUserContainer.addComponents(typeStateLabel, submitterLabel);
|
|
116 |
stateUserContainer.addComponents(stateLabel, submitterLabel);
|
|
116 | 117 |
addComponent(stateUserContainer, 0, 0); |
117 | 118 |
setComponentAlignment(stateUserContainer, Alignment.TOP_LEFT); |
118 | 119 |
|
... | ... | |
246 | 247 |
if(regDto != null){ |
247 | 248 |
labelMarkup.append("</br>").append(regDto.getSummary()); |
248 | 249 |
|
249 |
typeStateLabel.setVisible(true);
|
|
250 |
typeStateLabel.update(regDto.getRegistrationType(), regDto.getStatus());
|
|
250 |
stateLabel.setVisible(true);
|
|
251 |
stateLabel.update(regDto.getStatus());
|
|
251 | 252 |
getIdentifierLink().setResource(new ExternalResource(regDto.getIdentifier())); |
252 | 253 |
//TODO make responsive and use specificIdentifier in case the space gets too narrow |
253 | 254 |
getIdentifierLink().setVisible(true); |
... | ... | |
284 | 285 |
* @return the typeStateLabel |
285 | 286 |
*/ |
286 | 287 |
public Label getTypeStateLabel() { |
287 |
return typeStateLabel;
|
|
288 |
return stateLabel;
|
|
288 | 289 |
} |
289 | 290 |
|
290 | 291 |
/** |
src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationStateLabel.java | ||
---|---|---|
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.component.registration; |
|
10 |
|
|
11 |
|
|
12 |
import org.apache.commons.lang.StringUtils; |
|
13 |
|
|
14 |
import com.vaadin.ui.Label; |
|
15 |
|
|
16 |
import eu.etaxonomy.cdm.model.name.RegistrationStatus; |
|
17 |
|
|
18 |
/** |
|
19 |
* @author a.kohlbecker |
|
20 |
* @since Mar 30, 2017 |
|
21 |
* |
|
22 |
*/ |
|
23 |
public class RegistrationStateLabel extends Label { |
|
24 |
|
|
25 |
|
|
26 |
/** |
|
27 |
* |
|
28 |
*/ |
|
29 |
private static final long serialVersionUID = -7462726193336938780L; |
|
30 |
|
|
31 |
/** |
|
32 |
* |
|
33 |
*/ |
|
34 |
public RegistrationStateLabel update(RegistrationStatus status) { |
|
35 |
|
|
36 |
setValue(StringUtils.capitalize((status.name().toLowerCase()))); |
|
37 |
addStyleName("status-" + status.name()); |
|
38 |
return this; |
|
39 |
} |
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
} |
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkflowViewBean.java | ||
---|---|---|
42 | 42 |
import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItem; |
43 | 43 |
import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItemEditButtonGroup; |
44 | 44 |
import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItemEditButtonGroup.IdButton; |
45 |
import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationStateLabel; |
|
45 | 46 |
import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationStyles; |
46 |
import eu.etaxonomy.cdm.vaadin.component.registration.TypeStateLabel; |
|
47 | 47 |
import eu.etaxonomy.cdm.vaadin.component.registration.WorkflowSteps; |
48 | 48 |
import eu.etaxonomy.cdm.vaadin.event.AbstractEditorAction; |
49 | 49 |
import eu.etaxonomy.cdm.vaadin.event.AbstractEditorAction.Action; |
... | ... | |
247 | 247 |
messageButton.setCaptionAsHtml(true); |
248 | 248 |
buttonGroup.addComponent(messageButton); |
249 | 249 |
|
250 |
TypeStateLabel typeStateLabel = new TypeStateLabel().update(dto.getRegistrationType(), dto.getStatus());
|
|
250 |
RegistrationStateLabel stateLabel = new RegistrationStateLabel().update(dto.getStatus());
|
|
251 | 251 |
|
252 | 252 |
|
253 | 253 |
if(UserHelper.fromSession().userIsRegistrationCurator() || UserHelper.fromSession().userIsAdmin()) { |
... | ... | |
338 | 338 |
regItem = new Label(dto.getSummary()); |
339 | 339 |
} |
340 | 340 |
|
341 |
namesTypesList.addComponent(typeStateLabel, 0, row);
|
|
342 |
namesTypesList.setComponentAlignment(typeStateLabel, Alignment.TOP_LEFT);
|
|
341 |
namesTypesList.addComponent(stateLabel, 0, row);
|
|
342 |
namesTypesList.setComponentAlignment(stateLabel, Alignment.TOP_LEFT);
|
|
343 | 343 |
namesTypesList.addComponent(regItem, 1, row); |
344 | 344 |
namesTypesList.addComponent(buttonGroup, 2, row); |
345 | 345 |
namesTypesList.setComponentAlignment(buttonGroup, Alignment.TOP_LEFT); |
Also available in: Unified diff
fix #6758 removing registration type icon