List of usage examples for com.vaadin.ui.themes ValoTheme LABEL_H3
String LABEL_H3
To view the source code for com.vaadin.ui.themes ValoTheme LABEL_H3.
Click Source Link
From source file:com.mycollab.vaadin.ui.HeaderWithFontAwesome.java
License:Open Source License
public static final HeaderWithFontAwesome h3(FontAwesome iconFont, String title) { return new HeaderWithFontAwesome(iconFont, title, ValoTheme.LABEL_H3); }
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();/*from w ww.j a va2 s. co 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.fatalix.bookery.AppHeader.java
License:Open Source License
private MHorizontalLayout createSearchBar() { Label header = new Label("Bookery"); header.addStyleName(ValoTheme.LABEL_BOLD); header.setSizeUndefined();//from ww w. ja v a 2s . co m header.addStyleName(ValoTheme.LABEL_H3); searchText = new TextField(); searchText.setIcon(FontAwesome.SEARCH); searchText.addStyleName(ValoTheme.TEXTFIELD_LARGE); searchText.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); searchText.setWidth(100, Unit.PERCENTAGE); searchText.setInputPrompt("hier einfach suchen.."); Button searchButton = new Button("such!", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { Navigator navigator = ((App) UI.getCurrent()).getNavigator(); if (navigator.getState().contains("search")) { navigator.navigateTo(navigator.getState()); } else { navigator.navigateTo(SearchView.id); } } }); searchButton.addStyleName(ValoTheme.BUTTON_LARGE); searchText.addShortcutListener(new Button.ClickShortcut(searchButton, ShortcutAction.KeyCode.ENTER)); MHorizontalLayout layout = new MHorizontalLayout(header, searchText, searchButton); layout.setWidth(100, Unit.PERCENTAGE); layout.setExpandRatio(searchText, 1.0f); return layout; }
From source file:de.kaiserpfalzEdv.vaadin.menu.impl.MenuImpl.java
License:Apache License
@Inject public MenuImpl(final Authenticator accessControl, final EventBus bus, final I18NHandler i18n, final List<View> allViews) { this.accessControl = accessControl; this.bus = bus; this.i18n = i18n; this.allViews = allViews; setPrimaryStyleName(ValoTheme.MENU_ROOT); menuPart = new CssLayout(); menuPart.addStyleName(ValoTheme.MENU_PART); // header of the menu final HorizontalLayout top = new HorizontalLayout(); top.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); top.addStyleName(ValoTheme.MENU_TITLE); top.setSpacing(true);//from w w w . j a va 2 s .c om Label title = new Label(translate("application.name")); title.addStyleName(ValoTheme.LABEL_H3); title.setSizeUndefined(); Image image = new Image(null, new ThemeResource("img/table-logo.png")); image.setStyleName("logo"); top.addComponent(image); top.addComponent(title); menuPart.addComponent(top); // logout menu item MenuBar logoutMenu = new MenuBar(); logoutMenu.addItem(translate("button.logout.caption"), FontAwesome.valueOf(translate("button.logout.icon")), selectedItem -> { VaadinSession.getCurrent().getSession().invalidate(); Page.getCurrent().reload(); }); logoutMenu.addStyleName("user-menu"); menuPart.addComponent(logoutMenu); // button for toggling the visibility of the menu when on a small screen final Button showMenu = new Button(translate("application.name"), new ClickListener() { @Override public void buttonClick(final ClickEvent event) { if (menuPart.getStyleName().contains(VALO_MENU_VISIBLE)) { menuPart.removeStyleName(VALO_MENU_VISIBLE); } else { menuPart.addStyleName(VALO_MENU_VISIBLE); } } }); showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY); showMenu.addStyleName(ValoTheme.BUTTON_SMALL); showMenu.addStyleName(VALO_MENU_TOGGLE); showMenu.setIcon(FontAwesome.NAVICON); menuPart.addComponent(showMenu); // container for the navigation buttons, which are added by addView() menuItemsLayout = new CssLayout(); menuItemsLayout.setPrimaryStyleName(VALO_MENUITEMS); menuPart.addComponent(menuItemsLayout); addComponent(menuPart); }
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 {/*from w w w .java2 s .c o m*/ 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 void createClippingViewByDate(Clipping clipping) { clippingArticlesLayout.removeAllComponents(); if (ClippingUtils.isEmpty(clipping)) { Label labelNoArticles = new Label(); Language.setCustom(Word.NO_ARTICLES_PRESENT, s -> labelNoArticles.setValue(s)); labelNoArticles.addStyleName(ValoTheme.LABEL_H3); clippingArticlesLayout.addComponent(labelNoArticles); }/*from w w w .j a va 2 s. c o m*/ clipping.getArticles().entrySet().stream().flatMap(e -> e.getValue().stream()).sorted( (a1, a2) -> (-1) * a1.getPublishedAtAsLocalDateTime().compareTo(a2.getPublishedAtAsLocalDateTime())) .forEach(a -> clippingArticlesLayout.addComponent(createClippingRow(a))); clipping.getArticlesFromGroup().entrySet().stream().flatMap(e -> e.getValue().stream()).sorted( (a1, a2) -> (-1) * a1.getPublishedAtAsLocalDateTime().compareTo(a2.getPublishedAtAsLocalDateTime())) .forEach(a -> clippingArticlesLayout.addComponent(createClippingRow(a))); }
From source file:dhbw.clippinggorilla.userinterface.views.ArchiveView.java
public void createClippingViewBySource(Clipping clipping) { clippingArticlesLayout.removeAllComponents(); if (ClippingUtils.isEmpty(clipping)) { Label labelNoArticles = new Label(); Language.setCustom(Word.NO_ARTICLES_PRESENT, s -> labelNoArticles.setValue(s)); labelNoArticles.addStyleName(ValoTheme.LABEL_H3); clippingArticlesLayout.addComponent(labelNoArticles); }/*from www. j a v a 2 s .com*/ clipping.getArticles().entrySet().stream().flatMap(e -> e.getValue().stream()).sorted( (a1, a2) -> a1.getSourceAsSource().getName().compareToIgnoreCase(a2.getSourceAsSource().getName())) .forEach(a -> clippingArticlesLayout.addComponent(createClippingRow(a))); clipping.getArticlesFromGroup().entrySet().stream().flatMap(e -> e.getValue().stream()).sorted( (a1, a2) -> a1.getSourceAsSource().getName().compareToIgnoreCase(a2.getSourceAsSource().getName())) .forEach(a -> clippingArticlesLayout.addComponent(createClippingRow(a))); }
From source file:dhbw.clippinggorilla.userinterface.views.ClippingView.java
public void createClippingViewByProfile(Clipping clipping) { clippingArticlesLayout.removeAllComponents(); clipping.getArticles().entrySet().stream().forEach(p -> { VerticalLayout layoutProfile = new VerticalLayout(); layoutProfile.setSpacing(true);// ww w. j a va 2 s. c om 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.InterestProfileView.java
public Component getSources(InterestProfile profile) { VerticalLayout windowLayout = new VerticalLayout(); windowLayout.setWidth("100%"); VerticalLayout sourcesLayout = new VerticalLayout(); sourcesLayout.setWidth("100%"); Panel sourcesPanel = new Panel(sourcesLayout); List<CheckBox> checkBoxes = new ArrayList<>(); HashMap<String, GridLayout> sourceLayouts = new HashMap<>(); profile.getSources().entrySet().stream() .sorted((e1, e2) -> e1.getKey().getName().compareToIgnoreCase(e2.getKey().getName())).forEach(e -> { Source source = e.getKey(); boolean enabled = e.getValue(); GridLayout sourceLayout = new GridLayout(5, 1); sourceLayout.setSizeFull(); CheckBox sourceSelected = new CheckBox(); sourceSelected.setValue(enabled); sourceSelected.addStyleName(ValoTheme.CHECKBOX_LARGE); sourceSelected.addValueChangeListener(v -> profile.getSources().replace(source, v.getValue())); checkBoxes.add(sourceSelected); Image sourceLogo = new Image(); sourceLogo.addStyleName("logosmall"); sourceLogo.setSource(new ExternalResource(source.getLogo())); sourceLogo.addClickListener(c -> { sourceSelected.setValue(!sourceSelected.getValue()); profile.getSources().replace(source, sourceSelected.getValue()); });/*from w w w . j ava 2s. c om*/ VerticalLayout layoutLogo = new VerticalLayout(sourceLogo); layoutLogo.setWidth("150px"); layoutLogo.setHeight("50px"); layoutLogo.setMargin(false); layoutLogo.setSpacing(false); layoutLogo.setComponentAlignment(sourceLogo, Alignment.MIDDLE_LEFT); Label labelHeadLine = new Label( source.getCategory().getIcon().getHtml() + " " + source.getName(), ContentMode.HTML); labelHeadLine.addStyleName(ValoTheme.LABEL_H3); Label labelDescription = new Label(source.getDescription(), ContentMode.HTML); labelDescription.setWidth("300px"); PopupView popup = new PopupView(null, labelDescription); Button buttonDescription = new Button(VaadinIcons.INFO_CIRCLE_O); buttonDescription.addClickListener(ce -> { popup.setPopupVisible(true); }); sourceLayout.addComponents(sourceSelected, layoutLogo, labelHeadLine, popup, buttonDescription); sourceLayout.setComponentAlignment(sourceSelected, Alignment.MIDDLE_CENTER); sourceLayout.setComponentAlignment(layoutLogo, Alignment.MIDDLE_CENTER); sourceLayout.setColumnExpandRatio(2, 5); sourceLayout.setSpacing(true); sourceLayouts.put(source.getName().toLowerCase().replaceAll(" ", "").replaceAll("-", "") .replaceAll("_", ""), sourceLayout); sourcesLayout.addComponent(sourceLayout); }); sourcesPanel.setContent(sourcesLayout); sourcesPanel.setHeight("100%"); sourcesPanel.setCaption(Language.get(Word.SOURCES)); Language.setCustom(Word.SOURCES, s -> sourcesPanel.setCaption(s)); windowLayout.addComponent(sourcesPanel); windowLayout.setExpandRatio(sourcesPanel, 1); windowLayout.setSpacing(false); windowLayout.setMargin(false); CheckBox checkBoxSelectAll = new CheckBox(); Language.setCustom(Word.SELECT_ALL, s -> checkBoxSelectAll.setCaption(s)); checkBoxSelectAll.setWidth("100%"); checkBoxSelectAll.addValueChangeListener(e -> { profile.getSources().replaceAll((c, enabled) -> checkBoxSelectAll.getValue()); checkBoxes.forEach(c -> c.setValue(checkBoxSelectAll.getValue())); }); TextField textFieldSearch = new TextField(); Language.setCustom(Word.SEARCH, s -> textFieldSearch.setPlaceholder(s)); textFieldSearch.setWidth("100%"); textFieldSearch.setMaxLength(255); textFieldSearch.setPlaceholder(Language.get(Word.SEARCH)); textFieldSearch.addValueChangeListener(searchValue -> { sourceLayouts.forEach((sourceName, sourceLayout) -> { if (!sourceName.contains(searchValue.getValue().toLowerCase().replaceAll(" ", "") .replaceAll("-", "").replaceAll("_", ""))) { sourcesLayout.removeComponent(sourceLayout); } else { sourcesLayout.addComponent(sourceLayout); } }); }); Label placeholder = new Label(); placeholder.setWidth("100%"); GridLayout footer = new GridLayout(3, 1); footer.setSpacing(true); footer.setMargin(new MarginInfo(true, false, false, false)); footer.addStyleName("menubar"); footer.setWidth("100%"); footer.addComponents(checkBoxSelectAll, textFieldSearch, placeholder); footer.setComponentAlignment(checkBoxSelectAll, Alignment.MIDDLE_LEFT); footer.setComponentAlignment(textFieldSearch, Alignment.MIDDLE_CENTER); windowLayout.addComponent(footer); windowLayout.setHeight("350px"); return windowLayout; }
From source file:dhbw.clippinggorilla.userinterface.views.InterestProfileView.java
public Component getCategories(InterestProfile profile) { Map<Category, Boolean> categories = profile.getCategories(); VerticalLayout categoriesLayout = new VerticalLayout(); categoriesLayout.setWidth("100%"); Panel categoriesPanel = new Panel(categoriesLayout); categories.entrySet().stream().sorted((e1, e2) -> e1.getKey().getName().compareTo(e2.getKey().getName())) .forEach(e -> {//from www . ja va2 s. c o m Category category = e.getKey(); boolean enabled = e.getValue(); GridLayout categoryLayout = new GridLayout(3, 1); categoryLayout.setWidth("100%"); CheckBox categorySelected = new CheckBox(); categorySelected.setValue(enabled); categorySelected.addStyleName(ValoTheme.CHECKBOX_LARGE); categorySelected.addValueChangeListener(v -> categories.replace(category, v.getValue())); Label categoryIcon = new Label(category.getIcon().getHtml(), ContentMode.HTML); categoryIcon.addStyleName(ValoTheme.LABEL_H3); categoryIcon.addStyleName(ValoTheme.LABEL_NO_MARGIN); Label categoryName = new Label(category.getName(), ContentMode.HTML); Language.setCustom(null, s -> categoryName.setValue(category.getName())); categoryName.addStyleName(ValoTheme.LABEL_H3); categoryName.addStyleName(ValoTheme.LABEL_NO_MARGIN); categoryLayout.addComponents(categorySelected, categoryIcon, categoryName); categoryLayout.setComponentAlignment(categorySelected, Alignment.MIDDLE_CENTER); categoryLayout.setComponentAlignment(categoryIcon, Alignment.MIDDLE_LEFT); categoryLayout.setComponentAlignment(categoryName, Alignment.MIDDLE_LEFT); categoryLayout.setColumnExpandRatio(2, 5); categoryLayout.setSpacing(true); categoriesLayout.addComponent(categoryLayout); }); categoriesPanel.setContent(categoriesLayout); categoriesPanel.setHeight("100%"); categoriesPanel.setCaption(Language.get(Word.CATEGORIES)); Language.setCustom(Word.CATEGORIES, s -> categoriesPanel.setCaption(s)); return categoriesPanel; }