Project

General

Profile

« Previous | Next » 

Revision 5b4537c4

Added by Andreas Kohlbecker about 7 years ago

ref #6169 replacing declarative WorkflowViewDesign

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkflowViewBean.java
16 16
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
17 17
import com.vaadin.spring.annotation.SpringView;
18 18
import com.vaadin.ui.CssLayout;
19
import com.vaadin.ui.Label;
20 19

  
21
import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationWorkflowComponent;
22 20
import eu.etaxonomy.cdm.vaadin.component.registration.WorkflowSteps;
23 21
import eu.etaxonomy.cdm.vaadin.event.registration.RegistrationWorkflowEvent;
24 22
import eu.etaxonomy.cdm.vaadin.presenter.registration.RegistrationType;
25 23
import eu.etaxonomy.cdm.vaadin.presenter.registration.RegistrationWorkflowPresenter;
26
import eu.etaxonomy.vaadin.mvp.AbstractView;
24
import eu.etaxonomy.cdm.vaadin.view.AbstractPageView;
27 25

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

  
35
    /**
36
     *
37
     */
38
    private static final String CSS_CLASS_WORKFLOW = "workflow-container";
39

  
40
    private static final String SUBHEADER_PREFIX = "Advance step by step through the registration workflow for scientific names.";
41

  
42
    private static final String HEADER_PREFIX = "Registration of the ...";
43

  
37 44
    private static final long serialVersionUID = -213040114015958970L;
38 45

  
39 46
    public static final String NAME = "workflow";
......
44 51

  
45 52
    public RegistrationType regType = null;
46 53

  
47
    RegistrationWorkflowComponent design;
54
    CssLayout workflow;
55

  
56
    String headerSuffix = "";
48 57

  
49 58
    public RegistrationWorkflowViewBean() {
50
        design = new RegistrationWorkflowComponent();
51
        setCompositionRoot(design);
59
        super();
60

  
61
        workflow = new CssLayout();
62
        workflow.setSizeFull();
63
        workflow.setId(CSS_CLASS_WORKFLOW);
64
        getLayout().addComponent(workflow);
52 65
    }
53 66

  
54 67
    /**
......
61 74

  
62 75
           if(params[0].equals(ACTION_NEW)) {
63 76
               regType = RegistrationType.valueOf(params[1]);
64
               design.getTitle().setValue(design.getTitle().getValue() + "  " + regType.name() + " ...");
77
               headerSuffix = regType.name() + " ...";
65 78
               eventBus.publishEvent(new RegistrationWorkflowEvent(regType));
66 79

  
67 80
           } else if( params[0].equals(ACTION_EDIT)) {
68
               design.getTitle().setValue(design.getTitle().getValue() + "  " + params[1]);
81
               headerSuffix = params[1];
69 82
               eventBus.publishEvent(new RegistrationWorkflowEvent(Integer.parseInt(params[1])));
70 83
           }
71

  
84
           updateHeader();
72 85
        }
73 86
    }
74 87

  
......
121 134
        setPresenter(presenter);
122 135
    }
123 136

  
124
    /* ------- RegistrationWorkflowView implementation ------- */
125

  
126 137
    /**
127
     * @return the title
138
     * {@inheritDoc}
128 139
     */
129 140
    @Override
130
    public Label getTitle() {
131
        return design.getTitle();
141
    public void openNameEditor(UUID nameUuid) {
142
        // TODO Auto-generated method stub
143

  
132 144
    }
133 145

  
134 146
    /**
135
     * @return the workflow
147
     * {@inheritDoc}
136 148
     */
137 149
    @Override
138
    public CssLayout getWorkflow() {
139
        return design.getWorkflow();
150
    protected String getHeaderText() {
151
        return HEADER_PREFIX + " " + headerSuffix;
140 152
    }
141 153

  
142 154
    /**
143 155
     * {@inheritDoc}
144 156
     */
145 157
    @Override
146
    public void openNameEditor(UUID nameUuid) {
147
        // TODO Auto-generated method stub
158
    protected String getSubHeaderText() {
159
        return SUBHEADER_PREFIX;
160
    }
148 161

  
162
    /**
163
     * {@inheritDoc}
164
     */
165
    @Override
166
    public CssLayout getWorkflow() {
167
        return workflow;
149 168
    }
150 169

  
170

  
151 171
}

Also available in: Unified diff