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.ui;
|
10
|
|
11
|
import org.springframework.beans.factory.annotation.Autowired;
|
12
|
import org.springframework.context.ApplicationEventPublisher;
|
13
|
|
14
|
import com.vaadin.annotations.Theme;
|
15
|
import com.vaadin.annotations.Title;
|
16
|
import com.vaadin.annotations.Viewport;
|
17
|
import com.vaadin.annotations.Widgetset;
|
18
|
import com.vaadin.devday.ui.MainMenu;
|
19
|
import com.vaadin.devday.ui.UIInitializedEvent;
|
20
|
import com.vaadin.navigator.ViewDisplay;
|
21
|
import com.vaadin.server.FontAwesome;
|
22
|
import com.vaadin.server.Responsive;
|
23
|
import com.vaadin.server.VaadinRequest;
|
24
|
import com.vaadin.spring.annotation.SpringUI;
|
25
|
import com.vaadin.ui.Component;
|
26
|
import com.vaadin.ui.UI;
|
27
|
import com.vaadin.ui.themes.ValoTheme;
|
28
|
|
29
|
import eu.etaxonomy.cdm.vaadin.view.phycobank.TestView;
|
30
|
|
31
|
/**
|
32
|
* @author a.kohlbecker
|
33
|
* @since Feb 24, 2017
|
34
|
*
|
35
|
*/
|
36
|
@Theme("edit-valo")
|
37
|
@Title("Registration")
|
38
|
@SpringUI(path="registration")
|
39
|
@Viewport("width=device-width, initial-scale=1")
|
40
|
@Widgetset("eu.etaxonomy.cdm.vaadin.AppWidgetSet")
|
41
|
// @PreserveOnRefresh
|
42
|
// @Push
|
43
|
public class RegistrationUI extends UI {
|
44
|
|
45
|
private static final long serialVersionUID = -8626236111335323691L;
|
46
|
|
47
|
@Autowired
|
48
|
private ViewDisplay viewDisplay;
|
49
|
|
50
|
/*
|
51
|
* this HACKY solution forces the bean to be instantiated, TODO do it properly
|
52
|
*/
|
53
|
// @Autowired
|
54
|
// MenuBeanDiscoveryBean bean;
|
55
|
|
56
|
@Autowired
|
57
|
private MainMenu mainMenu;
|
58
|
|
59
|
@Autowired
|
60
|
ApplicationEventPublisher eventBus;
|
61
|
|
62
|
public RegistrationUI() {
|
63
|
|
64
|
}
|
65
|
|
66
|
@Override
|
67
|
protected void init(VaadinRequest request) {
|
68
|
addStyleName(ValoTheme.UI_WITH_MENU);
|
69
|
Responsive.makeResponsive(this);
|
70
|
|
71
|
setContent((Component) viewDisplay);
|
72
|
|
73
|
mainMenu.addMenuItem(TestView.NAME, FontAwesome.AMBULANCE, TestView.NAME);
|
74
|
|
75
|
eventBus.publishEvent(new UIInitializedEvent());
|
76
|
}
|
77
|
}
|