private void initLayout() {
        FormLayout loginForm = new FormLayout();
        loginForm.setSizeUndefined();

        loginForm.addComponent(userName = new TextField("Username"));
        loginForm.addComponent(passwordField = new PasswordField("Password"));
        loginForm.addComponent(login = new Button("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.setSizeUndefined();

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

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

        VerticalLayout rootLayout = new VerticalLayout(loginLayout);
        rootLayout.setSizeFull();
        rootLayout.setComponentAlignment(loginLayout, Alignment.MIDDLE_CENTER);
        setCompositionRoot(rootLayout);
        setSizeFull();
    }
  private Component createProfileEditorInvite() {
    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();
    layout.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);

    if (!SettingsManager.get().isSettingsEditorEnabled()) {
      layout.addComponent(
          new Label("No connection profiles defined and you are not allowed to create one."));
    } else {
      Button createProfileLink =
          new Button(
              "Create profile",
              new Button.ClickListener() {
                @Override
                public void buttonClick(Button.ClickEvent event) {
                  addProfile();
                }
              });
      createProfileLink.setStyleName(ValoTheme.BUTTON_LINK);

      Label line1 = new Label("No connection profiles defined.");
      line1.setSizeUndefined();

      VerticalLayout inner = new VerticalLayout();
      inner.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
      inner.addComponents(line1, createProfileLink);

      layout.addComponents(inner);
    }

    return layout;
  }
Exemplo n.º 3
0
  private com.vaadin.ui.Component buildLabels() {
    CssLayout labels = new CssLayout();
    labels.addStyleName("labels");

    Label welcome = new Label("Welcome");
    welcome.setSizeUndefined();
    welcome.addStyleName(ValoTheme.LABEL_H4);
    welcome.addStyleName(ValoTheme.LABEL_COLORED);
    labels.addComponent(welcome);

    Label title = new Label("QuickTickets Dashboard");
    title.setSizeUndefined();
    title.addStyleName(ValoTheme.LABEL_H3);
    title.addStyleName(ValoTheme.LABEL_LIGHT);
    labels.addComponent(title);
    return labels;
  }
  private Component buildPreferencesTab() {
    VerticalLayout root = new VerticalLayout();
    root.setCaption("Preferences");
    root.setIcon(FontAwesome.COGS);
    root.setSpacing(true);
    root.setMargin(true);
    root.setSizeFull();

    Label message = new Label("Not implemented in this demo");
    message.setSizeUndefined();
    message.addStyleName(ValoTheme.LABEL_LIGHT);
    root.addComponent(message);
    root.setComponentAlignment(message, Alignment.MIDDLE_CENTER);

    return root;
  }