com.save.employee.EmployeeInformationTabSheet.java Source code

Java tutorial

Introduction

Here is the source code for com.save.employee.EmployeeInformationTabSheet.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 com.save.employee;

import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;

/**
 *
 * @author jetdario
 */
public class EmployeeInformationTabSheet extends TabSheet implements TabSheet.SelectedTabChangeListener {

    HorizontalSplitPanel hsplit;
    private int employeeId;

    public EmployeeInformationTabSheet() {
        VerticalLayout v = new VerticalLayout();
        v.setCaption("Personal Information");
        v.setWidth("100%");
        v.setMargin(true);
        v.setSpacing(true);
        //        v.addComponent(new PersonalInformationForm(this, getEmployeeId(), null, null));
        addComponent(v);

        v = new VerticalLayout();
        v.setCaption("Employment Information");
        v.setWidth("100%");
        v.setMargin(true);
        v.setSpacing(true);
        //        v.addComponent(new EmploymentInformationForm(this, getEmployeeId()));
        addComponent(v);
    }

    public EmployeeInformationTabSheet(HorizontalSplitPanel hsplit, int employeeId) {
        this.hsplit = hsplit;
        this.employeeId = employeeId;

        VerticalLayout v = new VerticalLayout();
        v.setCaption("Personal Information");
        v.setWidth("100%");
        v.setMargin(true);
        v.setSpacing(true);
        v.addComponent(new PersonalInformationForm(hsplit, employeeId, null, null));
        addComponent(v);

        v = new VerticalLayout();
        v.setCaption("Employment Information");
        v.setWidth("100%");
        v.setMargin(true);
        v.setSpacing(true);
        v.addComponent(new EmploymentInformationForm(hsplit, employeeId));
        addComponent(v);
    }

    @Override
    public void selectedTabChange(SelectedTabChangeEvent event) {
        //TODO
    }

}