List of usage examples for com.vaadin.ui Label addStyleName
@Override public void addStyleName(String style)
From source file:com.github.peholmst.mvp4vaadin.navigation.ui.NavigationBar.java
License:Apache License
/** * Creates and adds a new separator label to the navigation bar. * // ww w .ja v a 2 s. c om * @return the added separator label. */ protected Label addViewSeparator() { final Label lbl = new Label(""); lbl.setSizeUndefined(); lbl.addStyleName(BREADCRUMB_ELEMENT); addComponent(lbl); // setComponentAlignment(lbl, Alignment.MIDDLE_LEFT); return lbl; }
From source file:com.gmail.volodymyrdotsenko.cms.fe.vaadin.views.HomeView.java
License:Apache License
public HomeView() { setSpacing(true);/*from w w w . j ava2 s . c om*/ setMargin(true); Label header = new Label("Welcome to CMS application"); header.addStyleName(ValoTheme.LABEL_H1); addComponent(header); // Label body = new Label("<p>This application demonstrate how a Vaadin // application can take care of security itself while still integrating // with Spring Security.</p>" + // "<p>Please try it out by clicking and navigating around as different // users. You can log in as <em>user/user</em> or <em>admin/admin</em>. // Some of the protected " + // "features are hidden from the UI when you cannot access them, others // are visible all the time.</p>" + // "<p>Also note that since we are using web socket based push, we do // not have access to cookies and therefore cannot use Remember Me // services.</p>"); // body.setContentMode(ContentMode.HTML); // addComponent(body); }
From source file:com.haulmont.cuba.web.AppUI.java
License:Apache License
protected void showCriticalExceptionMessage(Exception exception) { String initErrorCaption = messages.getMainMessage("app.initErrorCaption"); String initErrorMessage = messages.getMainMessage("app.initErrorMessage"); VerticalLayout content = new VerticalLayout(); content.setStyleName("c-init-error-view"); content.setSizeFull();/*from w w w.ja v a2s . co m*/ VerticalLayout errorPanel = new VerticalLayout(); errorPanel.setStyleName("c-init-error-panel"); errorPanel.setWidthUndefined(); errorPanel.setSpacing(true); Label captionLabel = new Label(initErrorCaption); captionLabel.setWidthUndefined(); captionLabel.setStyleName("c-init-error-caption"); captionLabel.addStyleName("h2"); captionLabel.setValue(initErrorCaption); errorPanel.addComponent(captionLabel); Label messageLabel = new Label(initErrorCaption); messageLabel.setWidthUndefined(); messageLabel.setStyleName("c-init-error-message"); messageLabel.setValue(initErrorMessage); errorPanel.addComponent(messageLabel); Button retryButton = new Button(messages.getMainMessage("app.initRetry")); retryButton.setStyleName("c-init-error-retry"); retryButton.addClickListener(event -> { // always restart UI String url = ControllerUtils.getLocationWithoutParams() + "?restartApp"; getPage().open(url, "_self"); }); errorPanel.addComponent(retryButton); errorPanel.setComponentAlignment(retryButton, Alignment.MIDDLE_CENTER); content.addComponent(errorPanel); content.setComponentAlignment(errorPanel, Alignment.MIDDLE_CENTER); setContent(content); }
From source file:com.hivesys.dashboard.view.preferences.PreferencesView.java
License:Apache License
public PreferencesView() { user = (User) VaadinSession.getCurrent().getAttribute(User.class.getName()); setSpacing(true);/* w w w . j a va 2 s. c om*/ setMargin(true); Label title = new Label("Forms"); title.addStyleName("h1"); addComponent(title); final FormLayout form = new FormLayout(); form.setMargin(false); form.setWidth("800px"); form.addStyleName("light"); addComponent(form); Label section = new Label("Personal Info"); section.addStyleName("h2"); section.addStyleName("colored"); form.addComponent(section); firstNameField = new TextField("First Name"); firstNameField.setWidth("50%"); form.addComponent(firstNameField); lastNameField = new TextField("Last Name"); lastNameField.setWidth("50%"); form.addComponent(lastNameField); titleField = new ComboBox("Title"); titleField.setInputPrompt("Please specify"); titleField.addItem("Mr."); titleField.addItem("Mrs."); titleField.addItem("Ms."); titleField.setNewItemsAllowed(true); form.addComponent(titleField); usernameField = new TextField("Username"); usernameField.setRequired(true); form.addComponent(usernameField); sexField = new OptionGroup("Sex"); sexField.addItem(Boolean.FALSE); sexField.setItemCaption(Boolean.FALSE, "Female"); sexField.addItem(Boolean.TRUE); sexField.setItemCaption(Boolean.TRUE, "Male"); sexField.addStyleName("horizontal"); form.addComponent(sexField); section = new Label("Contact Info"); section.addStyleName("h3"); section.addStyleName("colored"); form.addComponent(section); emailField = new TextField("Email"); emailField.setWidth("50%"); emailField.setRequired(true); form.addComponent(emailField); locationField = new TextField("Location"); locationField.setWidth("50%"); locationField.setNullRepresentation(""); form.addComponent(locationField); phoneField = new TextField("Phone"); phoneField.setWidth("50%"); phoneField.setNullRepresentation(""); form.addComponent(phoneField); section = new Label("Additional Info"); section.addStyleName("h4"); section.addStyleName("colored"); form.addComponent(section); websiteField = new TextField("Website"); websiteField.setInputPrompt("http://"); websiteField.setWidth("100%"); form.addComponent(websiteField); bioField = new RichTextArea("Bio"); bioField.setWidth("100%"); bioField.setValue( "<div><p><span>Integer legentibus erat a ante historiarum dapibus.</span> <span>Vivamus sagittis lacus vel augue laoreet rutrum faucibus.</span> <span>A communi observantia non est recedendum.</span> <span>Morbi fringilla convallis sapien, id pulvinar odio volutpat.</span> <span>Ab illo tempore, ab est sed immemorabili.</span> <span>Quam temere in vitiis, legem sancimus haerentia.</span></p><p><span>Morbi odio eros, volutpat ut pharetra vitae, lobortis sed nibh.</span> <span>Quam diu etiam furor iste tuus nos eludet?</span> <span>Cum sociis natoque penatibus et magnis dis parturient.</span> <span>Quam diu etiam furor iste tuus nos eludet?</span> <span>Tityre, tu patulae recubans sub tegmine fagi dolor.</span></p><p><span>Curabitur blandit tempus ardua ridiculus sed magna.</span> <span>Phasellus laoreet lorem vel dolor tempus vehicula.</span> <span>Etiam habebis sem dicantur magna mollis euismod.</span> <span>Hi omnes lingua, institutis, legibus inter se differunt.</span></p></div>"); form.addComponent(bioField); Button edit = new Button("Edit", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { boolean readOnly = form.isReadOnly(); if (readOnly) { bioField.setReadOnly(false); form.setReadOnly(false); form.removeStyleName("light"); event.getButton().setCaption("Save"); event.getButton().addStyleName("primary"); } else { bioField.setReadOnly(true); form.setReadOnly(true); form.addStyleName("light"); event.getButton().setCaption("Edit"); event.getButton().removeStyleName("primary"); } } }); HorizontalLayout footer = new HorizontalLayout(); footer.setMargin(new MarginInfo(true, false, true, false)); footer.setSpacing(true); footer.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); form.addComponent(footer); footer.addComponent(edit); Label lastModified = new Label("Last modified by you a minute ago"); lastModified.addStyleName("light"); footer.addComponent(lastModified); fieldGroup = new BeanFieldGroup<>(User.class); fieldGroup.bindMemberFields(this); fieldGroup.setItemDataSource(user); form.setReadOnly(true); bioField.setReadOnly(true); }
From source file:com.hybridbpm.ui.MainMenu.java
License:Apache License
protected void addMenuItemComponent(final ViewDefinition viewDefinition, String parameters) { CssLayout dashboardWrapper = new CssLayout(); dashboardWrapper.addStyleName("badgewrapper"); dashboardWrapper.addStyleName(ValoTheme.MENU_ITEM); dashboardWrapper.setWidth(100.0f, Sizeable.Unit.PERCENTAGE); Label notificationsBadge = new Label(); notificationsBadge.addStyleName(ValoTheme.MENU_BADGE); notificationsBadge.setWidthUndefined(); notificationsBadge.setVisible(false); if (viewDefinition != null) { dashboardWrapper.addComponents(new ValoMenuItemButton(viewDefinition, parameters), notificationsBadge); menuItemsLayout.addComponent(dashboardWrapper); } else if (HybridbpmUI.getDeveloperMode()) { dashboardWrapper.addComponents(new ValoMenuAddViewButton(), notificationsBadge); menuItemsLayout.addComponent(dashboardWrapper); }/*from ww w . ja va 2 s .com*/ }
From source file:com.hybridbpm.ui.UsersMenu.java
License:Apache License
public void search(String text) { table.removeAllItems();/* ww w . j av a 2s .c om*/ List<User> list = HybridbpmUI.getAccessAPI().findUsersByName(text); for (User u : list) { Item item = table.addItem(u); Label notificationsBadge = new Label("45"); notificationsBadge.addStyleName(ValoTheme.MENU_BADGE); notificationsBadge.addStyleName(ValoTheme.LABEL_TINY); notificationsBadge.setWidthUndefined(); notificationsBadge.setDescription("45 task todo"); item.getItemProperty("tasks").setValue(notificationsBadge); } // table.select(list.get(0)); }
From source file:com.jorambarrez.PropertyPanel.java
License:Apache License
public void showNodeProperties(Node node) { currentNode = node;/* w ww . ja va 2 s. c o m*/ title.setValue(node.getText()); title.setContentMode(Label.CONTENT_DEFAULT); // Demo propertyLayout.removeAllComponents(); Label assigneeLabel = new Label("Assignee"); assigneeLabel.addStyleName(STYLE_BOLD); propertyLayout.addComponent(assigneeLabel); TextField assigneeTextField = new TextField(); assigneeTextField.setValue(node.getProperty("Assignee")); propertyLayout.addComponent(assigneeTextField); Label deadlineLabel = new Label("Deadline"); deadlineLabel.addStyleName(STYLE_BOLD); propertyLayout.addComponent(deadlineLabel); DateField deadlineField = new DateField(); SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy"); try { deadlineField.setValue(dateFormat.parseObject(node.getProperty("Deadline"))); propertyLayout.addComponent(deadlineField); } catch (Exception e) { e.printStackTrace(); } }
From source file:com.klwork.explorer.project.PublicProjectListPage.java
License:Apache License
Layout buildTree() { CssLayout margin = new CssLayout(); margin.setWidth("100%"); //margin.setMargin(new MarginInfo(true, false, true, true)); // Spacing//ww w . j av a 2 s . c om margin.addComponent(new Label(" ", ContentMode.HTML)); Label text = new Label("hello,word"); text.addStyleName(Runo.LABEL_SMALL); margin.addComponent(text); text.setWidth("90%"); Tree t = new Tree(); String itemId = "?"; t.addItem(itemId); t.select(itemId); t.setItemIcon(itemId, new ThemeResource("icons/16/calendar.png")); createTreeItem(t, "(5000)", itemId); t.expandItem(itemId); String itemId2 = ""; t.addItem(itemId2); t.setItemIcon(itemId2, new ThemeResource("icons/16/document.png")); createTreeItem(t, "?(300)", itemId2); createTreeItem(t, "log", itemId2); t.expandItem(itemId2); String itemId3 = "?"; t.addItem(itemId3); t.setItemIcon(itemId3, new ThemeResource("icons/16/document.png")); createTreeItem(t, "?(3009)", itemId3); createTreeItem(t, "(40000)", itemId3); t.expandItem(itemId3); margin.addComponent(t); return margin; }
From source file:com.klwork.explorer.project.PublicProjectListPage.java
License:Apache License
protected void addLeft() { Label title = new Label(""); title.addStyleName(ExplorerLayout.STYLE_H3); title.setWidth(100, Unit.PERCENTAGE); //grid.addComponent(title, 0, 0); }
From source file:com.klwork.explorer.ui.business.flow.act.MyTaskRelatedContentComponent.java
License:Apache License
protected void initActions() { // WW_TODO ?//w w w . j ava2 s. c o m HorizontalLayout actionsContainer = new HorizontalLayout(); actionsContainer.setSizeFull(); Label processTitle = new Label(relatedContentTitle); processTitle.addStyleName(ExplorerLayout.STYLE_H3); processTitle.setSizeFull(); actionsContainer.addComponent(processTitle); actionsContainer.setComponentAlignment(processTitle, Alignment.MIDDLE_LEFT); actionsContainer.setExpandRatio(processTitle, 1.0f); actionsContainer.setComponentAlignment(processTitle, Alignment.MIDDLE_RIGHT); //? if (!readOnly) { Button addRelatedContentButton = getAddButton(); actionsContainer.addComponent(addRelatedContentButton); } addComponent(actionsContainer); }