Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package de.fatalix.lighty.web; import de.fatalix.lighty.web.component.LightyNotificationBar; import com.vaadin.annotations.Theme; import com.vaadin.annotations.Title; import com.vaadin.annotations.Widgetset; import com.vaadin.cdi.CDIUI; import com.vaadin.cdi.CDIViewProvider; import com.vaadin.navigator.Navigator; import com.vaadin.server.VaadinRequest; import com.vaadin.ui.Panel; import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; import de.fatalix.lighty.web.component.LightyHeader; import de.fatalix.lighty.web.component.LightyNavigation; import javax.inject.Inject; /** * * @author Fatalix */ @CDIUI @Theme(value = LightyTheme.NAME) @Title("Lighty App") @Widgetset("de.fatalix.lighty.web.AppWidgetSet") public class LightyApp extends UI { @Inject private CDIViewProvider viewProvider; @Inject private LightyNotificationBar notificationBar; @Override protected void init(VaadinRequest request) { setSizeFull(); VerticalLayout navigatorLayout = new VerticalLayout(); navigatorLayout.setSizeFull(); navigatorLayout.setSpacing(true); Panel contentPanel = new Panel(navigatorLayout); contentPanel.setSizeFull(); contentPanel.addStyleName(LightyTheme.BACKGROUND); Navigator navigator = new Navigator(LightyApp.this, contentPanel); navigator.addProvider(viewProvider); VerticalLayout rootLayout = new VerticalLayout(); rootLayout.addComponent(new LightyHeader()); rootLayout.addComponent(new LightyNavigation()); rootLayout.addComponent(notificationBar); rootLayout.addComponent(contentPanel); rootLayout.setExpandRatio(contentPanel, 1.0f); rootLayout.setSizeFull(); setContent(rootLayout); } }