com.save.employee.maintenance.EmployeeMRUI.java Source code

Java tutorial

Introduction

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

import com.save.employee.EmployeesDataGridProperties;
import com.vaadin.ui.HorizontalSplitPanel;

/**
 *
 * @author jetdario
 */
public class EmployeeMRUI extends HorizontalSplitPanel {

    private int employeeId;

    public EmployeeMRUI() {
        setLocked(true);
        setSplitPosition(300, Unit.PIXELS);

        setFirstComponent(new EmployeesDataGridProperties(this, "maintenance"));
        setSecondComponent(new MRUI(getEmployeeId()));
    }

    public EmployeeMRUI(int employeeId) {
        this.employeeId = employeeId;

        setLocked(true);
        setSplitPosition(300, Unit.PIXELS);

        removeAllComponents();
        setFirstComponent(new EmployeesDataGridProperties(this, "maintenance"));
        setSecondComponent(new MRUI(getEmployeeId()));
    }

    int getEmployeeId() {
        return employeeId;
    }
}