Project

General

Profile

« Previous | Next » 

Revision 1ca00ef0

Added by Andreas Kohlbecker about 7 years ago

ref #6169 more complete workflow view

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/design/phycobank/RegistrationWorkflowDesign.java
2 2

  
3 3
import com.vaadin.annotations.AutoGenerated;
4 4
import com.vaadin.annotations.DesignRoot;
5
import com.vaadin.ui.Button;
5 6
import com.vaadin.ui.CssLayout;
7
import com.vaadin.ui.Label;
6 8
import com.vaadin.ui.VerticalLayout;
7 9
import com.vaadin.ui.declarative.Design;
8 10

  
9
/** 
11
/**
10 12
 * !! DO NOT EDIT THIS FILE !!
11
 * 
13
 *
12 14
 * This class is generated by Vaadin Designer and will be overwritten.
13
 * 
15
 *
14 16
 * Please make a subclass with logic and additional interfaces as needed,
15 17
 * e.g class LoginView extends LoginDesign implements View { }
16 18
 */
......
18 20
@AutoGenerated
19 21
@SuppressWarnings("serial")
20 22
public class RegistrationWorkflowDesign extends VerticalLayout {
23
    protected Label title;
21 24
    protected CssLayout workflow;
25
    protected Button stepIndex;
26
    protected Label caption;
22 27

  
23 28
    public RegistrationWorkflowDesign() {
24 29
        Design.read(this);
src/main/java/eu/etaxonomy/cdm/vaadin/presenter/phycobank/RegistrationType.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.presenter.phycobank;
10

  
11
/**
12
 * @author a.kohlbecker
13
 * @since Mar 3, 2017
14
 *
15
 */
16
public enum RegistrationType {
17

  
18
    name, typification;
19

  
20
}
src/main/java/eu/etaxonomy/cdm/vaadin/view/phycobank/RegistrationWorkflowView.java
12 12
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
13 13
import com.vaadin.spring.annotation.SpringView;
14 14

  
15
import eu.etaxonomy.cdm.vaadin.design.phycobank.RegistrationWorkflowDesign;
16
import eu.etaxonomy.cdm.vaadin.presenter.phycobank.RegistrationType;
17

  
15 18
/**
16 19
 * @author a.kohlbecker
17 20
 * @since Mar 2, 2017
18 21
 *
19 22
 */
20 23
@SpringView(name=RegistrationWorkflowView.NAME)
21
public class RegistrationWorkflowView implements View {
24
public class RegistrationWorkflowView extends RegistrationWorkflowDesign implements View {
22 25

  
23 26
    private static final long serialVersionUID = -213040114015958970L;
24 27

  
25 28
    public static final String NAME = "workflow";
26 29

  
30
    RegistrationType regType = null;
31

  
27 32
    /**
28 33
     * {@inheritDoc}
29 34
     */
30 35
    @Override
31 36
    public void enter(ViewChangeEvent event) {
37
        if(event.getParameters() != null){
38
           String[] params = event.getParameters().split("/");
39
           if(params.length > 0){
40
               regType = RegistrationType.valueOf(params[0]);
41
               title.setValue(title.getValue() + "  " + regType.name() + " ...");
42
           }
43
        }
32 44

  
33 45
    }
34 46

  
src/main/java/eu/etaxonomy/cdm/vaadin/view/phycobank/StartRegistrationView.java
16 16
import com.vaadin.spring.annotation.SpringView;
17 17

  
18 18
import eu.etaxonomy.cdm.vaadin.design.phycobank.StartRegistrationDesign;
19
import eu.etaxonomy.cdm.vaadin.presenter.phycobank.RegistrationType;
19 20
import eu.etaxonomy.vaadin.ui.navigation.NavigationEvent;
20 21

  
21 22
/**
......
34 35
    ApplicationEventPublisher eventBus;
35 36

  
36 37
    public StartRegistrationView() {
37
        buttonName.addClickListener(e -> new NavigationEvent(RegistrationWorkflowView.NAME));
38
        buttonName.addClickListener(e -> eventBus.publishEvent(new NavigationEvent(RegistrationWorkflowView.NAME+ "/" + RegistrationType.name)));
38 39
    }
39 40

  
40 41
    /**
src/main/resources/eu/etaxonomy/cdm/vaadin/design/phycobank/RegistrationWorkflowDesign.html
7 7
 </head>
8 8
 <body>
9 9
  <vaadin-vertical-layout spacing>
10
   <vaadin-label style-name="huge" size-auto plain-text :center>
11
     Registration of ... 
10
   <vaadin-label style-name="huge" size-auto plain-text _id="title" :center>
11
     Registration of the 
12 12
   </vaadin-label>
13 13
   <vaadin-label size-auto plain-text :middle :center>
14 14
     Advance step by step through the registration workflow for scientific names. 
......
19 19
    </vaadin-css-layout>
20 20
    <vaadin-css-layout style-name="steps">
21 21
     <vaadin-css-layout>
22
      <vaadin-button icon="fonticon://FontAwesome/f111" style-name="borderless" plain-text>
22
      <vaadin-button icon="fonticon://FontAwesome/f111" style-name="borderless" plain-text _id="stepIndex">
23 23
        1 
24 24
      </vaadin-button>
25
      <vaadin-label plain-text>
25
      <vaadin-label plain-text _id="caption">
26 26
        Edit the scientific name and related names. 
27 27
      </vaadin-label>
28 28
     </vaadin-css-layout>
......
31 31
        2 
32 32
      </vaadin-button>
33 33
      <vaadin-label plain-text>
34
        Label 
34
        Edit the scientific name and related names. 
35 35
      </vaadin-label>
36 36
     </vaadin-css-layout>
37 37
     <vaadin-css-layout>

Also available in: Unified diff