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

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

Introduction

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

Prototype

String LABEL_H2

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

Click Source Link

Document

Header style for different sections in the application.

Usage

From source file:com.esofthead.mycollab.module.project.view.assignments.gantt.PredecessorWindow.java

License:Open Source License

PredecessorWindow(final GanttTreeTable taskTreeTable, final GanttItemWrapper ganttItemWrapper) {
    super("Edit predecessors");
    this.setModal(true);
    this.setResizable(false);
    this.setWidth("650px");
    this.center();
    this.taskTreeTable = taskTreeTable;
    this.ganttItemWrapper = ganttItemWrapper;

    MVerticalLayout content = new MVerticalLayout();
    this.setContent(content);
    Label headerLbl = new Label(
            String.format("Row %d: %s", ganttItemWrapper.getGanttIndex(), ganttItemWrapper.getName()));
    headerLbl.addStyleName(ValoTheme.LABEL_H2);
    content.add(headerLbl);//from  ww w  . j  av a  2 s  . co  m

    CssLayout preWrapper = new CssLayout();
    content.with(preWrapper);

    MHorizontalLayout headerLayout = new MHorizontalLayout();
    headerLayout.addComponent(new ELabel("Row").withWidth(ROW_WDITH));
    headerLayout.addComponent(new ELabel("Task").withWidth(TASK_WIDTH));
    headerLayout.addComponent(new ELabel("Dependency").withWidth(PRE_TYPE_WIDTH));
    headerLayout.addComponent(new ELabel("Lag").withWidth(LAG_WIDTH));
    predecessorsLayout = new PredecessorsLayout();
    new Restrain(predecessorsLayout).setMaxHeight("600px");

    preWrapper.addComponent(headerLayout);
    preWrapper.addComponent(predecessorsLayout);

    MHorizontalLayout buttonControls = new MHorizontalLayout();
    content.with(buttonControls).withAlign(buttonControls, Alignment.MIDDLE_RIGHT);

    Button cancelBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_CANCEL),
            new Button.ClickListener() {
                @Override
                public void buttonClick(Button.ClickEvent event) {
                    PredecessorWindow.this.close();
                }
            });
    cancelBtn.addStyleName(UIConstants.BUTTON_OPTION);

    Button saveBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_SAVE), new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            List<TaskPredecessor> predecessors = predecessorsLayout.buildPredecessors();
            EventBusFactory.getInstance()
                    .post(new GanttEvent.ModifyPredecessors(ganttItemWrapper, predecessors));
            PredecessorWindow.this.close();
        }
    });
    saveBtn.addStyleName(UIConstants.BUTTON_ACTION);
    buttonControls.with(cancelBtn, saveBtn);
}

From source file:com.esofthead.mycollab.module.project.view.assignments.GanttChartViewImpl.java

License:Open Source License

private void constructUI() {
    MHorizontalLayout header = new MHorizontalLayout().withMargin(new MarginInfo(false, false, true, false))
            .withStyleName("hdr-view").withWidth("100%");
    header.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    Label headerText = new Label(FontAwesome.BAR_CHART_O.getHtml() + " Gantt chart", ContentMode.HTML);
    headerText.setStyleName(ValoTheme.LABEL_H2);
    headerText.addStyleName(ValoTheme.LABEL_NO_MARGIN);
    CssLayout headerWrapper = new CssLayout();
    headerWrapper.addComponent(headerText);

    MHorizontalLayout resWrapper = new MHorizontalLayout();
    Label resLbl = new Label("Resolution: ");
    final ComboBox resValue = new ValueComboBox(false, "Day", "Week");
    resValue.addValueChangeListener(new Property.ValueChangeListener() {
        @Override//w  w w.  j a v a  2 s . c  o m
        public void valueChange(Property.ValueChangeEvent event) {
            String val = (String) resValue.getValue();
            if ("Day".equals(val)) {
                gantt.setResolution(Resolution.Day);
            } else if ("Week".equals(val)) {
                gantt.setResolution(Resolution.Week);
            }
        }
    });
    resWrapper.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
    resWrapper.with(resLbl, resValue);

    header.with(headerWrapper, resWrapper).withAlign(headerWrapper, Alignment.MIDDLE_LEFT)
            .expand(headerWrapper);

    mainLayout = new MHorizontalLayout().withSpacing(false);
    mainLayout.addStyleName("gantt_container");
    mainLayout.setSizeFull();
    this.with(header, mainLayout);
}

From source file:com.esofthead.mycollab.shell.view.CommunitySliderContent.java

License:Open Source License

CommunitySliderContent() {
    try {//from www .j  a v a2s  .c om
        withWidth("500px").withStyleName("community");
        Div blogLink = new Div().appendText(FontAwesome.INSTITUTION.getHtml() + " ")
                .appendChild(new A("https://www" + ".mycollab.com").appendText("Blog").setTarget("_blank"));
        with(new ELabel(blogLink.write(), ContentMode.HTML).withStyleName(ValoTheme.LABEL_H2));
        SyndFeed feed = getSyndFeedForUrl("https://www.mycollab.com/feed/atom/");
        final List<SyndEntry> entries = feed.getEntries();
        if (CollectionUtils.isNotEmpty(entries)) {
            AsyncInvoker.access(new AsyncInvoker.PageCommand() {
                @Override
                public void run() {
                    for (SyndEntry entry : entries) {
                        Div link = new Div().appendText(FontAwesome.INBOX.getHtml() + " ").appendChild(
                                new A(entry.getLink()).appendText(entry.getTitle()).setTarget("_blank"));
                        CommunitySliderContent.this
                                .with(new ELabel(link.write(), ContentMode.HTML).withStyleName("title"));
                        Div description = new Div().appendText(entry.getDescription().getValue());
                        CommunitySliderContent.this
                                .with(new ELabel(description.write(), ContentMode.HTML).withStyleName("desc"));
                    }
                }
            });
        }

    } catch (Exception e) {
        with(new Label("Can not load MyCollab's feed"));
    }
}

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

License:Apache License

public Labels() {
    setMargin(true);//from  www  . j av a  2s.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.github.djabry.platform.vaadin.view.BaseMainViewAbstr.java

License:Open Source License

@PostConstruct
protected void init() {
    MarginInfo marginInfo = new MarginInfo(true, true, true, true);
    this.setMargin(marginInfo);
    this.setSpacing(true);

    String titleString = this.getTitle();
    if (titleString != null) {
        Label title = new Label(getTitle());
        title.addStyleName(ValoTheme.LABEL_H2);
        this.addComponent(title);
    }/*from   ww  w.j a  v a 2  s  .c om*/

}

From source file:com.kpg.diary.ui.NativeSelects.java

License:Apache License

public NativeSelects() {
    setMargin(true);//from  www . j  ava  2s .c om

    Label h1 = new Label("Selects");
    h1.addStyleName(ValoTheme.LABEL_H2);
    addComponent(h1);

    HorizontalLayout row = new HorizontalLayout();
    row.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING);
    row.setSpacing(true);
    addComponent(row);

    NativeSelect select = new NativeSelect("Drop Down Select");
    row.addComponent(select);

    ListSelect list = new ListSelect("List Select");
    list.setNewItemsAllowed(true);
    row.addComponent(list);

    TwinColSelect tcs = new TwinColSelect("TwinCol Select");
    tcs.setLeftColumnCaption("Left Column");
    tcs.setRightColumnCaption("Right Column");
    tcs.setNewItemsAllowed(true);
    row.addComponent(tcs);

    TwinColSelect tcs2 = new TwinColSelect("Sized TwinCol Select");
    tcs2.setLeftColumnCaption("Left Column");
    tcs2.setRightColumnCaption("Right Column");
    tcs2.setNewItemsAllowed(true);
    tcs2.setWidth("280px");
    tcs2.setHeight("200px");
    row.addComponent(tcs2);

    for (int i = 1; i <= 10; i++) {
        select.addItem("Option " + i);
        list.addItem("Option " + i);
        tcs.addItem("Option " + i);
        tcs2.addItem("Option " + i);
    }
}

From source file:com.mechanicshop.components.MaintenanceLayout.java

private void buildLayout() {
    HorizontalLayout layoutTitle = new HorizontalLayout();
    layoutTitle.setSizeUndefined();/*from w  ww. ja  v a 2 s. c om*/
    layoutTitle.setWidth("100%");
    layoutTitle.setSpacing(false);
    layoutTitle.setMargin(false);
    titleLabel.addStyleName(ValoTheme.LABEL_H2);
    titleLabel.addStyleName(ValoTheme.LABEL_COLORED);
    titleLabel.addStyleName(ValoTheme.LABEL_NO_MARGIN);
    titleLabel.addStyleName(ValoTheme.LABEL_BOLD);
    titleLabel.setSizeUndefined();

    layoutTitle.addComponent(titleLabel);
    layoutTitle.setComponentAlignment(titleLabel, Alignment.MIDDLE_CENTER);

    VerticalLayout layoutTable = new VerticalLayout();

    layoutTable.setSizeFull();

    layoutTable.setSpacing(true);
    HorizontalLayout layoutButtons = new HorizontalLayout();
    layoutButtons.setMargin(false);
    layoutButtons.setSpacing(true);
    layoutButtons.setSizeUndefined();
    Button passwordBtn = new Button("Edit Password");
    passwordBtn.addClickListener(passwordListener);
    passwordBtn.setImmediate(true);
    passwordBtn.setIcon(FontAwesome.EDIT);
    passwordBtn.setStyleName(ValoTheme.BUTTON_TINY);
    Button media1Btn = new Button("Media 1 Default Text");
    media1Btn.setStyleName(ValoTheme.BUTTON_TINY);
    media1Btn.setImmediate(true);
    media1Btn.setIcon(FontAwesome.EDIT);
    media1Btn.addClickListener(media1Listener);
    Button media2Btn = new Button("Media 2 Default Text");
    media2Btn.setStyleName(ValoTheme.BUTTON_TINY);
    media2Btn.setImmediate(true);
    media2Btn.setIcon(FontAwesome.EDIT);
    media2Btn.addClickListener(media2Listener);
    layoutButtons.addComponents(passwordBtn, media1Btn, media2Btn);

    layoutButtons.setComponentAlignment(passwordBtn, Alignment.MIDDLE_LEFT);
    layoutButtons.setComponentAlignment(media1Btn, Alignment.MIDDLE_LEFT);
    layoutButtons.setComponentAlignment(media2Btn, Alignment.MIDDLE_LEFT);

    addComponent(layoutTitle);
    addComponent(layoutTable);
    layoutTable.addComponent(layoutButtons);
    layoutTable.addComponent(table);
    layoutTable.setComponentAlignment(table, Alignment.TOP_CENTER);
    layoutTable.setExpandRatio(table, 3);
    setComponentAlignment(layoutTitle, Alignment.TOP_CENTER);
    setComponentAlignment(layoutTable, Alignment.TOP_CENTER);
    setExpandRatio(layoutTable, 3);
    setSpacing(true);
    setMargin(true);

}

From source file:com.mechanicshop.components.TableLayout.java

private void buildLayout() {
    HorizontalLayout layoutTitle = new HorizontalLayout();
    layoutTitle.setSizeUndefined();//  w w  w .  jav a2 s.  c o  m
    layoutTitle.setWidth("100%");
    layoutTitle.setSpacing(false);
    layoutTitle.setMargin(false);
    titleLabel.addStyleName(ValoTheme.LABEL_H2);
    titleLabel.addStyleName(ValoTheme.LABEL_COLORED);
    titleLabel.addStyleName(ValoTheme.LABEL_NO_MARGIN);
    titleLabel.addStyleName(ValoTheme.LABEL_BOLD);
    titleLabel.setSizeUndefined();

    layoutTitle.addComponent(titleLabel);
    layoutTitle.setComponentAlignment(titleLabel, Alignment.MIDDLE_CENTER);

    VerticalLayout layoutTable = new VerticalLayout();

    layoutTable.addComponent(table);
    layoutTable.setComponentAlignment(table, Alignment.TOP_CENTER);
    layoutTable.setSizeFull();

    layoutTable.setSpacing(true);
    HorizontalLayout layoutButtons = new HorizontalLayout();
    layoutButtons.setMargin(false);
    layoutButtons.setSpacing(true);
    layoutButtons.setSizeUndefined();
    layoutButtons.setWidth("100%");
    Button addBtn = new Button("Add new Car");
    addBtn.addClickListener(addBtnListener);
    addBtn.setImmediate(true);
    addBtn.setStyleName(ValoTheme.BUTTON_TINY);
    addBtn.addStyleName(ValoTheme.BUTTON_FRIENDLY);
    Button deleteBtn = new Button("Delete Selected");
    deleteBtn.setStyleName(ValoTheme.BUTTON_TINY);
    deleteBtn.addStyleName(ValoTheme.BUTTON_DANGER);
    deleteBtn.setImmediate(true);
    deleteBtn.addClickListener(removeListener);

    btnSendSMS.setStyleName(ValoTheme.BUTTON_TINY);
    btnSendSMS.addStyleName(ValoTheme.BUTTON_FRIENDLY);
    btnSendSMS.setImmediate(true);
    btnSendSMS.addClickListener(sendSMSBtnListener);

    searchTextField.setImmediate(true);
    searchTextField.addStyleName(ValoTheme.TEXTFIELD_TINY);
    searchTextField.addTextChangeListener(filterChangeListener);
    Label lbSearch = new Label("Search");
    lbSearch.addStyleName(ValoTheme.LABEL_TINY);
    lbSearch.setSizeUndefined();
    layoutButtons.addComponents(lbSearch, searchTextField, addBtn, deleteBtn, btnSendSMS);

    layoutButtons.setComponentAlignment(lbSearch, Alignment.MIDDLE_LEFT);
    layoutButtons.setComponentAlignment(searchTextField, Alignment.BOTTOM_LEFT);
    layoutButtons.setComponentAlignment(addBtn, Alignment.BOTTOM_RIGHT);
    layoutButtons.setComponentAlignment(deleteBtn, Alignment.BOTTOM_RIGHT);
    layoutButtons.setComponentAlignment(btnSendSMS, Alignment.BOTTOM_RIGHT);
    layoutButtons.setExpandRatio(addBtn, 3);
    addComponent(layoutTitle);
    addComponent(layoutTable);
    layoutTable.addComponent(layoutButtons);
    layoutTable.setExpandRatio(table, 3);
    setComponentAlignment(layoutTitle, Alignment.TOP_CENTER);
    setComponentAlignment(layoutTable, Alignment.TOP_CENTER);
    setExpandRatio(layoutTable, 3);
    setSpacing(true);
    setMargin(true);

}

From source file:com.mycollab.vaadin.ui.ELabel.java

License:Open Source License

public static ELabel h2(String value) {
    return ELabel.html(value).withStyleName(ValoTheme.LABEL_H2, ValoTheme.LABEL_NO_MARGIN);
}

From source file:com.mycollab.vaadin.ui.HeaderWithFontAwesome.java

License:Open Source License

public static final HeaderWithFontAwesome h2(FontAwesome iconFont, String title) {
    return new HeaderWithFontAwesome(iconFont, title, ValoTheme.LABEL_H2);
}