Java tutorial
/******************************************************************************* * Copyright (c) 2012 - VAUSHELL - contact@vaushell.com. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v3.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/gpl.html ******************************************************************************/ package com.vaushell.treetasker.application.header; import com.vaadin.annotations.AutoGenerated; import com.vaadin.terminal.ThemeResource; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.Embedded; import com.vaadin.ui.HorizontalLayout; /** * This component is the web application header. * * @author VAUSHELL - Frederic PEAK <fred@vaushell.com> * */ public class TTWHeader extends CustomComponent { @AutoGenerated private HorizontalLayout mainLayout; @AutoGenerated private Embedded vBGright; @AutoGenerated private Embedded vBGleft; /*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */ /** * */ private static final long serialVersionUID = 1L; /** * The constructor should first build the main layout, set the composition * root and then do any custom initialization. * * The constructor will not be automatically regenerated by the visual * editor. */ public TTWHeader() { buildMainLayout(); setCompositionRoot(mainLayout); // TODO add user code here } /*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */ /*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */ /*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */ /*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */ /*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */ /*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */ @AutoGenerated private HorizontalLayout buildMainLayout() { // common part: create layout mainLayout = new HorizontalLayout(); mainLayout.setImmediate(false); mainLayout.setWidth("100%"); mainLayout.setHeight("163px"); mainLayout.setMargin(false); // top-level component properties setWidth("100.0%"); setHeight("163px"); // vBGleft vBGleft = new Embedded(); vBGleft.setImmediate(false); vBGleft.setWidth("-1px"); vBGleft.setHeight("-1px"); vBGleft.setSource(new ThemeResource("icons/header-left.png")); vBGleft.setType(1); vBGleft.setMimeType("image/png"); mainLayout.addComponent(vBGleft); // vBGright vBGright = new Embedded(); vBGright.setImmediate(false); vBGright.setWidth("100.0%"); vBGright.setHeight("100.0%"); vBGright.setSource(new ThemeResource("icons/header-right.png")); vBGright.setType(1); vBGright.setMimeType("image/png"); mainLayout.addComponent(vBGright); mainLayout.setExpandRatio(vBGright, 1.0f); return mainLayout; } }