Example usage for com.vaadin.ui.themes ValoTheme LABEL_FAILURE

List of usage examples for com.vaadin.ui.themes ValoTheme LABEL_FAILURE

Introduction

In this page you can find the example usage for com.vaadin.ui.themes ValoTheme LABEL_FAILURE.

Prototype

String LABEL_FAILURE

To view the source code for com.vaadin.ui.themes ValoTheme LABEL_FAILURE.

Click Source Link

Document

Failure badge style.

Usage

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();/* w  w  w.  ja va 2s  .  c  om*/

    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:by.bigvova.views.AccessDeniedView.java

License:Apache License

public AccessDeniedView() {
    setMargin(true);
    addComponent(message = new Label());
    message.setSizeUndefined();
    message.addStyleName(ValoTheme.LABEL_FAILURE);
}

From source file:by.bigvova.views.ErrorView.java

License:Apache License

public ErrorView() {
    setMargin(true);
    message = new Label();
    addComponent(message);
    message.setSizeUndefined();
    message.addStyleName(ValoTheme.LABEL_FAILURE);
}

From source file:com.example.bbs.vaadin.view.Labels.java

License:Apache License

public Labels() {
    setMargin(true);//from  ww  w  .ja v a2  s  .  c o  m
    addStyleName("content-labels");

    Label h1 = new Label("Labels");
    h1.addStyleName(ValoTheme.LABEL_H1);
    addComponent(h1);

    HorizontalLayout split = new HorizontalLayout();
    split.setWidth("100%");
    addComponent(split);

    VerticalLayout left = new VerticalLayout();
    left.setMargin(new MarginInfo(false, true, false, false));
    split.addComponent(left);

    Label huge = new Label("Huge type for display text.");
    huge.addStyleName(ValoTheme.LABEL_HUGE);
    left.addComponent(huge);

    Label large = new Label(
            "Large type for introductory text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    large.addStyleName(ValoTheme.LABEL_LARGE);
    left.addComponent(large);

    Label h2 = new Label("Subtitle");
    h2.addStyleName(ValoTheme.LABEL_H2);
    left.addComponent(h2);

    Label normal = new Label(
            "Normal type for plain text, with a <a href=\"https://vaadin.com\">regular link</a>. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.",
            ContentMode.HTML);
    left.addComponent(normal);

    Label h3 = new Label("Small Title");
    h3.addStyleName(ValoTheme.LABEL_H3);
    left.addComponent(h3);

    Label small = new Label(
            "Small type for additional text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    small.addStyleName(ValoTheme.LABEL_SMALL);
    left.addComponent(small);

    Label tiny = new Label("Tiny type for minor text.");
    tiny.addStyleName(ValoTheme.LABEL_TINY);
    left.addComponent(tiny);

    Label h4 = new Label("Section Title");
    h4.addStyleName(ValoTheme.LABEL_H4);
    left.addComponent(h4);

    normal = new Label(
            "Normal type for plain text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    left.addComponent(normal);

    Panel p = new Panel("Additional Label Styles");
    split.addComponent(p);

    VerticalLayout right = new VerticalLayout();
    right.setSpacing(true);
    right.setMargin(true);
    p.setContent(right);

    Label label = new Label(
            "Bold type for prominent text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    label.addStyleName(ValoTheme.LABEL_BOLD);
    right.addComponent(label);

    label = new Label(
            "Light type for subtle text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    label.addStyleName(ValoTheme.LABEL_LIGHT);
    right.addComponent(label);

    label = new Label(
            "Colored type for highlighted text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
    label.addStyleName(ValoTheme.LABEL_COLORED);
    right.addComponent(label);

    label = new Label("A label for success");
    label.addStyleName(ValoTheme.LABEL_SUCCESS);
    right.addComponent(label);

    label = new Label("A label for failure");
    label.addStyleName(ValoTheme.LABEL_FAILURE);
    right.addComponent(label);

}

From source file:com.gmail.volodymyrdotsenko.cms.fe.vaadin.LoginUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {
    langRepo.findAll().forEach(e -> {
        langSet.add(e.getCode());//from  w  ww . j  a  va 2  s.c o m
    });

    lang = new ComboBox("Language", langSet);

    getPage().setTitle("CMS");

    FormLayout loginForm = new FormLayout();
    loginForm.setSizeUndefined();

    loginForm.addComponent(userName = new TextField("Username"));
    userName.setRequired(true);
    loginForm.addComponent(passwordField = new PasswordField("Password"));
    passwordField.setRequired(true);
    loginForm.addComponent(rememberMe = new CheckBox("Remember me"));
    loginForm.addComponent(lang);
    lang.setRequired(true);
    lang.setNullSelectionAllowed(false);
    loginForm.addComponent(login = new Button("Login"));
    login.addStyleName(ValoTheme.BUTTON_PRIMARY);
    login.setDisableOnClick(true);
    login.setClickShortcut(ShortcutAction.KeyCode.ENTER);
    login.addClickListener(e -> {
        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(loginForm);
    loginLayout.setComponentAlignment(loginForm, Alignment.TOP_CENTER);

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

    String currentLang = getLocale().getLanguage();
    if (langSet.contains(currentLang))
        lang.select(currentLang);
    else
        lang.select("en");
}

From source file:com.gmail.volodymyrdotsenko.cms.fe.vaadin.views.ErrorView.java

License:Apache License

public ErrorView() {
    setMargin(true);
    addComponent(message = new Label());
    message.setSizeUndefined();
    message.addStyleName(ValoTheme.LABEL_FAILURE);
}

From source file:com.hybridbpm.ui.component.ConfigureWindow.java

License:Apache License

public ConfigureWindow(Component dataLayout, String caption) {
    this.dataLayout = dataLayout;
    setCaption(caption);//from   w w  w .jav  a  2s  . c om

    errorMessage.setVisible(false);
    errorMessage.setStyleName(ValoTheme.LABEL_FAILURE);

    toolbar.setSpacing(true);
    toolbar.addStyleName("toolbar");

    btnOk.addStyleName(ValoTheme.BUTTON_PRIMARY);
    btnOk.addStyleName(ValoTheme.BUTTON_SMALL);
    btnOk.setCaption("OK");
    toolbar.addComponent(btnOk);
    toolbar.setComponentAlignment(btnOk, Alignment.MIDDLE_RIGHT);

    btnClose.setCaption("Close");
    btnClose.addStyleName(ValoTheme.BUTTON_SMALL);

    toolbar.addComponent(btnClose);
    toolbar.setComponentAlignment(btnClose, Alignment.MIDDLE_RIGHT);

    cssLayout.addComponent(this.dataLayout);
    cssLayout.setSizeFull();
    cssLayout.addStyleName("scrollable");

    layout.setSizeFull();
    layout.setMargin(true);
    layout.addComponent(cssLayout);
    layout.setExpandRatio(cssLayout, 1f);
    layout.addComponent(errorMessage);
    layout.addComponent(toolbar);
    layout.setComponentAlignment(toolbar, Alignment.BOTTOM_RIGHT);

    center();
    setResizable(false);
    //        setClosable(false);
    setModal(true);
    addStyleName("no-vertical-drag-hints");
    addStyleName("no-horizontal-drag-hints");
    setContent(layout);
    setWidth(80, Unit.PERCENTAGE);
    setHeight(80, Unit.PERCENTAGE);
}

From source file:de.gedoplan.webclients.vaadin.views.CustomerDetailView.java

public void initNoCustomer() {
    Label error = new Label("Benutzer nicht gefunden !");
    error.setSizeUndefined();/* w w w  .ja va 2  s. c o m*/
    error.setStyleName(ValoTheme.LABEL_FAILURE);
    setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
    addComponent(error);
}

From source file:de.gedoplan.webclients.vaadin.views.ErrorView.java

@Override
public void myenter(ViewChangeListener.ViewChangeEvent event) {
    Label error = new Label("Seite konnte nicht gefunden werden !");
    error.setSizeUndefined();/*from   w  ww .  j a va2  s  .  c o m*/
    error.setStyleName(ValoTheme.LABEL_FAILURE);
    setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
    addComponent(error);
    setSizeFull();
}

From source file:de.uni_tuebingen.qbic.qbicmainportlet.DataHandler.java

License:Open Source License

/**
 * //from w w  w  . j a  va  2 s  .  co m
 * @param statusValues
 * @return
 */
public VerticalLayout createProjectStatusComponentNew(Map<String, Integer> statusValues) {
    VerticalLayout projectStatusContent = new VerticalLayout();
    projectStatusContent.setResponsive(true);
    projectStatusContent.setMargin(true);
    projectStatusContent.setSpacing(true);

    Label planned = new Label();
    Label design = new Label();
    Label raw = new Label();
    Label results = new Label();

    Iterator<Entry<String, Integer>> it = statusValues.entrySet().iterator();

    while (it.hasNext()) {
        Map.Entry<String, Integer> pairs = (Map.Entry<String, Integer>) it.next();

        if ((Integer) pairs.getValue() == 0) {
            Label statusLabel = new Label(pairs.getKey());
            statusLabel.setStyleName(ValoTheme.LABEL_FAILURE);
            statusLabel.setResponsive(true);
            // statusLabel.addStyleName("redicon");
            if (pairs.getKey().equals("Project planned")) {
                planned = statusLabel;
            } else if (pairs.getKey().equals("Experimental design registered")) {
                design = statusLabel;
            } else if (pairs.getKey().equals("Raw data registered")) {
                raw = statusLabel;
            } else if (pairs.getKey().equals("Results registered")) {
                results = statusLabel;
            }
        }

        else {
            Label statusLabel = new Label(pairs.getKey());
            statusLabel.setStyleName(ValoTheme.LABEL_SUCCESS);
            statusLabel.setResponsive(true);

            // statusLabel.addStyleName("greenicon");

            if (pairs.getKey().equals("Project planned")) {
                planned = statusLabel;
            } else if (pairs.getKey().equals("Experimental design registered")) {
                design = statusLabel;
            } else if (pairs.getKey().equals("Raw data registered")) {
                raw = statusLabel;
            } else if (pairs.getKey().equals("Results registered")) {
                results = statusLabel;
            }
        }
    }

    projectStatusContent.addComponent(planned);
    projectStatusContent.addComponent(design);
    projectStatusContent.addComponent(raw);
    projectStatusContent.addComponent(results);

    // ProgressBar progressBar = new ProgressBar();
    // progressBar.setValue((float) finishedExperiments / statusValues.keySet().size());
    // projectStatusContent.addComponent(progressBar);

    return projectStatusContent;
}