Example usage for com.vaadin.ui TabSheet addComponent

List of usage examples for com.vaadin.ui TabSheet addComponent

Introduction

In this page you can find the example usage for com.vaadin.ui TabSheet addComponent.

Prototype


@Override
public void addComponent(Component c) 

Source Link

Document

Adds a new tab into TabSheet.

Usage

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

public ComponentContainer employeeInformationWindow() {
    TabSheet ts = new TabSheet();
    ts.setSizeFull();//w w w .ja  v  a2 s  . c  om
    ts.addStyleName("bar");

    VerticalLayout vlayout = new VerticalLayout();
    vlayout.setCaption("Personal Information");
    vlayout.addComponent(employeePersonalInformation);
    vlayout.setComponentAlignment(employeePersonalInformation, Alignment.MIDDLE_LEFT);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Address");
    vlayout.addComponent(employeeAddress);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Character Reference");
    vlayout.addComponent(characterReference);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Dependent(s)");
    //   vlayout.addComponent(employeePersonalInformation);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Educational Background");
    //   vlayout.addComponent(employeePersonalInformation);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Post Employment Info");
    vlayout.addComponent(postEmploymentInfomation);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Work History");
    //   vlayout.addComponent(employeePersonalInformation);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Salary Information");
    vlayout.addComponent(employeeSalaryInformation);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Allowance Information");
    vlayout.addComponent(employeeAllowanceInformation);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Other Information");
    vlayout.addComponent(otherInformation);
    ts.addComponent(vlayout);

    return ts;
}

From source file:com.openhris.payroll.AdjustmentWindow.java

public AdjustmentWindow(int payrollId, double amountToBeReceive, double amountReceived, double adjustment) {
    this.payrollId = payrollId;
    this.amountToBeReceive = amountToBeReceive;
    this.amountReceived = amountReceived;
    this.adjustment = adjustment;

    setCaption("ADJUSTMENTS");
    setWidth("400px");

    TabSheet ts = new TabSheet();
    ts.addStyleName("bar");

    VerticalLayout vlayout = new VerticalLayout();
    vlayout.setMargin(true);/*from  w  w  w.jav a  2  s  .c  om*/
    vlayout.setSpacing(true);
    vlayout.setCaption("Post Adjustments");

    final TextField amount = new TextField("Amount: ");
    amount.setWidth("100%");
    vlayout.addComponent(amount);

    final TextField remarks = new TextField("Remarks");
    remarks.setWidth("100%");
    vlayout.addComponent(remarks);

    Button saveAdjustments = new Button("POST ADJUSTMENTS");
    saveAdjustments.setWidth("100%");
    saveAdjustments.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            if (amount.getValue() == null || amount.getValue().toString().trim().isEmpty()) {
                getWindow().showNotification("Enter Amount for adjustment.",
                        Window.Notification.TYPE_WARNING_MESSAGE);
                return;
            } else {
                if (!utilities.checkInputIfDouble(amount.getValue().toString().trim())) {
                    getWindow().showNotification("Enter a numeric value for amount.",
                            Window.Notification.TYPE_ERROR_MESSAGE);
                    return;
                }
            }

            if (remarks.getValue() == null || remarks.getValue().toString().trim().isEmpty()) {
                getWindow().showNotification("Add remarks for adjustment.",
                        Window.Notification.TYPE_ERROR_MESSAGE);
                return;
            }

            double amountForAdjustment = utilities.convertStringToDouble(amount.getValue().toString().trim());
            String remarksForAdjustment = remarks.getValue().toString().trim().toLowerCase();
            boolean result = payrollService.insertAdjustmentToPayroll(getPayrollId(), getAmountToBeReceive(),
                    getAmountReceived(), amountForAdjustment, remarksForAdjustment);
            if (result) {
                adjustmentTable();
                close();
                getWindow().showNotification("Successfully added adjustment.",
                        Window.Notification.TYPE_HUMANIZED_MESSAGE);
            }
        }
    });
    vlayout.addComponent(saveAdjustments);

    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setMargin(true);
    vlayout.setSpacing(true);
    vlayout.setCaption("Adjustments Table");

    Label label = new Label("Remarks: Click ID Column to delete Adjustment");
    vlayout.addComponent(label);

    vlayout.addComponent(adjustmentTable());

    Button closeBtn = new Button("CLOSE");
    closeBtn.setWidth("100%");
    closeBtn.addListener(closeBtnListener);
    vlayout.addComponent(closeBtn);

    ts.addComponent(vlayout);
    addComponent(ts);
}

From source file:dhbw.clippinggorilla.userinterface.windows.PreferencesWindow.java

public PreferencesWindow(User user) {
    //setHeight("480px");
    //setWidth("720px");

    VerticalLayout windowContent = new VerticalLayout();
    windowContent.setWidth("100%");
    windowContent.setHeight("100%");
    windowContent.setMargin(new MarginInfo(true, false, false, false));

    TabSheet preferencesCategories = new TabSheet();
    preferencesCategories.setWidth("100%");
    preferencesCategories.setHeight("100%");
    preferencesCategories.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);
    preferencesCategories.addStyleName(ValoTheme.TABSHEET_ICONS_ON_TOP);
    preferencesCategories.addStyleName(ValoTheme.TABSHEET_CENTERED_TABS);
    windowContent.addComponent(preferencesCategories);
    windowContent.setExpandRatio(preferencesCategories, 1f);

    preferencesCategories.addComponent(buildUserTab(user));
    preferencesCategories.addComponent(buildClippingsTab(user));
    preferencesCategories.addComponent(buildSupportTab(user));
    preferencesCategories.setSelectedTab(0);

    windowContent.addComponent(buildFooter(user));

    setContent(windowContent);/*from   w  w  w . j av  a 2 s . c o  m*/
    setModal(true);
    addCloseShortcut(KeyCode.ENTER, null);
    setResizable(false);
    setClosable(false);
    setHeight("480px");
    setWidth("720px");
}

From source file:facs.ui.ServletUI.java

License:Open Source License

@Override
protected void init(VaadinRequest request) {
    // Date referenceDate = new java.util.Date();
    // BookingModel bookingModel = FacsModelUtil.getNoviceBookingModel(request.getRemoteUser());
    try {//from w  w w. j a va 2s .co  m
        BookingModel bookingModel = FacsModelUtil.getNoviceBookingModel();
        TabSheet tabs = new TabSheet();
        // tabs.addComponent(new Booking(bookingModel, referenceDate));

        // statistics
        Statistics statistics = new Statistics();
        tabs.addComponent(statistics);
        tabs.addComponent(new Settings(null));
        setContent(tabs);
    }

    catch (Exception e) {
        setContent(errorView());
        e.printStackTrace();
    }

}