Project

General

Profile

Download (1.36 KB) Statistics
| Branch: | Tag: | Revision:
1
package eu.etaxonomy.cdm.vaadin.ui;
2

    
3
import java.util.logging.Logger;
4

    
5
import com.vaadin.annotations.Theme;
6
import com.vaadin.annotations.Widgetset;
7
import com.vaadin.navigator.Navigator;
8
import com.vaadin.server.VaadinRequest;
9
import com.vaadin.spring.annotation.SpringUI;
10
import com.vaadin.ui.UI;
11

    
12
import eu.etaxonomy.cdm.vaadin.view.NaviTestView;
13

    
14
@Theme("edit")
15
@SpringUI(path="navi")
16
@Widgetset("eu.etaxonomy.cdm.vaadin.AppWidgetSet")
17
public class NavigatorTestUI extends AbstractAuthenticatedUI {
18

    
19
	Navigator navigator;
20

    
21
	private static final String FIRST_VIEW = "firstView";
22
	public static final String SECOND_VIEW = "secondView";
23

    
24
	private final static Logger logger = Logger.getLogger(NavigatorTestUI.class.getName());
25

    
26
	@Override
27
	protected void doInit(VaadinRequest request) {
28
		getPage().setTitle("Navigation Example");
29
		NaviTestView ntv1 = new NaviTestView();
30
		ntv1.setText("Congratulations! you have reached the first view. If you have got here without logging in there we are in trouble :)");
31

    
32
		NaviTestView ntv2 = new NaviTestView();
33
		ntv2.setText("Wow! you made it to the second view. Get yourself a beer - preferably a Krusovice Cerne");
34

    
35
		ntv2.removeButton();
36

    
37
        UI.getCurrent().getNavigator().addView(FIRST_VIEW, ntv1);
38
        UI.getCurrent().getNavigator().addView(SECOND_VIEW, ntv2);
39

    
40
	}
41

    
42
	@Override
43
	public String getFirstViewName() {
44
		return FIRST_VIEW;
45
	}
46

    
47
}
(3-3/3)