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.scipionyx.butterflyeffect.frontend.configuration.ui.view.AboutView.java

License:Apache License

/**
 * /*from w ww  .  j a v a 2  s.  c  o  m*/
 * @param workAreaPanel
 */
private GridLayout createClusterInformation(String type, VerticalLayout workAreaPanel) {

    GridLayout layout = new GridLayout(4, 2);
    layout.setSizeFull();
    layout.setMargin(true);
    layout.setSpacing(true);

    Label label = new Label("Cluster Information - " + type);
    label.setStyleName(ValoTheme.LABEL_H2);

    Panel panelClusterInformation = new Panel(layout);
    panelClusterInformation.setStyleName(ValoTheme.PANEL_WELL);

    workAreaPanel.addComponents(label, panelClusterInformation);

    return layout;

}

From source file:com.terralcode.gestion.frontend.view.widgets.incomingAppointments.IncomingAppointments.java

public AppointmentDateLabel(Calendar cal) {
    super();/*from   w  w  w  . j a  v  a  2s  .c o  m*/
    this.addStyleName(ValoTheme.LABEL_H2);
    SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
    this.setValue(sdf.format(cal.getTime()));
}

From source file:de.fatalix.bookery.view.admin.AdminView.java

License:Open Source License

public VerticalLayout createServerSettings() {
    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);/* ww w .j  av a2s . com*/
    Label titleLabel = new Label("General Settings");
    titleLabel.addStyleName(ValoTheme.LABEL_H2);

    //layout.addComponent(titleLabel);
    layout.addComponent(serverSettingsLayout);
    Button resetIndex = new Button("reset Index", new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {

            try {
                presenter.resetIndex();
                Notification.show("Succesfully reset Index", Notification.Type.HUMANIZED_MESSAGE);
            } catch (IOException | SolrServerException ex) {
                Notification.show(ex.getMessage(), Notification.Type.ERROR_MESSAGE);
            }
        }
    });
    resetIndex.addStyleName(ValoTheme.BUTTON_DANGER);

    final TextField eMailAdress = new TextField(null, "felix.husse@medavis.de");
    eMailAdress.setColumns(35);
    Button testMail = new Button("Test Mail", new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            try {
                presenter.sendEmail(eMailAdress.getValue());
                Notification.show("Mail succesfully sent!", Notification.Type.HUMANIZED_MESSAGE);
            } catch (MessagingException ex) {
                Notification.show("Mail failed!" + ex.getMessage(), Notification.Type.ERROR_MESSAGE);
            }
        }
    });
    testMail.setEnabled(true);

    Button resetBatchJobs = new Button("reset BatchJobs", new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            presenter.resetBatchJobs();
            Notification.show("Succesfully reset Batchjobs", Notification.Type.HUMANIZED_MESSAGE);

        }
    });
    resetBatchJobs.addStyleName(ValoTheme.BUTTON_DANGER);

    HorizontalLayout mailLayout = new HorizontalLayout(eMailAdress, testMail, resetBatchJobs);
    layout.addComponents(resetIndex, mailLayout);

    return layout;
}

From source file:de.fatalix.bookery.view.admin.ServerSettingsLayout.java

License:Open Source License

@PostConstruct
private void postInit() {
    addStyleName("bookery-content");
    formLayout = new FormLayout();
    formLayout.addStyleName("light");
    formLayout.addComponents(generateFields());
    formLayout.addComponents(generateStatusFields());

    Button checkSolr = new Button("check", new Button.ClickListener() {

        @Override/*from   w w w .j a v  a2 s .  com*/
        public void buttonClick(Button.ClickEvent event) {
            checkSolr();
        }
    });
    checkSolr.addStyleName(ValoTheme.BUTTON_SMALL);
    checkSolr.addStyleName(ValoTheme.BUTTON_FRIENDLY);
    formLayout.addComponent(checkSolr);

    Label titleLabel = new Label("General Settings");
    titleLabel.addStyleName(ValoTheme.LABEL_H2);
    addComponents(titleLabel, formLayout);
}

From source file:de.fatalix.bookery.view.common.SuggestLaneLayout.java

License:Open Source License

@PostConstruct
private void postInit() {
    setSpacing(true);// w w  w  .j  a  v a  2  s.c  om
    addStyleName("bookery-lane");

    searchLink = SearchView.id;
    titleLabel = new Label("Your Title here..");
    titleLabel.addStyleName(ValoTheme.LABEL_H2);
    moreLink = new Button("mehr", new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            ((App) UI.getCurrent()).getNavigator().navigateTo(searchLink);
        }
    });
    moreLink.addStyleName(ValoTheme.BUTTON_LINK);
    moreLink.addStyleName(ValoTheme.BUTTON_LARGE);

    layout = new HorizontalLayout();
    layout.setSpacing(true);

    bookDetailLayout.setLayoutVisible(false);
    addComponents(titleLabel, layout);
}

From source file:de.fatalix.bookery.view.common.SuggestLaneLayout.java

License:Open Source License

private VerticalLayout createEmptyDummy() {
    Label label = new Label("hab nix gfundn");
    label.addStyleName(ValoTheme.LABEL_H2);
    label.addStyleName(ValoTheme.LABEL_COLORED);
    label.setSizeUndefined();//from   www. ja  v a 2 s. c  o  m
    VerticalLayout dummyLayout = new VerticalLayout(label);
    dummyLayout.setHeight("150px");
    dummyLayout.setWidth("800px");
    dummyLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);
    return dummyLayout;
}

From source file:dhbw.clippinggorilla.userinterface.views.AboutUsView.java

public AboutUsView() {
    setMargin(true);// www  .  ja v  a  2  s  .com
    setWidth("55%");

    Label aboutUsHeader = new Label();
    Language.set(Word.ABOUT_US, aboutUsHeader);
    aboutUsHeader.setStyleName(ValoTheme.LABEL_H1);
    addComponent(aboutUsHeader);

    Label aboutUsGroupHeadline = new Label();
    Language.set(Word.GROUP_PROJECT_OF_GROUP_4, aboutUsGroupHeadline);
    aboutUsGroupHeadline.setStyleName(ValoTheme.LABEL_H2);
    addComponent(aboutUsGroupHeadline);

    Label aboutUsText = new Label();
    Language.set(Word.GROUP_PROJECT_BODY, aboutUsText);
    aboutUsText.setWidth("100%");
    aboutUsText.setContentMode(com.vaadin.shared.ui.ContentMode.HTML);
    addComponent(aboutUsText);

    Label theTeamHeader = new Label();
    Language.set(Word.OUR_TEAM, theTeamHeader);
    theTeamHeader.setStyleName(ValoTheme.LABEL_H2);
    addComponent(theTeamHeader);

    Grid<Person> theTeamGrid = new Grid<>();
    List<Person> persons = Arrays.asList(new Person("Dan-Pierre", "Drehlich", Person.Function.TEAMLEADER),
            new Person("Stefan", "Schmid", Person.Function.RESPONSIBLE_FOR_RESEARCH),
            new Person("Jan", "Striegel", Person.Function.TECHNICAL_ASSISTANT),
            new Person("Lisa", "Hartung",
                    Person.Function.RESPONSIBLE_FOR_MODELING_QUALITY_ASSURANCE_AND_DOCUMENTATION),
            new Person("Tim", "Heinzelmann", Person.Function.RESPONSIBLE_FOR_TESTS),
            new Person("Josua", "Frank", Person.Function.RESPONSIBLE_FOR_IMPLEMENTATION));
    Grid.Column c1 = theTeamGrid.addColumn(p -> p.getFirstName());
    Language.setCustom(Word.FIRST_NAME, s -> c1.setCaption(s));
    Grid.Column c2 = theTeamGrid.addColumn(p -> p.getLastName());
    Language.setCustom(Word.LAST_NAME, s -> c2.setCaption(s));
    Grid.Column c3 = theTeamGrid.addColumn(p -> p.getResposibility());
    Language.setCustom(Word.RESPONSIBILITY, s -> {
        c3.setCaption(s);
        theTeamGrid.getDataProvider().refreshAll();
    });
    theTeamGrid.setItems(persons);
    theTeamGrid.setWidth("100%");
    theTeamGrid.setHeightByRows(6);
    addComponent(theTeamGrid);
    SESSIONS.put(VaadinSession.getCurrent(), this);
}

From source file:dhbw.clippinggorilla.userinterface.views.ArchiveView.java

public void createClippingViewByProfile(Clipping clipping) {
    clippingArticlesLayout.removeAllComponents();
    if (clipping.getArticles().keySet().isEmpty() && clipping.getArticlesFromGroup().keySet().isEmpty()) {
        Label labelNoProfile = new Label();
        Language.setCustom(Word.NO_PROFILE_PRESENT, s -> labelNoProfile.setValue(s));
        labelNoProfile.addStyleName(ValoTheme.LABEL_H2);
        clippingArticlesLayout.addComponent(labelNoProfile);
    } else {//  w  w  w. ja v  a  2s.com
        clipping.getArticles().entrySet().stream().forEach(p -> {
            VerticalLayout layoutProfile = new VerticalLayout();
            layoutProfile.setSpacing(true);
            layoutProfile.setMargin(true);
            layoutProfile.addStyleName("tags");
            layoutProfile.setWidth("100%");
            if (p.getValue().isEmpty()) {
                Label labelNoArticles = new Label();
                Language.setCustom(Word.NO_ARTICLES_PRESENT, s -> labelNoArticles.setValue(s));
                labelNoArticles.addStyleName(ValoTheme.LABEL_H3);
                layoutProfile.addComponent(labelNoArticles);
            } else {
                p.getValue().forEach(a -> layoutProfile.addComponent(createClippingRow(a)));
            }
            Panel panelProfile = new Panel(p.getKey().getName(), layoutProfile);
            clippingArticlesLayout.addComponent(panelProfile);
        });
        clipping.getArticlesFromGroup().entrySet().stream().forEach(p -> {
            VerticalLayout layoutProfile = new VerticalLayout();
            layoutProfile.setSpacing(true);
            layoutProfile.setMargin(true);
            layoutProfile.addStyleName("tags");
            layoutProfile.setWidth("100%");
            if (p.getValue().isEmpty()) {
                Label labelNoArticles = new Label();
                Language.setCustom(Word.NO_ARTICLES_PRESENT, s -> labelNoArticles.setValue(s));
                labelNoArticles.addStyleName(ValoTheme.LABEL_H3);
                layoutProfile.addComponent(labelNoArticles);
            } else {
                p.getValue().forEach(a -> layoutProfile.addComponent(createClippingRow(a)));
            }
            Panel panelProfile = new Panel(Language.get(Word.GROUP) + " " + p.getKey().getGroup().getName()
                    + ": " + p.getKey().getName(), layoutProfile);
            Language.setCustom(Word.GROUP, s -> panelProfile
                    .setCaption(s + " " + p.getKey().getGroup().getName() + ": " + p.getKey().getName()));
            clippingArticlesLayout.addComponent(panelProfile);
        });
    }
}

From source file:dhbw.clippinggorilla.userinterface.views.ArchiveView.java

public Component createClippingRow(Article a) {
    Image imageNewsImage = new Image();
    String url = a.getUrlToImage();
    if (url == null || url.isEmpty()) {
        url = a.getSourceAsSource().getLogo().toExternalForm();
    }/*from  www.j a  v  a2s  . c  o  m*/
    imageNewsImage.setSource(new ExternalResource(url));
    imageNewsImage.addStyleName("articleimage");

    VerticalLayout layoutNewsImage = new VerticalLayout(imageNewsImage);
    layoutNewsImage.setMargin(false);
    layoutNewsImage.setSpacing(false);
    layoutNewsImage.setWidth("200px");
    layoutNewsImage.setHeight("150px");
    layoutNewsImage.setComponentAlignment(imageNewsImage, Alignment.MIDDLE_CENTER);

    Label labelHeadLine = new Label(a.getTitle(), ContentMode.HTML);
    labelHeadLine.addStyleName(ValoTheme.LABEL_H2);
    labelHeadLine.addStyleName(ValoTheme.LABEL_NO_MARGIN);
    labelHeadLine.setWidth("100%");

    Label labelDescription = new Label(a.getDescription(), ContentMode.HTML);
    labelDescription.setWidth("100%");

    Image imageSource = new Image();
    Source s = a.getSourceAsSource();
    URL logo;
    if (s != null) {
        logo = s.getLogo();
    } else {
        Log.error("Source is null: " + a.getSource());
        return new Label("INTERNAL ERROR");
    }
    if (logo != null) {
        imageSource.setSource(new ExternalResource(logo));
    } else {
        Log.error("Sourcelogo is null: " + s.getName());
    }
    imageSource.setHeight("30px");
    Label labelSource = new Label(a.getSourceAsSource().getName());
    labelSource.addStyleName(ValoTheme.LABEL_SMALL);

    LocalDateTime time = a.getPublishedAtAsLocalDateTime();
    DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.LONG);
    formatter.withZone(ZoneId.of("Europe/Berlin"));
    Label labelDate = new Label(time.format(formatter));
    labelDate.addStyleName(ValoTheme.LABEL_SMALL);

    Label labelAuthor = new Label();
    labelAuthor.addStyleName(ValoTheme.LABEL_SMALL);
    labelAuthor.setWidth("100%");
    if (a.getAuthor() != null && !a.getAuthor().isEmpty()) {
        labelAuthor.setValue(a.getAuthor());
    }

    Button openWebsite = new Button(VaadinIcons.EXTERNAL_LINK);
    openWebsite.addClickListener(e -> UI.getCurrent().getPage().open(a.getUrl(), "_blank", false));

    HorizontalLayout layoutArticleOptions = new HorizontalLayout();
    layoutArticleOptions.setWidth("100%");
    layoutArticleOptions.addComponents(imageSource, labelSource, labelDate, labelAuthor, openWebsite);
    layoutArticleOptions.setComponentAlignment(imageSource, Alignment.MIDDLE_CENTER);
    layoutArticleOptions.setComponentAlignment(labelSource, Alignment.MIDDLE_CENTER);
    layoutArticleOptions.setComponentAlignment(labelDate, Alignment.MIDDLE_CENTER);
    layoutArticleOptions.setComponentAlignment(labelAuthor, Alignment.MIDDLE_LEFT);
    layoutArticleOptions.setComponentAlignment(openWebsite, Alignment.MIDDLE_CENTER);
    layoutArticleOptions.setExpandRatio(labelAuthor, 5);

    VerticalLayout layoutNewsText = new VerticalLayout(labelHeadLine, labelDescription, layoutArticleOptions);
    layoutNewsText.setMargin(false);
    layoutNewsText.setWidth("100%");

    HorizontalLayout layoutClipping = new HorizontalLayout();
    layoutClipping.setWidth("100%");
    layoutClipping.setMargin(true);
    layoutClipping.addComponents(layoutNewsImage, layoutNewsText);
    layoutClipping.setComponentAlignment(layoutNewsImage, Alignment.MIDDLE_CENTER);
    layoutClipping.setExpandRatio(layoutNewsText, 5);
    layoutClipping.addStyleName(ValoTheme.LAYOUT_CARD);
    layoutClipping.addStyleName("tags");
    return layoutClipping;
}

From source file:dhbw.clippinggorilla.userinterface.views.ClippingView.java

public ClippingView(Clipping clipping) {
    User user = UserUtils.getCurrent();/*from  ww  w  .  j  a v  a2 s. co m*/

    clippingArticlesLayout = new VerticalLayout();
    clippingArticlesLayout.setSpacing(true);
    clippingArticlesLayout.setMargin(false);
    clippingArticlesLayout.setSizeFull();

    HorizontalLayout clippingOptionsLayout = new HorizontalLayout();
    clippingOptionsLayout.setSpacing(true);
    clippingOptionsLayout.setMargin(false);
    clippingOptionsLayout.setWidth("100%");

    ComboBox<SortOptions> comboBoxSortOptions = new ComboBox<>(Language.get(Word.SORT_BY));
    Language.setCustom(Word.SORT_BY, s -> {
        comboBoxSortOptions.setCaption(s);
        comboBoxSortOptions.getDataProvider().refreshAll();
    });
    comboBoxSortOptions.setItems(EnumSet.allOf(SortOptions.class));
    comboBoxSortOptions.setItemCaptionGenerator(s -> s.getName());
    comboBoxSortOptions.setItemIconGenerator(s -> s.getIcon());
    comboBoxSortOptions.setValue(SortOptions.BYPROFILE);
    comboBoxSortOptions.setTextInputAllowed(false);
    comboBoxSortOptions.setEmptySelectionAllowed(false);
    comboBoxSortOptions.addStyleName("comboboxsort");
    comboBoxSortOptions.addValueChangeListener(e -> {
        switch (e.getValue()) {
        case BYDATE:
            createClippingViewByDate(clipping);
            break;
        case BYPROFILE:
            createClippingViewByProfile(clipping);
            break;
        case BYSOURCE:
            createClippingViewBySource(clipping);
            break;
        }
    });

    Button buttonRegenerateClipping = new Button(VaadinIcons.REFRESH);
    buttonRegenerateClipping.addStyleName(ValoTheme.BUTTON_PRIMARY);
    buttonRegenerateClipping.addClickListener(ce -> {
        user.setLastClipping(ClippingUtils.generateClipping(user, false));
        ClippingGorillaUI.getCurrent().setMainContent(ClippingView.getCurrent());
    });

    clippingOptionsLayout.addComponents(comboBoxSortOptions, buttonRegenerateClipping);
    clippingOptionsLayout.setExpandRatio(comboBoxSortOptions, 5);
    clippingOptionsLayout.setComponentAlignment(buttonRegenerateClipping, Alignment.BOTTOM_CENTER);

    addComponents(clippingOptionsLayout, clippingArticlesLayout);

    createClippingViewByProfile(clipping);
    if (clipping.getArticles().keySet().isEmpty() && clipping.getArticlesFromGroup().keySet().isEmpty()) {
        Label labelNoProfile = new Label();
        Language.setCustom(Word.NO_PROFILE_PRESENT, s -> labelNoProfile.setValue(s));
        labelNoProfile.addStyleName(ValoTheme.LABEL_H2);
        clippingArticlesLayout.addComponent(labelNoProfile);
    }
}