cleanup
[cdm-vaadin.git] / src / main / java / eu / etaxonomy / cdm / vaadin / view / ErrorView.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.view;
10
11 import org.springframework.beans.factory.annotation.Autowired;
12 import org.springframework.beans.factory.config.ConfigurableBeanFactory;
13 import org.springframework.context.annotation.Scope;
14
15 import com.vaadin.navigator.View;
16 import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
17 import com.vaadin.spring.annotation.SpringComponent;
18 import com.vaadin.ui.Alignment;
19 import com.vaadin.ui.Label;
20 import com.vaadin.ui.VerticalLayout;
21 import com.vaadin.ui.themes.ValoTheme;
22
23 import eu.etaxonomy.vaadin.ui.navigation.NavigationManager;
24
25 @SpringComponent
26 @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
27 public class ErrorView extends VerticalLayout implements View {
28
29 public static final String NAME = "error";
30
31 @Autowired
32 private NavigationManager navigationManager;
33
34 private static final long serialVersionUID = -8763747518841365925L;
35
36 public ErrorView() {
37
38 this.setWidth("100%");
39 Label header = new Label("An error occurred");
40 header.setStyleName(ValoTheme.LABEL_FAILURE);
41 header.setWidthUndefined();
42
43 addComponent(header);
44 setComponentAlignment(header, Alignment.MIDDLE_CENTER);
45 }
46
47 @Override
48 public void enter(ViewChangeEvent event) {
49
50 }
51 }