private void init() {
    VerticalLayout root = new VerticalLayout();

    header = new HorizontalLayout();

    tituloLbl.setStyleName("titlePanel");
    header.addComponent(tituloLbl);
    headerLayout = new HorizontalLayout();
    header.addComponent(headerLayout);

    header.setComponentAlignment(headerLayout, Alignment.MIDDLE_RIGHT);

    header.setStyleName("headerPanel");
    header.setWidth("100%");
    header.setHeight("50px");

    body = new VerticalLayout();
    body.setStyleName("bodyPanel");
    body.setWidth("100%");

    footer = new HorizontalLayout();
    footer.setStyleName("footerPanel");
    footerLayout = new HorizontalLayout();
    footer.addComponent(footerLayout);
    footer.setComponentAlignment(footerLayout, Alignment.MIDDLE_CENTER);

    footer.setWidth("100%");
    footer.setHeight("60px");

    root.addComponent(header);
    root.addComponent(body);
    root.addComponent(footer);

    root.setWidth("100%");

    setCompositionRoot(root);
  }
Пример #2
0
    private Layout createBottomPanel() {
      final HorizontalLayout controlPanel = new HorizontalLayout();
      controlPanel.setMargin(true);
      controlPanel.setStyleName("more-info");
      controlPanel.setHeight("40px");
      controlPanel.setWidth("100%");
      Button moreInfoBtn =
          new Button(
              "More information...",
              new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override
                public void buttonClick(ClickEvent event) {
                  editUserForm.displayAdvancedForm(user);
                }
              });
      moreInfoBtn.addStyleName(UIConstants.THEME_LINK);
      controlPanel.addComponent(moreInfoBtn);
      controlPanel.setComponentAlignment(moreInfoBtn, Alignment.MIDDLE_LEFT);
      return controlPanel;
    }
Пример #3
0
  @Override
  public void init() {
    Window mainWindow = new Window("Test Application");
    Form form = new Form();
    form.setCaption("Form Caption");
    form.setDescription(
        "This is a description of the Form that is "
            + "displayed in the upper part of the form. You normally "
            + "enter some descriptive text about the form and its "
            + "use here.");
    // Add a field and bind it to an named item property.
    form.addField("nom", new TextField("Nom"));
    form.addField("prenom", new TextField("Prenom"));
    form.addField("age", new TextField("Age"));
    // Set the footer layout.
    form.setFooter(new VerticalLayout());

    form.getFooter()
        .addComponent(
            new Label(
                "This is the footer area of the Form. "
                    + "You can use any layout here. "
                    + "This is nice for buttons."));

    // Have a button bar in the footer.
    HorizontalLayout okbar = new HorizontalLayout();
    okbar.setHeight("25px");
    form.getFooter().addComponent(okbar);
    Button okbutton = new Button("OK", form, "commit");
    okbutton.addListener(new OkListener(form));
    okbar.addComponent(okbutton);
    okbar.setComponentAlignment(okbutton, Alignment.TOP_RIGHT);
    Button resetbutton = new Button("Reset", form, "discard");
    resetbutton.addListener(new ResetListener(form));
    okbar.addComponent(resetbutton);
    mainWindow.addComponent(form);
    setMainWindow(mainWindow);
  }