Example usage for com.vaadin.ui FormLayout FormLayout

List of usage examples for com.vaadin.ui FormLayout FormLayout

Introduction

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

Prototype

public FormLayout() 

Source Link

Usage

From source file:at.peppol.webgui.app.components.TabInvoicePayment.java

License:Mozilla Public License

public Form createInvoicePayeePartyForm() {
    final Form invoicePayeePartyForm = new Form(new FormLayout(), new InvoicePaymentFieldFactory());
    invoicePayeePartyForm.setImmediate(true);

    invoicePayeePartyForm.addItemProperty("Payee ID",
            new NestedMethodProperty(payeeParty.getPartyIdentification().get(0), "ID.value"));
    invoicePayeePartyForm.addItemProperty("Payee Name",
            new NestedMethodProperty(payeeParty.getPartyName().get(0), "Name.value"));
    invoicePayeePartyForm.addItemProperty("Legal Entity ID",
            new NestedMethodProperty(payeeParty.getPartyLegalEntity().get(0), "CompanyID.value"));

    return invoicePayeePartyForm;

}

From source file:at.peppol.webgui.app.components.TabInvoicePayment.java

License:Mozilla Public License

public Form createInvoicePaymentTermsForm() {
    final Form invoicePaymentTermsForm = new Form(new FormLayout(), new InvoicePaymentFieldFactory());
    invoicePaymentTermsForm.setImmediate(true);

    invoicePaymentTermsForm.addItemProperty("Payment Terms",
            new NestedMethodProperty(paymentTermsItem.getNote().get(0), "value"));

    return invoicePaymentTermsForm;

}

From source file:at.peppol.webgui.app.components.TabInvoiceTaxTotal.java

License:Mozilla Public License

public Form createInvoiceTaxTotalTopForm() {
    invoiceTaxTotalTopForm = new Form(new FormLayout(), new InvoiceTaxTotalFieldFactory());
    invoiceTaxTotalTopForm.setImmediate(true);

    NestedMethodProperty nmp = new NestedMethodProperty(taxTotalItem.getTaxAmount(), "value");
    nmp.setValue(addTaxSubTotals());/*from   w w  w . j  a  va 2 s  .  c o m*/
    invoiceTaxTotalTopForm.addItemProperty("Tax Total Amount", nmp);

    return invoiceTaxTotalTopForm;
}

From source file:at.peppol.webgui.app.components.TabInvoiceTaxTotal.java

License:Mozilla Public License

public Form createInvoiceTaxSubtotalForm() {
    final Form invoiceTaxSubtotalForm = new Form(new FormLayout(), new InvoiceTaxTotalFieldFactory());
    invoiceTaxSubtotalForm.setImmediate(true);

    final NestedMethodProperty mp = new NestedMethodProperty(taxSubtotalItem, "TableLineID");
    if (!editMode) {
        // taxSubtotalItem.setTableLineID (String.valueOf (taxSubtotalList.size ()
        // + 1));
        taxSubtotalItem.setTableLineID("");
    } else {/*from   www .  ja va  2 s  .c o m*/
        mp.setReadOnly(true);
    }

    invoiceTaxSubtotalForm.addItemProperty("Line ID #", mp);
    invoiceTaxSubtotalForm.addItemProperty("Taxable Amount",
            new NestedMethodProperty(taxSubtotalItem, "TaxSubTotalTaxableAmount"));
    invoiceTaxSubtotalForm.addItemProperty("Tax Amount",
            new NestedMethodProperty(taxSubtotalItem, "TaxSubTotalTaxAmount"));
    invoiceTaxSubtotalForm.addItemProperty("Tax Category ID",
            new NestedMethodProperty(taxSubtotalItem, "TaxSubTotalCategoryID"));
    invoiceTaxSubtotalForm.addItemProperty("Tax Category Percent",
            new NestedMethodProperty(taxSubtotalItem, "TaxSubTotalCategoryPercent"));
    invoiceTaxSubtotalForm.addItemProperty("Tax Exemption Reason Code",
            new NestedMethodProperty(taxSubtotalItem, "TaxSubTotalCategoryExemptionReasonCode"));
    invoiceTaxSubtotalForm.addItemProperty("Tax Exemption Reason",
            new NestedMethodProperty(taxSubtotalItem, "TaxSubTotalCategoryExemptionReason"));
    invoiceTaxSubtotalForm.addItemProperty("Tax Scheme ID",
            new NestedMethodProperty(taxSubtotalItem, "TaxSubTotalCategoryTaxSchemeID"));

    return invoiceTaxSubtotalForm;
}

From source file:at.peppol.webgui.app.LoginWindow.java

License:Mozilla Public License

private void init() {

    HorizontalLayout h1 = new HorizontalLayout();
    h1.setSizeFull();//ww  w.  ja  v  a 2  s. co  m

    FormLayout fl = new FormLayout();
    fl.setSizeUndefined();
    usernameField = new TextField("Username:");
    usernameField.setImmediate(true);
    fl.addComponent(usernameField);
    passwordField = new PasswordField("Password:");
    passwordField.setImmediate(true);
    fl.addComponent(passwordField);

    Button loginButton = new Button("Login");
    loginButton.addStyleName("default");
    loginButton.addListener(this);
    fl.addComponent(loginButton);
    loginButton.setClickShortcut(KeyCode.ENTER);

    h1.addComponent(fl);
    h1.setComponentAlignment(fl, Alignment.MIDDLE_CENTER);
    addComponent(h1);

}

From source file:be.rvponp.build.CommitViewerUI.java

License:Apache License

private HorizontalLayout createFiltersLayout(Table table, VerticalLayout files, VerticalLayout filesLayout) {
    HorizontalLayout filtersLayout = new HorizontalLayout();

    FormLayout formReleaseLayout = new FormLayout();
    fromVersion = new ComboBox("From release");
    toVersion = new ComboBox("To release");
    filtersLayout.addComponent(formReleaseLayout);
    formReleaseLayout.setDescription("formReleaseLayout");

    formReleaseLayout.addComponent(fromVersion);
    formReleaseLayout.addComponent(toVersion);
    formReleaseLayout.setSizeUndefined();

    //        FormLayout jiraTreeLayout = new FormLayout();
    final Tree tree = createTreeComponent();
    //        jiraTreeLayout.addComponent(tree);
    filtersLayout.addComponent(tree);//from ww  w .ja v  a2s .c o m

    CheckBox jiraParsing = new CheckBox("Jira Parsing");
    jiraParsing.setValue(true);
    //        filtersLayout.addComponent(jiraParsing);

    FormLayout buttonsLayout = new FormLayout();
    CompareButton compareButton = new CompareButton(fromVersion, toVersion, table, files, jiraParsing, tree,
            filesLayout);
    RefreshButton refreshButton = new RefreshButton(this, fromVersion, toVersion);
    //        refreshButton.buttonClick(null);
    //        compareButton.buttonClick(null);
    buttonsLayout.addComponent(refreshButton);
    buttonsLayout.addComponent(compareButton);
    buttonsLayout.setSizeUndefined();
    filtersLayout.addComponent(buttonsLayout);
    filtersLayout.setSizeUndefined();
    return filtersLayout;
}

From source file:by.bigvova.LoginUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {
    getPage().setTitle("Vaadin Shared Security Demo Login");

    FormLayout loginForm = new FormLayout();
    loginForm.setSizeUndefined();/*from   w w  w.j  a  va 2s  .c o m*/

    userName = new TextField("Username");
    passwordField = new PasswordField("Password");
    rememberMe = new CheckBox("Remember me");
    login = new Button("Login");
    Label label = new Label("Name: User / Password: password");
    loginForm.addComponent(userName);
    loginForm.addComponent(passwordField);
    loginForm.addComponent(rememberMe);
    loginForm.addComponent(login);
    login.addStyleName(ValoTheme.BUTTON_PRIMARY);
    login.setDisableOnClick(true);
    login.setClickShortcut(ShortcutAction.KeyCode.ENTER);
    login.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            login();
        }
    });

    VerticalLayout loginLayout = new VerticalLayout();
    loginLayout.setSpacing(true);
    loginLayout.setSizeUndefined();

    if (request.getParameter("logout") != null) {
        loggedOutLabel = new Label("You have been logged out!");
        loggedOutLabel.addStyleName(ValoTheme.LABEL_SUCCESS);
        loggedOutLabel.setSizeUndefined();
        loginLayout.addComponent(loggedOutLabel);
        loginLayout.setComponentAlignment(loggedOutLabel, Alignment.BOTTOM_CENTER);
    }

    loginLayout.addComponent(loginFailedLabel = new Label());
    loginLayout.setComponentAlignment(loginFailedLabel, Alignment.BOTTOM_CENTER);
    loginFailedLabel.setSizeUndefined();
    loginFailedLabel.addStyleName(ValoTheme.LABEL_FAILURE);
    loginFailedLabel.setVisible(false);

    loginLayout.addComponent(label);
    loginLayout.addComponent(loginForm);
    loginLayout.setComponentAlignment(loginForm, Alignment.TOP_CENTER);

    VerticalLayout rootLayout = new VerticalLayout(loginLayout);
    rootLayout.setSizeFull();
    rootLayout.setComponentAlignment(loginLayout, Alignment.MIDDLE_CENTER);
    setContent(rootLayout);
    setSizeFull();
}

From source file:ch.bfh.ti.soed.hs16.srs.black.view.loginView.LoginView.java

License:Open Source License

public LoginView() {
    usernameField = new TextField("Username");
    usernameField.setIcon(FontAwesome.USER);
    usernameField.setWidth(12, Unit.EM);
    passwordField = new PasswordField("Password");
    passwordField.setIcon(FontAwesome.KEY);
    passwordField.setWidth(12, Unit.EM);
    loginButton = new Button("Login");
    loginButton.setWidth(5, Unit.EM);// w  ww  .  j  a  v a  2s.c  o m
    loginButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
    signUpButton = new Button("Sign Up");
    signUpButton.setWidth(6, Unit.EM);

    VerticalLayout layout = new VerticalLayout();
    HorizontalLayout layoutButtons = new HorizontalLayout(loginButton, signUpButton);
    layoutButtons.setSpacing(true);
    Panel panel = new Panel("Login - Smart ReservationEntity System");
    panel.setSizeUndefined();
    layout.addComponent(panel);

    FormLayout content = new FormLayout();
    content.addComponents(usernameField, passwordField, layoutButtons);
    content.setSizeFull();
    content.setMargin(true);
    panel.setContent(content);

    setCompositionRoot(layout);

    layout.setComponentAlignment(panel, Alignment.MIDDLE_CENTER);
    layout.setMargin(new MarginInfo(true, false, false, false));
}

From source file:ch.bfh.ti.soed.hs16.srs.black.view.reservationView.ReservationMakeView.java

License:Open Source License

public ReservationMakeView() {
    fromField = new DateField("Start Date");
    fromField.setLocale(new Locale("de", "DE"));
    fromField.setResolution(Resolution.MINUTE);
    fromField.setDateFormat("dd.MM.yyyy HH:mm");
    fromField.setIcon(FontAwesome.CALENDAR);
    fromField.setWidth(12, Unit.EM);/*from  www. jav a2s  .  com*/
    toField = new DateField("End Date");
    toField.setLocale(new Locale("de", "DE"));
    toField.setResolution(Resolution.MINUTE);
    toField.setDateFormat("dd.MM.yyyy HH:mm");
    toField.setIcon(FontAwesome.CALENDAR);
    toField.setWidth(12, Unit.EM);
    roomSelect = new NativeSelect("Room Number");
    roomSelect.setIcon(FontAwesome.BED);
    roomSelect.setNullSelectionAllowed(true);
    roomSelect.setImmediate(true);
    makeReservationButton = new Button("Make Reservation", FontAwesome.CHECK);
    makeReservationButton.setWidth(12, Unit.EM);
    logoutButton = new Button("Logout");

    Panel panel = new Panel("Create New Reservation");
    FormLayout content = new FormLayout();
    content.addComponents(fromField, toField, roomSelect, makeReservationButton);
    content.setSizeUndefined();
    content.setMargin(true);
    VerticalLayout formAndLogout = new VerticalLayout(content, logoutButton);
    formAndLogout.setMargin(true);
    panel.setContent(formAndLogout);
    makeViewLayout = new VerticalLayout(panel);
    makeViewLayout.setSizeUndefined();
    makeViewLayout.setMargin(true);
}

From source file:ch.bfh.ti.soed.hs16.srs.black.view.signUpView.SignUpView.java

License:Open Source License

public SignUpView() {
    usernameField = new TextField("Username");
    usernameField.setIcon(FontAwesome.USER);
    usernameField.setWidth(12, Unit.EM);
    passwordField = new PasswordField("Password");
    passwordField.setIcon(FontAwesome.KEY);
    passwordField.setWidth(12, Unit.EM);
    passwordFieldRepeat = new PasswordField("Repeat Password");
    passwordFieldRepeat.setIcon(FontAwesome.KEY);
    passwordFieldRepeat.setWidth(12, Unit.EM);
    addUserButton = new Button("Add New User");
    addUserButton.setWidth(12, Unit.EM);
    goBackButton = new Button("Back");

    VerticalLayout layout = new VerticalLayout();
    Panel panel = new Panel("Sign Up - Smart ReservationEntity System");
    panel.setSizeUndefined();// ww w  . j a va 2  s . c o  m
    layout.addComponent(panel);

    FormLayout content = new FormLayout();
    content.addComponents(usernameField, passwordField, passwordFieldRepeat, addUserButton);
    content.setSizeUndefined();
    content.setMargin(true);
    VerticalLayout formAndBack = new VerticalLayout(content, goBackButton);
    formAndBack.setMargin(true);
    panel.setContent(formAndBack);

    setCompositionRoot(layout);

    layout.setComponentAlignment(panel, Alignment.MIDDLE_CENTER);
    layout.setMargin(new MarginInfo(true, false, false, false));
}