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.terralcode.gestion.frontend.view.widgets.appointment.AppointmentView.java

private void buildAppointmentStatus() {
    Label section = new Label("Estado");
    section.addStyleName(ValoTheme.LABEL_H4);
    section.addStyleName(ValoTheme.LABEL_COLORED);
    rootLayout.addComponent(section);/*  w  w w  .  ja va  2  s.c om*/

    status = new ComboBox();
    status.setContainerDataSource(containerStatuses);
    status.setWidth("100%");
    status.setTextInputAllowed(false);
    status.setNullSelectionAllowed(false);

    notifyChanges = new CheckBox();
    notifyChanges.setIcon(FontAwesome.BELL);
    notifyChanges.setImmediate(true);

    HorizontalLayout statusWrapper = new HorizontalLayout();
    statusWrapper.setCaption("Estado");
    statusWrapper.addComponent(status);
    statusWrapper.addComponent(notifyChanges);
    statusWrapper.setWidth("100%");
    statusWrapper.setExpandRatio(status, 1);
    rootLayout.addComponent(statusWrapper);

    statusNotes = new TextArea("Notas de estado");
    statusNotes.setWidth("100%");
    statusNotes.setInputPrompt("Anotaciones del estado...");
    rootLayout.addComponent(statusNotes);
}

From source file:com.toptal.ui.view.LoginView.java

License:Open Source License

/**
 * Generates a header./*from w w w.jav  a  2s. com*/
 * @return Header.
 */
private Component header() {
    final Label greetings = new Label("Welcome to Jogging Tracker");
    greetings.addStyleName(ValoTheme.LABEL_H1);
    greetings.addStyleName(ValoTheme.LABEL_COLORED);
    return greetings;
}

From source file:com.vaadin.uitest.Accordions.java

License:Apache License

public Accordions() {
    setSpacing(false);/*from   w  w  w .  j  a v  a 2s  .  c  om*/

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

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

    row.addComponent(getAccordion("Normal"));

    Accordion ac = getAccordion("Borderless");
    ac.addStyleName(ValoTheme.ACCORDION_BORDERLESS);
    row.addComponent(ac);

}

From source file:com.wintindustries.pfserver.interfaces.view.dashboard.DashboardMenu.java

private Component buildFolderTree() {

    CssLayout treeLayout = new CssLayout();
    treeLayout.setWidth("100%");
    if (treeLayout.getComponentCount() > 0) {
        treeLayout.removeAllComponents();
    }/* w  w  w . j  av  a  2 s . co m*/

    System.out.println("Init Dataasource");

    for (PFDataSource source : PFCore.core.getDataSources()) {
        System.out.println("NEW TREE");

        Label label = new Label(source.getName(), ContentMode.HTML);
        label.setPrimaryStyleName("valo-menu-subtitle");
        label.addStyleName("h4");

        label.setSizeUndefined();
        treeLayout.addComponent(label);
        //      label.setIcon(FontAwesome.LAPTOP);
        treeLayout.addStyleName("valo-menuitems");

        Tree tree = new Tree();
        //tree.setIcon(FontAwesome.LAPTOP);
        // tree.setWidth("100%");

        // container.setItemSorter(new l);

        source.Session().OpenSession();
        source.Session().getSession().beginTransaction();
        source.Session().getSession().getTransaction().setTimeout(4);

        System.out.println(": " + source.getDatabase().getSessionManager());

        Set<PFFolder> rootFolders = PFLocation.getRootDirectoriesFromDatabase(source.getDatabase());

        System.out.println(": " + source.getDatabase().getSessionManager());

        final PFFolderProxyContainer container = new PFFolderProxyContainer(rootFolders, source);

        container.setSortAlphabetic(true);
        tree.setContainerDataSource(container);
        tree.setItemCaptionMode(AbstractSelect.ItemCaptionMode.PROPERTY);
        tree.setItemCaptionPropertyId("Name");
        tree.setItemIconPropertyId("Icon");

        ItemClickListener treeclick;
        treeclick = new ItemClickListener() {

            @Override
            public void itemClick(final ItemClickEvent event) {

                //  Notification note = new Notification("Notificaton", event.getItemId().toString(), Notification.Type.ERROR_MESSAGE);
                // note.show(Page.getCurrent());
                PFFolderProxy proxyFolder = (PFFolderProxy) event.getItemId();
                MyUI.getPFNavigator().navigateTo(MyUI.PAGE_FOLDERVIEW + "/" + proxyFolder.getIdentifier());
            }
        };

        tree.addItemClickListener(treeclick);

        // Allow all nodes to have children
        //   .dashboard-menu-folder-wrapper
        // all these wrappers are a hacky workaround to a Vaadin CSS glitch
        CssLayout treeWrapper = new CssLayout();
        treeWrapper.setStyleName(".dashboard-menu-folder-wrapper");
        treeWrapper.addComponent(tree);
        treeWrapper.setWidth("40px");
        tree.setWidth("800px");
        tree.setStyleName(".dashboard-menu-folder-tree");

        treeLayout.addComponent(treeWrapper);
        source.Session().getSession().getTransaction().commit();
        source.getDatabase().getSessionManager().CloseSession();
    }

    return treeLayout;

}

From source file:com.wintindustries.pfserver.interfaces.view.dashboard.EmptyView.java

public EmptyView() {

    setSizeFull();//from w  w  w. ja v  a 2 s. c  o m

    Label label = new Label("Nothing Selected");
    addComponent(label);
    setComponentAlignment(label, Alignment.MIDDLE_CENTER);
    label.setSizeUndefined();
    label.addStyleName(ValoTheme.LABEL_H1);
    label.addStyleName(ValoTheme.LABEL_LIGHT);
}

From source file:com.wintindustries.pfserver.interfaces.view.dashboard.LoadingView.java

public LoadingView() {
    setSizeFull();/*from  w  ww.  j  a  va 2s . c  om*/
    VerticalLayout center = new VerticalLayout();
    this.addComponent(center);
    this.setComponentAlignment(center, Alignment.MIDDLE_CENTER);

    center.setHeight("180px");
    HorizontalLayout info = new HorizontalLayout();

    Label title = new Label("PFServer Dashboard");
    title.setSizeUndefined();
    title.addStyleName(ValoTheme.LABEL_H4);
    title.addStyleName(ValoTheme.LABEL_COLORED);
    // center.addComponent(title);
    // center.setComponentAlignment(title, Alignment.BOTTOM_CENTER);
    Label loading = new Label("Initalizing");
    loading.addStyleName(ValoTheme.LABEL_H1);
    loading.addStyleName(ValoTheme.LABEL_LIGHT);
    info.addComponent(loading);
    info.addComponent(title);
    info.setComponentAlignment(title, Alignment.MIDDLE_RIGHT);

    center.addComponent(info);
    info.setComponentAlignment(loading, Alignment.MIDDLE_LEFT);
    loading.setWidth("160px");

    center.setComponentAlignment(info, Alignment.MIDDLE_CENTER);
    // center.addComponent(loading);
    // center.setComponentAlignment(loading, Alignment.TOP_CENTER);
    ProgressBar indeterminate = new ProgressBar();
    indeterminate.setIndeterminate(true);
    center.addComponent(indeterminate);
    center.setComponentAlignment(indeterminate, Alignment.TOP_CENTER);

}

From source file:com.wintindustries.pfserver.interfaces.view.dashboard.LoginView.java

private Component buildLabels() {
    CssLayout labels = new CssLayout();
    labels.addStyleName("labels");

    Label welcome = new Label("Welcome");
    welcome.setSizeUndefined();// w  w  w .j  a v a  2  s. c o  m
    welcome.addStyleName(ValoTheme.LABEL_H4);
    welcome.addStyleName(ValoTheme.LABEL_COLORED);
    labels.addComponent(welcome);

    Label title = new Label("PFServer Dashboard");
    title.setSizeUndefined();
    title.addStyleName(ValoTheme.LABEL_H3);
    title.addStyleName(ValoTheme.LABEL_LIGHT);
    labels.addComponent(title);
    return labels;
}

From source file:de.catma.ui.repository.RepositoryView.java

License:Open Source License

private Component createDocumentsLabel() {
    HorizontalLayout labelLayout = new HorizontalLayout();
    labelLayout.setWidth("100%");
    labelLayout.setSpacing(true);/*  ww w .ja  v  a  2 s  . c o m*/

    Label documentsLabel = new Label("Document Manager");
    documentsLabel.addStyleName("bold-label");

    labelLayout.addComponent(documentsLabel);
    labelLayout.setExpandRatio(documentsLabel, 1.0f);
    btAdmin = new Button("Admin");
    btAdmin.addStyleName("icon-button"); // for top-margin
    btAdmin.setVisible(repository.getUser().getRole().equals(Role.ADMIN));

    labelLayout.addComponent(btAdmin);
    labelLayout.setComponentAlignment(btAdmin, Alignment.MIDDLE_RIGHT);

    btReload = new Button("");
    btReload.setIcon(new ClassResource("ui/resources/icon-reload.gif", getApplication()));
    btReload.addStyleName("icon-button");
    labelLayout.addComponent(btReload);
    labelLayout.setComponentAlignment(btReload, Alignment.MIDDLE_RIGHT);

    Label helpLabel = new Label();
    helpLabel.setIcon(new ClassResource("ui/resources/icon-help.gif", getApplication()));
    helpLabel.setWidth("20px");
    helpLabel.setDescription("<h3>Hints</h3>" + "<h4>First steps</h4>" + "<h5>Adding a Source Document</h5>"
            + "You can add a Source Document by clicking the \"Add Source Document\"-button. "
            + "A Source Document can be a web resource pointed to by the URL or you can upload a document from your computer. "
            + "<h5>Tagging a Source Document</h5>"
            + "When you add your first Source Document, CATMA generates a set of example items to get you going: "
            + "<ul><li>A User Markup Collection to hold your markup</li><li>A Tag Library with an example Tagset that contains an example Tag</li></ul> "
            + "To start tagging a Source Document, just select the example User Markup Collection from the tree and click the \"Open User Markup Collection\"-button. "
            + "Then follow the instructions given to you by the Tagger component."
            + "<h5>Analyze a Source Document</h5>"
            + "To analyze a Source Document, just select that document from the tree and click \"Analyze Source Document\" in the \"More Actions\"-menu."
            + "Then follow the instructions given to you by the Analyzer component.");

    labelLayout.addComponent(helpLabel);
    labelLayout.setComponentAlignment(helpLabel, Alignment.MIDDLE_RIGHT);

    return labelLayout;
}

From source file:de.catma.ui.Slider.java

License:Open Source License

public Slider(String caption, int min, int max, final String unit) {
    this.setCaption(caption);
    setSizeUndefined();// w  w w  . ja  v  a2 s . c  o  m
    HorizontalLayout sliderLayout = new HorizontalLayout();
    sliderLayout.setSpacing(true);
    this.sliderComp = new SliderComp(min, max);
    minLabel = new Label(String.valueOf(min));
    maxLabel = new Label(String.valueOf(max));

    sliderLayout.addComponent(minLabel);
    sliderLayout.addComponent(sliderComp);
    sliderLayout.addComponent(maxLabel);

    addComponent(sliderLayout);
    setComponentAlignment(sliderLayout, Alignment.MIDDLE_CENTER);

    final Label current = new Label(sliderComp.getValue().toString());
    current.setWidth("100%");

    current.addStyleName("slider-centered-text");

    addComponent(current);
    setComponentAlignment(current, Alignment.MIDDLE_CENTER);

    sliderComp.addListener(new ValueChangeListener() {

        public void valueChange(ValueChangeEvent event) {
            current.setValue(event.getProperty().getValue() + (unit.isEmpty() ? "" : " ") + unit);
        }
    });

}

From source file:de.escidoc.admintool.view.EscidocPagedTable.java

License:Open Source License

public HorizontalLayout createControls() {
    // final Label itemsPerPageLabel = new Label("Items per page:");
    final Label pageLabel = new Label("Page:&nbsp;", Label.CONTENT_XHTML);
    final TextField currentPageTextField = new TextField();
    currentPageTextField.setValue(String.valueOf(getCurrentPage()));
    currentPageTextField.addValidator(new IntegerValidator(null));
    final Label separatorLabel = new Label("&nbsp;/&nbsp;", Label.CONTENT_XHTML);
    final Label totalPagesLabel = new Label(String.valueOf(getTotalAmountOfPages()), Label.CONTENT_XHTML);
    currentPageTextField.setStyleName(Reindeer.TEXTFIELD_SMALL);
    currentPageTextField.setImmediate(true);
    currentPageTextField.addListener(new ValueChangeListener() {
        private static final long serialVersionUID = -2255853716069800092L;

        public void valueChange(final com.vaadin.data.Property.ValueChangeEvent event) {
            if (currentPageTextField.isValid() && currentPageTextField.getValue() != null) {
                @SuppressWarnings("boxing")
                final int page = Integer.valueOf(String.valueOf(currentPageTextField.getValue()));
                setCurrentPage(page);//  w w  w.  ja  v  a 2s . c o m
            }
        }
    });
    pageLabel.setWidth(null);
    currentPageTextField.setWidth("20px");
    separatorLabel.setWidth(null);
    totalPagesLabel.setWidth(null);

    final HorizontalLayout controlBar = new HorizontalLayout();
    final HorizontalLayout pageSize = new HorizontalLayout();
    final HorizontalLayout pageManagement = new HorizontalLayout();
    final Button first = new Button("<<", new ClickListener() {
        private static final long serialVersionUID = -355520120491283992L;

        public void buttonClick(final ClickEvent event) {
            setCurrentPage(0);
        }
    });
    final Button previous = new Button("<", new ClickListener() {
        private static final long serialVersionUID = -355520120491283992L;

        public void buttonClick(final ClickEvent event) {
            previousPage();
        }
    });
    final Button next = new Button(">", new ClickListener() {
        private static final long serialVersionUID = -1927138212640638452L;

        public void buttonClick(final ClickEvent event) {
            nextPage();
        }
    });
    final Button last = new Button(">>", new ClickListener() {
        private static final long serialVersionUID = -355520120491283992L;

        public void buttonClick(final ClickEvent event) {
            setCurrentPage(getTotalAmountOfPages());
        }
    });
    first.setStyleName(BaseTheme.BUTTON_LINK);
    previous.setStyleName(BaseTheme.BUTTON_LINK);
    next.setStyleName(BaseTheme.BUTTON_LINK);
    last.setStyleName(BaseTheme.BUTTON_LINK);

    pageLabel.addStyleName("pagedtable-pagecaption");
    currentPageTextField.addStyleName("pagedtable-pagefield");
    separatorLabel.addStyleName("pagedtable-separator");
    totalPagesLabel.addStyleName("pagedtable-total");
    first.addStyleName("pagedtable-first");
    previous.addStyleName("pagedtable-previous");
    next.addStyleName("pagedtable-next");
    last.addStyleName("pagedtable-last");

    pageLabel.addStyleName("pagedtable-label");
    currentPageTextField.addStyleName("pagedtable-label");
    separatorLabel.addStyleName("pagedtable-label");
    totalPagesLabel.addStyleName("pagedtable-label");
    first.addStyleName("pagedtable-button");
    previous.addStyleName("pagedtable-button");
    next.addStyleName("pagedtable-button");
    last.addStyleName("pagedtable-button");

    pageSize.setSpacing(true);
    pageManagement.addComponent(first);
    pageManagement.addComponent(previous);
    pageManagement.addComponent(pageLabel);
    pageManagement.addComponent(currentPageTextField);
    pageManagement.addComponent(separatorLabel);
    pageManagement.addComponent(totalPagesLabel);
    pageManagement.addComponent(next);
    pageManagement.addComponent(last);
    pageManagement.setComponentAlignment(first, Alignment.MIDDLE_LEFT);
    pageManagement.setComponentAlignment(previous, Alignment.MIDDLE_LEFT);
    pageManagement.setComponentAlignment(pageLabel, Alignment.MIDDLE_LEFT);
    pageManagement.setComponentAlignment(currentPageTextField, Alignment.MIDDLE_LEFT);
    pageManagement.setComponentAlignment(separatorLabel, Alignment.MIDDLE_LEFT);
    pageManagement.setComponentAlignment(totalPagesLabel, Alignment.MIDDLE_LEFT);
    pageManagement.setComponentAlignment(next, Alignment.MIDDLE_LEFT);
    pageManagement.setComponentAlignment(last, Alignment.MIDDLE_LEFT);
    pageManagement.setWidth(null);
    pageManagement.setSpacing(true);
    controlBar.addComponent(pageSize);
    controlBar.addComponent(pageManagement);
    controlBar.setComponentAlignment(pageManagement, Alignment.MIDDLE_CENTER);
    controlBar.setWidth("100%");
    controlBar.setExpandRatio(pageSize, 1);
    addListener(new PageChangeListener() {
        @SuppressWarnings("boxing")
        public void pageChanged(final PagedTableChangeEvent event) {
            previous.setEnabled(true);
            next.setEnabled(true);
            currentPageTextField.setValue(String.valueOf(getCurrentPage()));
            totalPagesLabel.setValue(getTotalAmountOfPages());
        }
    });
    return controlBar;
}