Example usage for com.vaadin.ui Label addStyleName

List of usage examples for com.vaadin.ui Label addStyleName

Introduction

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

Prototype

@Override
    public void addStyleName(String style) 

Source Link

Usage

From source file:com.cms.utils.CommonUtils.java

/**
 * Build label//w w  w .  j a va 2s.c o m
 *
 * @param value caption of label
 * @param isBold if bold --> label will have bold style
 * @return
 */
public static Label buildLabel(String value, boolean isBold) {
    Label label = new Label();
    label.setWidth("100%");
    label.setHeight("-1px");
    label.setValue(value);
    label.setImmediate(true);
    if (isBold) {
        label.addStyleName("v-label-bold");
    }
    return label;
}

From source file:com.constellio.app.ui.pages.base.MainLayoutImpl.java

private Component buildMessage() {
    String messageText = presenter.getMessage();
    if (StringUtils.isEmpty(messageText)) {
        return null;
    }/*from  w ww  . ja va2 s.co m*/
    Label message = new Label(messageText);
    message.addStyleName("footer-warning");
    message.addStyleName(ValoTheme.LABEL_LARGE);
    message.addStyleName(ValoTheme.LABEL_BOLD);
    return message;
}

From source file:com.constellio.app.ui.pages.base.MainLayoutImpl.java

protected Component buildLicense() {
    boolean showFooter = !"true".equals(System.getProperty("no_footer_message"));
    Label licenseLabel = new Label($("MainLayout.footerLicense"));
    licenseLabel.addStyleName(ValoTheme.LABEL_TINY);
    licenseLabel.setContentMode(ContentMode.HTML);
    licenseLabel.setVisible(showFooter);
    return licenseLabel;
}

From source file:com.constellio.app.ui.pages.management.updates.UpdateManagerViewImpl.java

private Component buildInfoItem(String caption, Object value) {
    Label captionLabel = new Label(caption);
    captionLabel.addStyleName(ValoTheme.LABEL_BOLD);

    Label valueLabel = value instanceof LocalDate ? new LocalDateLabel((LocalDate) value)
            : new Label(value.toString());

    HorizontalLayout layout = new HorizontalLayout(captionLabel, valueLabel);
    layout.setSpacing(true);//from   w  w w.j  a  va2s. com

    return layout;
}

From source file:com.constellio.app.ui.pages.management.updates.UpdateManagerViewImpl.java

private Component buildAvailableUpdateLayout() {
    Label message = new Label($("UpdateManagerViewImpl.updateAvailable", presenter.getUpdateVersion()));
    message.addStyleName(ValoTheme.LABEL_BOLD);

    Button update = new LinkButton($("UpdateManagerViewImpl.updateButton")) {
        @Override/*from   w  ww .j  a va  2s.  c om*/
        protected void buttonClick(ClickEvent event) {
            UI.getCurrent().access(new Thread(UpdateManagerViewImpl.class.getName() + "-updateFromServer") {
                @Override
                public void run() {
                    presenter.updateFromServer();
                }
            });
        }
    };
    update.setVisible(presenter.isUpdateEnabled());

    HorizontalLayout updater = new HorizontalLayout(message, update);
    updater.setComponentAlignment(message, Alignment.MIDDLE_LEFT);
    updater.setComponentAlignment(update, Alignment.MIDDLE_LEFT);
    updater.setSpacing(true);

    Label changelog = new Label(presenter.getChangelog(), ContentMode.HTML);

    VerticalLayout layout = new VerticalLayout(updater, changelog);
    layout.setSpacing(true);
    layout.setWidth("100%");

    return layout;
}

From source file:com.constellio.app.ui.pages.management.updates.UpdateManagerViewImpl.java

private Component buildUpToDateUpdateLayout() {
    Label message = new Label($("UpdateManagerViewImpl.upToDate"));
    message.addStyleName(ValoTheme.LABEL_BOLD);
    return message;
}

From source file:com.constellio.app.ui.pages.management.updates.UpdateManagerViewImpl.java

private Component buildUnlicensedLayout() {
    Label message = new Label($("UpdateManagerViewImpl.unlicensed"));
    message.addStyleName(ValoTheme.LABEL_BOLD);

    Link request = new Link($("UpdateManagerViewImpl.requestLicense"),
            new ExternalResource("mailto:sales@constellio.com?Subject=Demande de license Constellio"));

    VerticalLayout layout = new VerticalLayout(message, request);
    layout.setSpacing(true);//from   w  w  w. ja v a  2s. co  m

    return layout;
}

From source file:com.digitallabs.demos.Vaadin6BootstrapThemeDemo.java

License:Apache License

private void typography(ComponentContainer container) {
    for (int i = 1; i <= 6; i++) {
        Label header = new Label("Bootstrap heading <h" + i + ">");
        header.addStyleName(Bootstrap.Typography.valueOf("H" + i).styleName());
        container.addComponent(header);/*  w  ww . ja  v  a  2s  . c o  m*/
    }

    Label text = new Label(
            "Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.");
    text.addStyleName(Bootstrap.Typography.BODYCOPY.styleName());
    container.addComponent(text);

    text = new Label(
            "Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla.");
    text.addStyleName(Bootstrap.Typography.BODYCOPY.styleName());
    container.addComponent(text);

    text = new Label(
            "Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.");
    text.addStyleName(Bootstrap.Typography.BODYCOPY.styleName());
    container.addComponent(text);

    text = new Label(
            "Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.");
    text.addStyleName(Bootstrap.Typography.LEAD.styleName());
    container.addComponent(text);

    text = new Label(
            "Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.");
    text.addStyleName(Bootstrap.Typography.SMALL.styleName());
    container.addComponent(text);

    text = new Label("Left aligned text");
    text.addStyleName(Bootstrap.Typography.TEXT_LEFT.styleName());
    container.addComponent(text);

    text = new Label("Center aligned text");
    text.addStyleName(Bootstrap.Typography.TEXT_CENTER.styleName());
    container.addComponent(text);

    text = new Label("Right aligned text");
    text.addStyleName(Bootstrap.Typography.TEXT_RIGHT.styleName());
    container.addComponent(text);

    // Colors

    text = new Label("Muted. Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.");
    text.addStyleName(Bootstrap.Typography.TEXT_MUTED.styleName());
    container.addComponent(text);

    text = new Label("Primary. Nullam id dolor id nibh ultricies vehicula ut id elit.");
    text.addStyleName(Bootstrap.Typography.TEXT_PRIMARY.styleName());
    container.addComponent(text);

    text = new Label("Warning. Nullam id dolor id nibh ultricies vehicula ut id elit.");
    text.addStyleName(Bootstrap.Typography.TEXT_WARNING.styleName());
    container.addComponent(text);

    text = new Label("Danger. Nullam id dolor id nibh ultricies vehicula ut id elit.");
    text.addStyleName(Bootstrap.Typography.TEXT_DANGER.styleName());
    container.addComponent(text);

    text = new Label("Success. Nullam id dolor id nibh ultricies vehicula ut id elit.");
    text.addStyleName(Bootstrap.Typography.TEXT_SUCCESS.styleName());
    container.addComponent(text);

    text = new Label("Info. Nullam id dolor id nibh ultricies vehicula ut id elit.");
    text.addStyleName(Bootstrap.Typography.TEXT_INFO.styleName());
    container.addComponent(text);
}

From source file:com.digitallabs.demos.Vaadin6BootstrapThemeDemo.java

License:Apache License

private void forms(ComponentContainer container) {
    VerticalLayout form = new VerticalLayout();
    form.addStyleName(Bootstrap.Forms.FORM.styleName());
    form.setSpacing(true);/*from   w w  w  .  j  a v  a2s. co m*/
    form.setCaption("Legend");

    TextField email = new TextField("Email address");
    email.setInputPrompt("Enter email");
    form.addComponent(email);

    PasswordField password = new PasswordField("Password");
    password.setInputPrompt("Password");
    form.addComponent(password);

    Upload upload = new Upload("File input", null);
    form.addComponent(upload);

    Label help = new Label("Example block-level help text here.");
    help.addStyleName("help-block");
    form.addComponent(help);

    CheckBox check = new CheckBox("Check me out");
    form.addComponent(check);

    Button submit = new Button("Submit");
    submit.addStyleName(Bootstrap.Buttons.DEFAULT.styleName());
    form.addComponent(submit);

    container.addComponent(form);
}

From source file:com.esofthead.mycollab.community.shell.view.components.AboutWindow.java

License:Open Source License

public AboutWindow() {

    MHorizontalLayout content = new MHorizontalLayout().withMargin(true).withFullWidth();
    this.setContent(content);

    Image about = new Image("", new AssetResource(WebResourceIds._about));
    MVerticalLayout rightPanel = new MVerticalLayout();
    ELabel versionLbl = ELabel.h2(String.format("MyCollab Community Edition %s", MyCollabVersion.getVersion()));
    Label javaNameLbl = new Label(String.format("%s, %s", System.getProperty("java.vm.name"),
            System.getProperty("java.runtime.version")));
    Label homeFolderLbl = new Label("Home folder: " + FileUtils.getHomeFolder().getAbsolutePath());
    WebBrowser browser = Page.getCurrent().getWebBrowser();
    Label osLbl = new Label(
            String.format("%s, %s", System.getProperty("os.name"), browser.getBrowserApplication()));
    osLbl.addStyleName(UIConstants.LABEL_WORD_WRAP);
    Div licenseDiv = new Div().appendChild(new Text("Powered by: "))
            .appendChild(new A("https://www.mycollab.com").appendText("MyCollab"))
            .appendChild(new Text(". Open source under GPL license"));
    Label licenseLbl = new Label(licenseDiv.write(), ContentMode.HTML);
    Label copyRightLbl = new Label(String.format("&copy; %s - %s MyCollab Ltd. All rights reserved", "2011",
            new GregorianCalendar().get(Calendar.YEAR) + ""), ContentMode.HTML);
    rightPanel.with(versionLbl, javaNameLbl, osLbl, homeFolderLbl, licenseLbl, copyRightLbl)
            .withAlign(copyRightLbl, Alignment.BOTTOM_LEFT);
    content.with(about, rightPanel).expand(rightPanel);
}