Example usage for com.vaadin.ui Label Label

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

Introduction

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

Prototype

public Label(String text) 

Source Link

Document

Creates a new instance with text content mode and the given text.

Usage

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);/*w w  w.j a v  a 2s  . co  m*/

    return layout;
}

From source file:com.conx.logistics.kernel.ui.editors.vaadin.tests.MyVaadinApplication.java

License:Apache License

@Override
public void init() {
    window = new Window("My Vaadin Application");
    setMainWindow(window);/*from  w  w w  .j a  v a 2  s . c o m*/
    Button button = new Button("Click Me!");
    button.addListener(new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            window.addComponent(new Label("Thank you for clicking!!!"));
        }
    });
    window.addComponent(button);

}

From source file:com.cxplonka.feature.ui.vaadin.DefaultView.java

@PostConstruct
void init() {
    addComponent(new Label("Welcome View"));
}

From source file:com.demo.tutorial.agenda.ui.HelpWindow.java

public HelpWindow() {
    setCaption("Address Book Help");

    VerticalLayout subContent = new VerticalLayout();
    subContent.addComponent(new Label(HELP_HTML_SNIPPET));
    subContent.setMargin(true);/*from ww w. j a  va2  s .  c  o  m*/

    setContent(subContent);

    //DESHABILITAR LA X CERRAR
    setClosable(true); //false

    //DESHABILITAR EL AGRANDAR VENTANA
    setResizable(false);
}

From source file:com.demo.tutorial.agenda.ui.SharingOptions.java

public SharingOptions() {
    setModal(true);/*from   w  w  w  . j  a  v  a2  s. c o  m*/
    setWidth("50%");
    center();

    setCaption("Sharing Options");

    VerticalLayout subContent = new VerticalLayout();
    subContent.addComponent(new Label(SHARING_HTML_SNNIPET));
    subContent.addComponent(new CheckBox("Gmail"));
    subContent.addComponent(new CheckBox(".Mac"));

    Button close = new Button("Ok");
    close.addClickListener(new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            close();
        }
    });
    subContent.addComponent(close);
    setContent(subContent);
}

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

License:Apache License

@Override
public void init() {
    setTheme("bootstrap");

    window = new Window("My Vaadin Application");
    setMainWindow(window);//from  w ww  . j av  a2s.c o  m
    Button button = new Button("Click Me");
    button.addListener(new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            window.addComponent(new Label("Thank you for clicking"));
        }
    });

    CssLayout container = new CssLayout();
    container.setWidth("100%");
    container.addStyleName("container");

    typography(container);
    tables(container);
    forms(container);
    buttons(container);

    window.setContent(container);

}

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);//from www  .ja v  a2 s .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);//w  w w.  ja v  a 2  s.  c  om
    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.dungnv.streetfood.ui.ArticleItemUI.java

private void init() {
    this.addStyleName("item-interator");
    this.setSpacing(true);
    this.setWidth("100%");

    CssLayout horizontal = new CssLayout();
    horizontal.setStyleName("padding-5");
    horizontal.setWidth("100%");
    Responsive.makeResponsive(horizontal);
    this.addComponent(horizontal);

    Image imag = new Image();
    if (!StringUtils.isNullOrEmpty(item.getImageUrl())) {
        imag.setSource(new ExternalResource(item.getImageUrl()));
    }//from   w w w .jav  a2 s .  c  om
    horizontal.addComponent(imag);

    VerticalLayout vlInfo = new VerticalLayout();
    vlInfo.setStyleName("padding-5");
    vlInfo.setWidth("70%");

    horizontal.addComponent(vlInfo);

    lbTitle = new Label(item.getTitle());
    lbTitle.addStyleName("lb-title");
    vlInfo.addComponent(lbTitle);

    lbIntroduce = new Label(item.getShortContent());
    lbIntroduce.setStyleName("lb-description");
    vlInfo.addComponent(lbIntroduce);

    HorizontalLayout htInfo = new HorizontalLayout();
    vlInfo.addComponent(htInfo);

    lbInfo = new Label();
    lbInfo.setCaptionAsHtml(true);
    htInfo.addComponent(lbInfo);

    HorizontalLayout htToolBar = new HorizontalLayout();
    htToolBar.setStyleName("lb-toolbar");
    horizontal.addComponent(htToolBar);

    btnLink = new Button();
    btnLink.setIcon(FontAwesome.LINK);
    btnLink.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnLink.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnLink.setWidth("25px");
    btnLink.setHeight("25px");
    htToolBar.addComponent(btnLink);
    htToolBar.setComponentAlignment(btnLink, Alignment.BOTTOM_RIGHT);

    btnEdit = new Button();
    btnEdit.setIcon(FontAwesome.EDIT);
    btnEdit.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnEdit.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnEdit.setWidth("25px");
    btnEdit.setHeight("25px");
    htToolBar.addComponent(btnEdit);
    htToolBar.setComponentAlignment(btnEdit, Alignment.BOTTOM_RIGHT);

    btnDelete = new Button();
    btnDelete.setIcon(FontAwesome.TIMES);
    btnDelete.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnDelete.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnDelete.setWidth("25px");
    btnDelete.setHeight("25px");
    htToolBar.addComponent(btnDelete);
    htToolBar.setComponentAlignment(btnDelete, Alignment.BOTTOM_RIGHT);
}

From source file:com.dungnv.streetfood.ui.CategoryItemUI.java

private void init() {
    this.addStyleName("item-interator");
    this.setSpacing(true);
    this.setWidth("100%");

    CssLayout horizontal = new CssLayout();
    horizontal.setStyleName("padding-5");
    horizontal.setWidth("100%");
    Responsive.makeResponsive(horizontal);
    this.addComponent(horizontal);

    Image imag = new Image();
    if (!StringUtils.isNullOrEmpty(item.getImageUrl())) {
        imag.setSource(new ExternalResource(item.getImageUrl()));
    }/*from  w ww .j a v  a 2 s.c om*/
    horizontal.addComponent(imag);

    VerticalLayout vlInfo = new VerticalLayout();
    vlInfo.setStyleName("padding-5");
    vlInfo.setWidth("70%");

    horizontal.addComponent(vlInfo);

    lbTitle = new Label(item.getName());
    lbTitle.addStyleName("lb-title");
    if ("1".equals(item.getCategoryStatus())) {
        lbTitle.addStyleName("lb-status-active");
    } else {
        lbTitle.addStyleName("lb-status-inActive");
    }
    vlInfo.addComponent(lbTitle);

    lbDesc = new Label(item.getDescription());
    lbDesc.setStyleName("lb-description");
    vlInfo.addComponent(lbDesc);

    HorizontalLayout htInfo = new HorizontalLayout();
    vlInfo.addComponent(htInfo);

    lbInfo = new Label();
    lbInfo.setCaptionAsHtml(true);
    htInfo.addComponent(lbInfo);

    HorizontalLayout htToolBar = new HorizontalLayout();
    htToolBar.setStyleName("lb-toolbar");
    horizontal.addComponent(htToolBar);

    btnLock = new Button();
    if ("1".equals(item.getCategoryStatus())) {
        btnLock.setIcon(FontAwesome.LOCK);
    } else {
        btnLock.setIcon(FontAwesome.UNLOCK);
    }

    btnLock.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnLock.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnLock.setWidth("25px");
    btnLock.setHeight("25px");
    htToolBar.addComponent(btnLock);
    htToolBar.setComponentAlignment(btnLock, Alignment.BOTTOM_RIGHT);

    btnLink = new Button();
    btnLink.setIcon(FontAwesome.LINK);
    btnLink.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnLink.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnLink.setWidth("25px");
    btnLink.setHeight("25px");
    htToolBar.addComponent(btnLink);
    htToolBar.setComponentAlignment(btnLink, Alignment.BOTTOM_RIGHT);

    btnEdit = new Button();
    btnEdit.setIcon(FontAwesome.EDIT);
    btnEdit.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnEdit.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnEdit.setWidth("25px");
    btnEdit.setHeight("25px");
    htToolBar.addComponent(btnEdit);
    htToolBar.setComponentAlignment(btnEdit, Alignment.BOTTOM_RIGHT);

    btnDelete = new Button();
    btnDelete.setIcon(FontAwesome.TIMES);
    btnDelete.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    btnDelete.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    btnDelete.setWidth("25px");
    btnDelete.setHeight("25px");
    htToolBar.addComponent(btnDelete);
    htToolBar.setComponentAlignment(btnDelete, Alignment.BOTTOM_RIGHT);
}