net.gvcc.jgoffice.components.FooterBar.java Source code

Java tutorial

Introduction

Here is the source code for net.gvcc.jgoffice.components.FooterBar.java

Source

/*
 * 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 net.gvcc.jgoffice.components;

import com.vaadin.annotations.AutoGenerated;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
import net.gvcc.jgoffice.templates.interfaces.IGlobalConst;

/**
 *
 * @author ernst_sgv
 */
public class FooterBar extends CustomComponent implements IGlobalConst {

    @AutoGenerated
    private VerticalLayout mainLayout;
    private HorizontalLayout fBar;
    private Label hint;

    public FooterBar() {
        buildMainLayout();
        setCompositionRoot(mainLayout);
    }

    private VerticalLayout buildMainLayout() {
        // common part: create layout
        mainLayout = new VerticalLayout();
        mainLayout.setImmediate(false);
        mainLayout.setWidth("100%");
        mainLayout.setHeight("-1px");
        mainLayout.setMargin(false);
        mainLayout.setSpacing(true);

        // top-level component properties
        setWidth("100.0%");
        setHeight("-1px");

        fBar = new HorizontalLayout();
        mainLayout.setStyleName("g-footer");

        hint = new Label("jGOffice Version 0.1 - 2013");
        fBar.addComponent(hint);

        mainLayout.addComponent(fBar);
        mainLayout.setComponentAlignment(fBar, Alignment.TOP_LEFT);

        return mainLayout;
    }

    public Label getHint() {
        return hint;
    }

    public void setHint(Label hint) {
        this.hint = hint;
    }

    public void setApplicationHint() {
        getHint().setValue("jGOffice Version 0.1 - 2013");//((MainUI) UI.getCurrent()).getGlobal().getApplicationHint());
    }

}