Example usage for com.vaadin.ui Alignment BOTTOM_LEFT

List of usage examples for com.vaadin.ui Alignment BOTTOM_LEFT

Introduction

In this page you can find the example usage for com.vaadin.ui Alignment BOTTOM_LEFT.

Prototype

Alignment BOTTOM_LEFT

To view the source code for com.vaadin.ui Alignment BOTTOM_LEFT.

Click Source Link

Usage

From source file:com.openhris.employee.allowance.EmployeeAllowanceInformation.java

ComponentContainer component() {
    GridLayout glayout = new GridLayout(3, 14);
    glayout.setSpacing(true);/*from w w w.  j a  va2s  .  c  o m*/
    glayout.setWidth("600px");
    glayout.setHeight("100%");

    communication = new TextField("Communication Allowance: ");
    communication.setWidth("170px");
    communication.addStyleName("numerical");
    glayout.addComponent(communication, 0, 0);

    communicationEntry = dropDown.populateEmploymentAllowanceEntry("Entry Type: ");
    communicationEntry.setWidth("150px");
    glayout.addComponent(communicationEntry, 1, 0);

    Button communicationBtn = new Button("UPDATE COMMUNICATION ALLOWANCE");
    communicationBtn.setWidth("250px");
    communicationBtn.addListener(buttonClickListener);
    glayout.addComponent(communicationBtn, 2, 0);
    glayout.setComponentAlignment(communicationBtn, Alignment.BOTTOM_LEFT);
    if (GlobalVariables.getUserRole().equals("administrator") || GlobalVariables.getUserRole().equals("hr")) {
        communicationBtn.setEnabled(true);
    } else {
        communicationBtn.setEnabled(false);
    }

    glayout.addComponent(new Label("<HR>", Label.CONTENT_XHTML), 0, 1, 2, 1);

    perDiem = new TextField("Per Diem: ");
    perDiem.setWidth("170px");
    perDiem.addStyleName("numerical");
    glayout.addComponent(perDiem, 0, 2);

    perDiemEntry = dropDown.populateEmploymentAllowanceEntry("Entry Type: ");
    perDiemEntry.setWidth("150px");
    glayout.addComponent(perDiemEntry, 1, 2);

    Button perDiemBtn = new Button("UPDATE PER DIEM");
    perDiemBtn.setWidth("250px");
    perDiemBtn.addListener(buttonClickListener);
    glayout.addComponent(perDiemBtn, 2, 2);
    glayout.setComponentAlignment(perDiemBtn, Alignment.BOTTOM_LEFT);
    if (GlobalVariables.getUserRole().equals("administrator") || GlobalVariables.getUserRole().equals("hr")) {
        perDiemBtn.setEnabled(true);
    } else {
        perDiemBtn.setEnabled(false);
    }

    glayout.addComponent(new Label("<HR>", Label.CONTENT_XHTML), 0, 3, 2, 3);

    cola = new TextField("Cola: ");
    cola.setWidth("170px");
    cola.addStyleName("numerical");
    glayout.addComponent(cola, 0, 4);

    colaEntry = dropDown.populateEmploymentAllowanceEntry("Entry Type: ");
    colaEntry.setWidth("150px");
    glayout.addComponent(colaEntry, 1, 4);

    Button colaBtn = new Button("UPDATE COLA");
    colaBtn.setWidth("250px");
    colaBtn.addListener(buttonClickListener);
    glayout.addComponent(colaBtn, 2, 4);
    glayout.setComponentAlignment(colaBtn, Alignment.BOTTOM_LEFT);
    if (GlobalVariables.getUserRole().equals("administrator") || GlobalVariables.getUserRole().equals("hr")) {
        colaBtn.setEnabled(true);
    } else {
        colaBtn.setEnabled(false);
    }

    glayout.addComponent(new Label("<HR>", Label.CONTENT_XHTML), 0, 5, 2, 5);

    meal = new TextField("Meal Allowance: ");
    meal.setWidth("170px");
    meal.addStyleName("numerical");
    glayout.addComponent(meal, 0, 6);

    mealEntry = dropDown.populateEmploymentAllowanceEntry("Entry Type: ");
    mealEntry.setWidth("150px");
    glayout.addComponent(mealEntry, 1, 6);

    Button mealBtn = new Button("UPDATE MEAL ALLOWANCE");
    mealBtn.setWidth("250px");
    mealBtn.addListener(buttonClickListener);
    glayout.addComponent(mealBtn, 2, 6);
    glayout.setComponentAlignment(mealBtn, Alignment.BOTTOM_LEFT);
    if (GlobalVariables.getUserRole().equals("administrator") || GlobalVariables.getUserRole().equals("hr")) {
        mealBtn.setEnabled(true);
    } else {
        mealBtn.setEnabled(false);
    }

    glayout.addComponent(new Label("<HR>", Label.CONTENT_XHTML), 0, 7, 2, 7);

    transportation = new TextField("Transportation Allowance: ");
    transportation.setWidth("170px");
    transportation.addStyleName("numerical");
    glayout.addComponent(transportation, 0, 8);

    transportationEntry = dropDown.populateEmploymentAllowanceEntry("Entry Type: ");
    transportationEntry.setWidth("150px");
    glayout.addComponent(transportationEntry, 1, 8);

    Button transportationBtn = new Button("UPDATE TRANSPORTATION ALLOWANCE");
    transportationBtn.setWidth("250px");
    transportationBtn.addListener(buttonClickListener);
    glayout.addComponent(transportationBtn, 2, 8);
    glayout.setComponentAlignment(transportationBtn, Alignment.BOTTOM_LEFT);
    if (GlobalVariables.getUserRole().equals("administrator") || GlobalVariables.getUserRole().equals("hr")) {
        transportationBtn.setEnabled(true);
    } else {
        transportationBtn.setEnabled(false);
    }

    glayout.addComponent(new Label("<HR>", Label.CONTENT_XHTML), 0, 9, 2, 9);

    others = new TextField("Other Allowances: ");
    others.setWidth("170px");
    others.addStyleName("numerical");
    glayout.addComponent(others, 0, 10);

    othersEntry = dropDown.populateEmploymentAllowanceEntry("Entry Type: ");
    othersEntry.setWidth("150px");
    glayout.addComponent(othersEntry, 1, 10);

    Button othersBtn = new Button("UPDATE OTHER ALLOWANCES");
    othersBtn.setWidth("250px");
    othersBtn.addListener(buttonClickListener);
    glayout.addComponent(othersBtn, 2, 10);
    glayout.setComponentAlignment(othersBtn, Alignment.BOTTOM_LEFT);
    if (GlobalVariables.getUserRole().equals("administrator") || GlobalVariables.getUserRole().equals("hr")) {
        othersBtn.setEnabled(true);
    } else {
        othersBtn.setEnabled(false);
    }

    glayout.addComponent(new Label("<HR>", Label.CONTENT_XHTML), 0, 11, 2, 11);

    afl = new TextField("Allowance for Liquidation: ");
    afl.setWidth("170px");
    afl.addStyleName("numerical");
    glayout.addComponent(afl, 0, 12);

    Button aflBtn = new Button("UPDATE AFL");
    aflBtn.setWidth("100%");
    aflBtn.addListener(buttonClickListener);
    glayout.addComponent(aflBtn, 1, 12, 2, 12);
    glayout.setComponentAlignment(aflBtn, Alignment.BOTTOM_LEFT);
    if (GlobalVariables.getUserRole().equals("administrator") || GlobalVariables.getUserRole().equals("hr")) {
        aflBtn.setEnabled(true);
    } else {
        aflBtn.setEnabled(false);
    }

    if (getEmployeeId() != null) {
        Allowances a = ais.getAllowancesByEmployee(getEmployeeId());

        communication.setValue(a.getCommunication());
        communicationEntry.setValue(
                Constant.getKeyByValue(Constant.MAP_CONSTANT_EMPLOYMENT_ALLOWANCE_ENTRY, a.getComEntryType()));

        perDiem.setValue(a.getPerDiem());
        perDiemEntry.setValue(Constant.getKeyByValue(Constant.MAP_CONSTANT_EMPLOYMENT_ALLOWANCE_ENTRY,
                a.getPerDiemEntryType()));

        cola.setValue(a.getCola());
        colaEntry.setValue(
                Constant.getKeyByValue(Constant.MAP_CONSTANT_EMPLOYMENT_ALLOWANCE_ENTRY, a.getColaEntryType()));

        meal.setValue(a.getMeal());
        mealEntry.setValue(
                Constant.getKeyByValue(Constant.MAP_CONSTANT_EMPLOYMENT_ALLOWANCE_ENTRY, a.getMealEntryType()));

        transportation.setValue(a.getTransportation());
        transportationEntry.setValue(Constant.getKeyByValue(Constant.MAP_CONSTANT_EMPLOYMENT_ALLOWANCE_ENTRY,
                a.getTransEntryType()));

        others.setValue(a.getOthers());
        othersEntry.setValue(Constant.getKeyByValue(Constant.MAP_CONSTANT_EMPLOYMENT_ALLOWANCE_ENTRY,
                a.getOthersEntryType()));

        afl.setValue(a.getAllowanceForLiquidation());
    }

    return glayout;
}

From source file:com.openhris.employee.EmployeeSummaryUI.java

public EmployeeSummaryUI(int branchId) {
    this.branchId = branchId;

    setSizeFull();//w ww . j a v a 2s .  co  m
    setSpacing(true);
    setMargin(new MarginInfo(true, true, false, false));

    HorizontalLayout h = new HorizontalLayout();
    h.setWidth("100%");
    h.setMargin(true);
    h.setSpacing(true);

    final ComboBox employeeStatus = new ComboBox("Status: ");
    employeeStatus.setWidth("150px");
    employeeStatus.setNullSelectionAllowed(false);
    employeeStatus.addItem("employed");
    employeeStatus.addItem("resigned");
    h.addComponent(employeeStatus);

    Button generateBtn = new Button("GENERATE EMPLOYEE SUMMARY");
    generateBtn.setWidth("250px");
    generateBtn.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            if (employeeStatus.getValue() == null) {
                getWindow().showNotification("Employee Status!", Window.Notification.TYPE_WARNING_MESSAGE);
                return;
            }

            tradeId = cs.getTradeIdByBranchId(getBranchId());
            corporateId = cs.getCorporateIdByTradeId(tradeId);

            summary.setContainerDataSource(
                    new EmployeeSummaryDataContainer(corporateId, employeeStatus.getValue().toString()));
        }
    });
    h.addComponent(generateBtn);
    h.setComponentAlignment(generateBtn, Alignment.BOTTOM_LEFT);

    Button exportTableToExcel = new Button("EXPORT TO EXCEL");
    exportTableToExcel.setWidth("250px");
    exportTableToExcel.addListener(new Button.ClickListener() {

        private static final long serialVersionUID = -73954695086117200L;
        private ExcelExport excelExport;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            excelExport = new ExcelExport(summary, "EMPLOYEE SUMMARY");
            excelExport.excludeCollapsedColumns();
            excelExport.setReportTitle(cs.getCorporateById(corporateId).toUpperCase() + " Employee Summary");
            excelExport.setExportFileName(cs.getCorporateById(corporateId).replace(",", " ").toUpperCase()
                    + "-Employee-Summary-" + ".xls");
            excelExport.export();
        }
    });
    h.addComponent(exportTableToExcel);
    h.setComponentAlignment(exportTableToExcel, Alignment.BOTTOM_LEFT);
    h.setExpandRatio(exportTableToExcel, 3);

    addComponent(h);
    addComponent(summary);
    setExpandRatio(summary, 2);
}

From source file:com.openhris.employee.PostEmploymentInfomation.java

public ComponentContainer layout2() {
    HorizontalLayout hlayout = new HorizontalLayout();
    hlayout.setSpacing(true);//from w w  w  .  j av a 2 s  .c o  m
    hlayout.setWidth("100%");

    GridLayout glayout2 = new GridLayout(2, 2);
    glayout2.setSpacing(true);

    final PopupDateField endDate = new HRISPopupDateField("Exit Date: ");
    endDate.setWidth("250px");
    endDate.setDateFormat("MM/dd/yyyy");
    glayout2.addComponent(endDate, 0, 0);
    glayout2.setComponentAlignment(endDate, Alignment.BOTTOM_LEFT);

    Button endDateBtn = new Button("RESIGN");
    endDateBtn.setWidth("150px");
    endDateBtn.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            if (endDate.getValue() == null || endDate.getValue().toString().trim().isEmpty()) {
                getWindow().showNotification("Enter End Date.", Window.Notification.TYPE_ERROR_MESSAGE);
                return;
            }

            Window window = new ConfirmResignWindow(getEmployeeId(),
                    utilities.convertDateFormat(endDate.getValue().toString().trim().toLowerCase()));
            if (window.getParent() == null) {
                getWindow().addWindow(window);
            }
        }
    });
    glayout2.addComponent(endDateBtn, 1, 0);
    glayout2.setComponentAlignment(endDateBtn, Alignment.BOTTOM_LEFT);
    if (GlobalVariables.getUserRole().equals("administrator") || GlobalVariables.getUserRole().equals("hr")) {
        endDateBtn.setEnabled(true);
    } else {
        endDateBtn.setEnabled(false);
    }

    hlayout.addComponent(glayout2);
    hlayout.setComponentAlignment(glayout2, Alignment.MIDDLE_RIGHT);

    final PopupDateField entryDateFromEmp = new HRISPopupDateField("Entry Date from Employment: ");
    entryDateFromEmp.setWidth("250px");
    entryDateFromEmp.setDateFormat("MM/dd/yyyy");
    entryDateFromEmp.setValue(utilities.parsingDate(employeeService.getEmploymentEntryDate(getEmployeeId())));
    glayout2.addComponent(entryDateFromEmp, 0, 1);
    glayout2.setComponentAlignment(entryDateFromEmp, Alignment.BOTTOM_LEFT);

    Button entryDateFromEmpBtn = new Button("EDIT");
    entryDateFromEmpBtn.setWidth("150px");
    entryDateFromEmpBtn.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            if (!GlobalVariables.getUserRole().equals("administrator")) {
                getWindow().showNotification(
                        "You need to be an ADMINISTRATOR to EDIT date entry of employment.",
                        Window.Notification.TYPE_ERROR_MESSAGE);
                return;
            }

            Window sub = new EditEmploymentDateEntryWindow(getEmployeeId(),
                    utilities.convertDateFormat(entryDateFromEmp.getValue().toString()));
            if (sub.getParent() == null) {
                getWindow().addWindow(sub);
            }
        }
    });
    glayout2.addComponent(entryDateFromEmpBtn, 1, 1);
    glayout2.setComponentAlignment(entryDateFromEmpBtn, Alignment.BOTTOM_LEFT);
    if (GlobalVariables.getUserRole().equals("administrator") || GlobalVariables.getUserRole().equals("hr")) {
        entryDateFromEmpBtn.setEnabled(true);
    } else {
        entryDateFromEmpBtn.setEnabled(false);
    }

    return hlayout;
}

From source file:com.openhris.employee.salary.EmployeeSalaryInformation.java

public ComponentContainer layout() {
    GridLayout glayout = new GridLayout(2, 8);
    glayout.setSpacing(true);//from   w w  w .  j a v a 2  s .c  o m
    glayout.setWidth("600px");
    glayout.setHeight("100%");

    employmentStatus = dropDown.populateEmploymentStatus("Employment Status: ");
    employmentStatus.setWidth("200px");
    glayout.addComponent(employmentStatus, 0, 0);

    Button esBtn = new Button("UPDATE EMPLOYMENT STATUS");
    esBtn.setWidth("100%");
    glayout.addComponent(esBtn, 1, 0);
    esBtn.addListener(buttonClickListener);
    glayout.setColumnExpandRatio(1, 1);
    glayout.setComponentAlignment(esBtn, Alignment.BOTTOM_LEFT);
    if (GlobalVariables.getUserRole().equals("administrator") || GlobalVariables.getUserRole().equals("hr")) {
        esBtn.setEnabled(true);
    } else {
        esBtn.setEnabled(false);
    }

    glayout.addComponent(new Label("<HR>", Label.CONTENT_XHTML), 0, 2, 1, 2);

    employmentWageStatus = dropDown.populateEmploymentWageStatus("Employment Wage Status: ");
    employmentWageStatus.setWidth("200px");
    glayout.addComponent(employmentWageStatus, 0, 3);

    Button ewsBtn = new Button("UPDATE EMPLOYMENT WAGE STATUS");
    ewsBtn.setWidth("100%");
    ewsBtn.addListener(buttonClickListener);
    glayout.addComponent(ewsBtn, 1, 3);
    glayout.setComponentAlignment(ewsBtn, Alignment.BOTTOM_LEFT);
    if (GlobalVariables.getUserRole().equals("administrator") || GlobalVariables.getUserRole().equals("hr")) {
        ewsBtn.setEnabled(true);
    } else {
        ewsBtn.setEnabled(false);
    }

    glayout.addComponent(new Label("<HR>", Label.CONTENT_XHTML), 0, 4, 1, 4);

    employmentWageEntry = dropDown.populateEmploymentWageEntry("Employment Wage Entry: ");
    employmentWageEntry.setWidth("200px");
    glayout.addComponent(employmentWageEntry, 0, 5);

    Button eweBtn = new Button("UPDATE EMPLOYMENT WAGE ENTRY");
    eweBtn.setWidth("100%");
    glayout.addComponent(eweBtn, 1, 5);
    eweBtn.addListener(buttonClickListener);
    glayout.setComponentAlignment(eweBtn, Alignment.BOTTOM_LEFT);
    if (GlobalVariables.getUserRole().equals("administrator") || GlobalVariables.getUserRole().equals("hr")) {
        eweBtn.setEnabled(true);
    } else {
        eweBtn.setEnabled(false);
    }

    glayout.addComponent(new Label("<HR>", Label.CONTENT_XHTML), 0, 6, 1, 6);

    employmentWage = new TextField("Employment Wage");
    employmentWage.setWidth("200px");
    employmentWage.addStyleName("numerical");
    glayout.addComponent(employmentWage, 0, 7);

    Button ewBtn = new Button("UPDATE EMPLOYMENT WAGE");
    ewBtn.setWidth("100%");
    glayout.addComponent(ewBtn, 1, 7);
    ewBtn.addListener(buttonClickListener);
    glayout.setComponentAlignment(ewBtn, Alignment.BOTTOM_LEFT);
    if (GlobalVariables.getUserRole().equals("administrator") || GlobalVariables.getUserRole().equals("hr")) {
        ewBtn.setEnabled(true);
    } else {
        ewBtn.setEnabled(false);
    }

    if (getEmployeeId() != null) {
        EmploymentInformation ei = si.getEmployeeSalaryInformation(getEmployeeId());

        employmentStatus.setValue(
                Constant.getKeyByValue(Constant.MAP_CONSTANT_EMPLOYMENT_STATUS, ei.getEmploymentStatus()));
        employmentWageStatus.setValue(Constant.getKeyByValue(Constant.MAP_CONSTANT_EMPLOYMENT_WAGE_STATUS,
                ei.getEmploymentWageStatus()));
        employmentWageEntry.setValue(Constant.getKeyByValue(Constant.MAP_CONSTANT_EMPLOYMENT_WAGE_ENTRY,
                ei.getEmploymentWageEntry()));
        employmentWage.setValue(ei.getEmploymentWage());
    }

    return glayout;
}

From source file:com.openhris.payroll.contributions.AFLUI.java

public AFLUI(int branchId) {
    this.branchId = branchId;

    setSizeFull();/*from   w w w. j ava  2  s  .  c o  m*/
    setSpacing(true);
    setMargin(new MarginInfo(true, true, false, false));

    HorizontalLayout h = new HorizontalLayout();
    h.setWidth("100%");
    h.setMargin(true);
    h.setSpacing(true);

    final PopupDateField payrollDateField = new HRISPopupDateField("Payroll Month and Year");
    payrollDateField.setWidth("200px");
    h.addComponent(payrollDateField);

    Button generateBtn = new Button("GENERATE AFL");
    generateBtn.setWidth("200px");
    generateBtn.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            tradeId = cs.getTradeIdByBranchId(getBranchId());
            corporateId = cs.getCorporateIdByTradeId(tradeId);

            afl.setContainerDataSource(new AFLContainer(corporateId,
                    util.parsingDate(util.convertDateFormat(payrollDateField.getValue().toString()))));
        }
    });
    h.addComponent(generateBtn);
    h.setComponentAlignment(generateBtn, Alignment.BOTTOM_LEFT);

    Button exportTableToExcel = new Button("EXPORT TO EXCEL");
    exportTableToExcel.setWidth("200px");
    exportTableToExcel.addListener(new Button.ClickListener() {

        private static final long serialVersionUID = -73954695086117200L;
        private ExcelExport excelExport;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            excelExport = new ExcelExport(afl, "AFL Remitance");
            excelExport.excludeCollapsedColumns();
            excelExport.setReportTitle(cs.getCorporateById(corporateId).toUpperCase() + " AFL Remitances");
            excelExport.setExportFileName(
                    cs.getCorporateById(corporateId).replace(",", " ").toUpperCase() + "-AFL-Remitance-"
                            + util.convertDateFormat(payrollDateField.getValue().toString()) + ".xls");
            excelExport.export();
        }

    });
    h.addComponent(exportTableToExcel);
    h.setComponentAlignment(exportTableToExcel, Alignment.BOTTOM_LEFT);
    h.setExpandRatio(exportTableToExcel, 2);

    addComponent(h);
    addComponent(afl);
    setExpandRatio(afl, 2);
}

From source file:com.openhris.payroll.contributions.BankDebitMemoUI.java

public BankDebitMemoUI(int branchId) {
    this.branchId = branchId;

    setSizeFull();/*w w  w .  j a  v  a2s .com*/
    setSpacing(true);
    setMargin(new MarginInfo(true, true, false, false));

    HorizontalLayout h = new HorizontalLayout();
    h.setWidth("100%");
    h.setMargin(true);
    h.setSpacing(true);

    final PopupDateField payrollDateField = new HRISPopupDateField("Payroll Month and Year");
    payrollDateField.setWidth("200px");
    h.addComponent(payrollDateField);

    Button generateBtn = new Button("GENERATE BANK DEBIT MEMO");
    generateBtn.setWidth("200px");
    generateBtn.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            tradeId = cs.getTradeIdByBranchId(getBranchId());
            corporateId = cs.getCorporateIdByTradeId(tradeId);

            Date date = util.parsingDate(util.convertDateFormat(payrollDateField.getValue().toString()));
            Calendar c = Calendar.getInstance();
            c.setTime(date);

            debitMemoTable.setContainerDataSource(
                    new BankDebitMemoContainer(corporateId, util.convertDateFormat(date.toString())));

        }
    });
    h.addComponent(generateBtn);
    h.setComponentAlignment(generateBtn, Alignment.BOTTOM_LEFT);

    Button exportTableToExcel = new Button("EXPORT TO EXCEL");
    exportTableToExcel.setWidth("200px");
    exportTableToExcel.addListener(new Button.ClickListener() {

        private static final long serialVersionUID = -73954695086117200L;
        private ExcelExport excelExport;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            excelExport = new ExcelExport(debitMemoTable, "BANK DEBIT MEMO");
            excelExport.excludeCollapsedColumns();
            excelExport.setReportTitle(cs.getCorporateById(corporateId).toUpperCase() + " Bank Debit Memo");
            excelExport.setExportFileName(
                    cs.getCorporateById(corporateId).replace(",", " ").toUpperCase() + "-Bank-Debit-Memo-"
                            + util.convertDateFormat(payrollDateField.getValue().toString()) + ".xls");
            excelExport.export();
        }
    });
    h.addComponent(exportTableToExcel);
    h.setComponentAlignment(exportTableToExcel, Alignment.BOTTOM_LEFT);
    h.setExpandRatio(exportTableToExcel, 2);

    addComponent(h);
    addComponent(debitMemoTable);
    setExpandRatio(debitMemoTable, 2);
}

From source file:com.openhris.payroll.contributions.HdmfUI.java

public HdmfUI(int branchId) {
    this.branchId = branchId;

    setSizeFull();/*from  ww w .  j av  a2  s  .c om*/
    setSpacing(true);
    setMargin(new MarginInfo(true, true, false, false));

    HorizontalLayout h = new HorizontalLayout();
    h.setWidth("100%");
    h.setMargin(true);
    h.setSpacing(true);

    final PopupDateField payrollDateField = new HRISPopupDateField("Payroll Month and Year");
    payrollDateField.setWidth("200px");
    h.addComponent(payrollDateField);

    Button generateBtn = new Button("GENERATE HDMF SHARE");
    generateBtn.setWidth("200px");
    generateBtn.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            tradeId = cs.getTradeIdByBranchId(getBranchId());
            corporateId = cs.getCorporateIdByTradeId(tradeId);

            Date date = util.parsingDate(util.convertDateFormat(payrollDateField.getValue().toString()));
            Calendar c = Calendar.getInstance();
            c.setTime(date);

            hdmfTable.setContainerDataSource(
                    new HdmfDataContainer(corporateId, (1 + c.get(Calendar.MONTH)), c.get(Calendar.YEAR)));

        }
    });
    h.addComponent(generateBtn);
    h.setComponentAlignment(generateBtn, Alignment.BOTTOM_LEFT);

    Button exportTableToExcel = new Button("EXPORT TO EXCEL");
    exportTableToExcel.setWidth("200px");
    exportTableToExcel.addListener(new Button.ClickListener() {

        private static final long serialVersionUID = -73954695086117200L;
        private ExcelExport excelExport;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            excelExport = new ExcelExport(hdmfTable, "HDMF Remitance");
            excelExport.excludeCollapsedColumns();
            excelExport.setReportTitle(cs.getCorporateById(corporateId).toUpperCase() + " HDMF Remitances");
            excelExport.setExportFileName(
                    cs.getCorporateById(corporateId).replace(",", " ").toUpperCase() + "-HDMF-Remitance-"
                            + util.convertDateFormat(payrollDateField.getValue().toString()) + ".xls");
            excelExport.export();
        }
    });
    h.addComponent(exportTableToExcel);
    h.setComponentAlignment(exportTableToExcel, Alignment.BOTTOM_LEFT);
    h.setExpandRatio(exportTableToExcel, 2);

    addComponent(h);
    addComponent(hdmfTable);
    setExpandRatio(hdmfTable, 2);
}

From source file:com.openhris.payroll.contributions.PhicUI.java

public PhicUI(int branchId) {
    this.branchId = branchId;

    setSizeFull();// w w w.j av  a  2 s  .  com
    setSpacing(true);
    setMargin(new MarginInfo(true, true, false, false));

    HorizontalLayout h = new HorizontalLayout();
    h.setWidth("100%");
    h.setMargin(true);
    h.setSpacing(true);

    final PopupDateField payrollDateField = new HRISPopupDateField("Payroll Month and Year");
    payrollDateField.setWidth("200px");
    h.addComponent(payrollDateField);

    Button generateBtn = new Button("GENERATE PHIC SHARE");
    generateBtn.setWidth("200px");
    generateBtn.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            tradeId = cs.getTradeIdByBranchId(getBranchId());
            corporateId = cs.getCorporateIdByTradeId(tradeId);

            Date date = util.parsingDate(util.convertDateFormat(payrollDateField.getValue().toString()));
            Calendar c = Calendar.getInstance();
            c.setTime(date);

            phicTable.setContainerDataSource(
                    new PhicDataContainer(corporateId, (1 + c.get(Calendar.MONTH)), c.get(Calendar.YEAR)));

        }
    });
    h.addComponent(generateBtn);
    h.setComponentAlignment(generateBtn, Alignment.BOTTOM_LEFT);

    Button exportTableToExcel = new Button("EXPORT TO EXCEL");
    exportTableToExcel.setWidth("200px");
    exportTableToExcel.addListener(new Button.ClickListener() {

        private static final long serialVersionUID = -73954695086117200L;
        private ExcelExport excelExport;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            excelExport = new ExcelExport(phicTable, "PHIC Remitance");
            excelExport.excludeCollapsedColumns();
            excelExport.setReportTitle(cs.getCorporateById(corporateId).toUpperCase() + " PHIC Remitances");
            excelExport.setExportFileName(
                    cs.getCorporateById(corporateId).replace(",", " ").toUpperCase() + "-PHIC-Remitance-"
                            + util.convertDateFormat(payrollDateField.getValue().toString()) + ".xls");
            excelExport.export();
        }
    });
    h.addComponent(exportTableToExcel);
    h.setComponentAlignment(exportTableToExcel, Alignment.BOTTOM_LEFT);
    h.setExpandRatio(exportTableToExcel, 2);

    addComponent(h);
    addComponent(phicTable);
    setExpandRatio(phicTable, 2);
}

From source file:com.openhris.payroll.contributions.SssUI.java

public SssUI(int branchId) {
    this.branchId = branchId;

    setSizeFull();/*from  w  w w.  j a  v a2s.c  o m*/
    setSpacing(true);
    setMargin(new MarginInfo(true, true, false, false));

    HorizontalLayout h = new HorizontalLayout();
    h.setWidth("100%");
    h.setMargin(true);
    h.setSpacing(true);

    final PopupDateField payrollDateField = new HRISPopupDateField("Payroll Month and Year");
    payrollDateField.setWidth("200px");
    h.addComponent(payrollDateField);

    Button generateBtn = new Button("GENERATE SSS SHARE");
    generateBtn.setWidth("200px");
    generateBtn.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            tradeId = cs.getTradeIdByBranchId(getBranchId());
            corporateId = cs.getCorporateIdByTradeId(tradeId);

            Date date = util.parsingDate(util.convertDateFormat(payrollDateField.getValue().toString()));
            Calendar c = Calendar.getInstance();
            c.setTime(date);

            sssTable.setContainerDataSource(
                    new SssDataContainer(corporateId, (1 + c.get(Calendar.MONTH)), c.get(Calendar.YEAR)));

        }
    });
    h.addComponent(generateBtn);
    h.setComponentAlignment(generateBtn, Alignment.BOTTOM_LEFT);

    Button exportTableToExcel = new Button("EXPORT TO EXCEL");
    exportTableToExcel.setWidth("200px");
    exportTableToExcel.addListener(new Button.ClickListener() {

        private static final long serialVersionUID = -73954695086117200L;
        private ExcelExport excelExport;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            excelExport = new ExcelExport(sssTable, "SSS Remitance");
            excelExport.excludeCollapsedColumns();
            excelExport.setReportTitle(cs.getCorporateById(corporateId).toUpperCase() + " SSS Remitances");
            excelExport.setExportFileName(
                    cs.getCorporateById(corporateId).replace(",", " ").toUpperCase() + "-SSS-Remitance-"
                            + util.convertDateFormat(payrollDateField.getValue().toString()) + ".xls");
            excelExport.export();
        }
    });
    h.addComponent(exportTableToExcel);
    h.setComponentAlignment(exportTableToExcel, Alignment.BOTTOM_LEFT);
    h.setExpandRatio(exportTableToExcel, 2);

    addComponent(h);
    addComponent(sssTable);
    setExpandRatio(sssTable, 2);
}

From source file:com.openhris.payroll.contributions.TaxUI.java

public TaxUI(int branchId) {
    this.branchId = branchId;

    setSizeFull();// w w w.j  av a 2  s .co  m
    setSpacing(true);
    setMargin(new MarginInfo(true, true, false, false));

    HorizontalLayout h = new HorizontalLayout();
    h.setWidth("100%");
    h.setMargin(true);
    h.setSpacing(true);

    final PopupDateField payrollDateField = new HRISPopupDateField("Payroll Month and Year");
    payrollDateField.setWidth("200px");
    h.addComponent(payrollDateField);

    Button generateBtn = new Button("GENERATE WITHHOLDING TAX");
    generateBtn.setWidth("200px");
    generateBtn.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            tradeId = cs.getTradeIdByBranchId(getBranchId());
            corporateId = cs.getCorporateIdByTradeId(tradeId);

            Date date = util.parsingDate(util.convertDateFormat(payrollDateField.getValue().toString()));
            Calendar c = Calendar.getInstance();
            c.setTime(date);

            taxTable.setContainerDataSource(new TaxDataContainer(corporateId,
                    util.parsingDate(util.convertDateFormat(payrollDateField.getValue().toString()))));

        }
    });
    h.addComponent(generateBtn);
    h.setComponentAlignment(generateBtn, Alignment.BOTTOM_LEFT);

    Button exportTableToExcel = new Button("EXPORT TO EXCEL");
    exportTableToExcel.setWidth("200px");
    exportTableToExcel.addListener(new Button.ClickListener() {

        private static final long serialVersionUID = -73954695086117200L;
        private ExcelExport excelExport;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            excelExport = new ExcelExport(taxTable, "TAX Remitance");
            excelExport.excludeCollapsedColumns();
            excelExport.setReportTitle(cs.getCorporateById(corporateId).toUpperCase() + " TAX Remitances");
            excelExport.setExportFileName(
                    cs.getCorporateById(corporateId).replace(",", " ").toUpperCase() + "-TAX-Remitance-"
                            + util.convertDateFormat(payrollDateField.getValue().toString()) + ".xls");
            excelExport.export();
        }
    });
    h.addComponent(exportTableToExcel);
    h.setComponentAlignment(exportTableToExcel, Alignment.BOTTOM_LEFT);
    h.setExpandRatio(exportTableToExcel, 2);

    addComponent(h);
    addComponent(taxTable);
    setExpandRatio(taxTable, 2);
}