List of usage examples for com.vaadin.ui Component addStyleName
public void addStyleName(String style);
From source file:com.klwork.explorer.ui.user.ProfilePanel.java
License:Apache License
protected void addProfileEntry(GridLayout layout, Component name, Component value) { name.addStyleName(ExplorerLayout.STYLE_PROFILE_FIELD); name.setSizeUndefined();// w ww . j ava 2s . com layout.addComponent(name); value.setSizeUndefined(); layout.addComponent(value); }
From source file:com.kpg.diary.ui.MenuLayout.java
License:Apache License
/** * Adds the menu.//from w w w . ja va2s. co m * * @param menu * the menu */ private void addMenu(Component menu) { menu.addStyleName(ValoTheme.MENU_PART); menuArea.addComponent(menu); }
From source file:com.lst.deploymentautomation.vaadin.core.AppView.java
License:Open Source License
@Override public void attach() { super.attach(); if (title.getParent() == null) { try {/*from w w w . j ava2s . co m*/ CustomLayout titleWrapper = new CustomLayout( new ByteArrayInputStream("<h1 location='title'></h1>".getBytes("UTF-8"))); titleWrapper.addComponent(title, "title"); Component header = createHeader(titleWrapper); header.addStyleName("view-header"); layout.addComponent(header); } catch (IOException e) { //should not happen; rethrow throw new RuntimeException(e); } } }
From source file:com.lst.deploymentautomation.vaadin.page.TodoListView.java
License:Open Source License
@SuppressWarnings("serial") @Override//from ww w .j a v a 2 s .c o m protected Component createHeader(Component titleComponent) { LspsUI ui = (LspsUI) getUI(); actionBtn = new MenuBar(); actionBtn.addStyleName("menu-button-action"); actionBtn.setVisible(false); //initially hidden MenuItem actions = actionBtn.addItem("", new ThemeResource("../icons/popup-menu.png"), null); final ViewAction refreshTodos = new ViewAction() { @Override public void invoke() { toggleSelectionMode(false); container.refresh(); } }; actions.addItem(ui.getMessage("action.lock"), new Command() { @Override public void menuSelected(MenuItem selectedItem) { lock(); } }); actions.addItem(ui.getMessage("action.annotate") + "...", new Command() { @Override public void menuSelected(MenuItem selectedItem) { getUI().addWindow(new TodoAnnotation(getSelectedTodoIds(), refreshTodos)); } }); actions.addSeparator(); actions.addItem(ui.getMessage("action.unlock"), new Command() { @Override public void menuSelected(MenuItem selectedItem) { unlock(); } }); actions.addItem(ui.getMessage("action.reject") + "...", new Command() { @Override public void menuSelected(MenuItem selectedItem) { getUI().addWindow(new TodoRejection(getSelectedTodoIds(), refreshTodos)); } }); actions.addItem(ui.getMessage("action.delegate") + "...", new Command() { @Override public void menuSelected(MenuItem selectedItem) { getUI().addWindow(new TodoDelegation(getSelectedTodoIds(), refreshTodos)); } }); actions.addItem(ui.getMessage("action.escalate") + "...", new Command() { @Override public void menuSelected(MenuItem selectedItem) { getUI().addWindow(new TodoEscalation(getSelectedTodoIds(), refreshTodos)); } }); selectBtn = new Button(ui.getMessage("action.select"), new ClickListener() { @Override public void buttonClick(ClickEvent event) { toggleSelectionMode(true); } }); selectBtn.addStyleName("menu-button"); cancelBtn = new Button(ui.getMessage("action.cancel"), new ClickListener() { @Override public void buttonClick(ClickEvent event) { toggleSelectionMode(false); } }); cancelBtn.setVisible(false); //initially hidden cancelBtn.addStyleName("menu-button"); titleComponent.addStyleName("l-content-title"); HorizontalLayout layout = new HorizontalLayout(); HorizontalLayout btnLayout = new HorizontalLayout(); layout.setWidth("100%"); layout.addComponent(titleComponent); layout.addComponent(btnLayout); layout.setSpacing(true); btnLayout.addComponent(actionBtn); btnLayout.addComponent(cancelBtn); btnLayout.addComponent(selectBtn); layout.setComponentAlignment(btnLayout, Alignment.MIDDLE_RIGHT); return layout; }
From source file:com.mycollab.mobile.ui.AbstractPagedBeanList.java
License:Open Source License
protected void renderRows() { int i = 0;/*from w ww .ja v a 2s . co m*/ for (final B item : currentListData) { final Component row = rowDisplayHandler.generateRow(this, item, i); row.addStyleName("row"); listContainer.addComponent(row); i++; } }
From source file:com.mycollab.mobile.ui.AbstractPagedBeanList.java
License:Open Source License
private void loadMore() { currentPage += 1;/*from www . j a v a 2 s. c o m*/ searchRequest.setCurrentPage(currentPage); List<B> currentData = this.queryCurrentData(); if (currentListData == null) currentListData = new ArrayList<>(); currentListData.addAll(currentData); currentViewCount += currentListData.size(); int i = currentViewCount + 1; for (final B item : currentData) { final Component row = rowDisplayHandler.generateRow(this, item, i); row.addStyleName("row"); if (row != null) { listContainer.addComponent(row); } i++; } }
From source file:com.mycollab.mobile.ui.AbstractPagedBeanList.java
License:Open Source License
public void addComponentAtTop(Component component) { component.addStyleName("row"); listContainer.addComponentAsFirst(component); }
From source file:com.mycollab.vaadin.web.ui.NotificationComponent.java
License:Open Source License
@Override public void popupVisibilityChange(PopupVisibilityEvent event) { notificationContainer.removeAllComponents(); if (notificationItems.size() > 0) { for (AbstractNotification item : notificationItems) { Component comp = buildComponentFromNotification(item); comp.setStyleName("notification-type"); comp.addStyleName("notification-type-" + item.getType()); notificationContainer.addComponent(comp); }// w w w .j a v a 2s. c o m } else { Label noItemLbl = new Label(UserUIContext.getMessage(ShellI18nEnum.OPT_NO_NOTIFICATION)); notificationContainer.addComponent(noItemLbl); notificationContainer.setComponentAlignment(noItemLbl, Alignment.MIDDLE_CENTER); } }
From source file:com.neatresults.mgnltweaks.app.status.ConfigStatusViewImpl.java
License:Open Source License
@Override public void build() { Component totalExtends = buildAndBind(ConfigStatusView.EXTENDS_COUNT, translator.translate("neatconfiguration.app.status.extendscount")); Component absoluteExtends = buildAndBind(ConfigStatusView.ABS_EXTENDS_COUNT, translator.translate("neatconfiguration.app.status.absoluteextendscount")); Component relativeExtends = buildAndBind(ConfigStatusView.REL_EXTENDS_COUNT, translator.translate("neatconfiguration.app.status.relativeextendscount")); Component overrideExtends = buildAndBind(ConfigStatusView.OVR_EXTENDS_COUNT, translator.translate("neatconfiguration.app.status.overrideextendscount")); Component unresolvedExtends = buildAndBind(ConfigStatusView.EXTENDS_FAIL_COUNT, translator.translate("neatconfiguration.app.status.extendsfailcount")); Component unresolvedExtendsList = buildAndBindList(ConfigStatusView.EXTENDS_FAIL_LIST, translator.translate("neatconfiguration.app.status.extendsfaillist")); unresolvedExtendsList.addStyleName("neat-extends-list"); // top title//from w w w. ja v a 2 s . c o m FormLayout layout = new FormLayout(); Label sectionTitle = new Label(translator.translate("neatconfiguration.app.status.top.title")); sectionTitle.addStyleName("section-title"); layout.addComponent(sectionTitle); root.addSection(layout); // extends layout = new FormLayout(); layout.addComponent( createFieldsetTitle(translator.translate("neatconfiguration.app.status.extends.title"))); layout.addComponent(totalExtends); layout.addComponent(absoluteExtends); layout.addComponent(relativeExtends); layout.addComponent(overrideExtends); layout.addComponent(unresolvedExtends); layout.addComponent(unresolvedExtendsList); root.addSection(layout); // refresh layout = new FormLayout(); Button refreshButton = new Button(translator.translate("neatconfiguration.app.status.refresh.caption")); refreshButton.addStyleName("v-button-smallapp"); refreshButton.addStyleName("commit"); refreshButton.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { getListener().refreshData(); refresh(); } }); layout.addComponent(refreshButton); root.addSection(layout); }
From source file:com.nfl.dm.clubsites.cms.articles.subapp.articleeditor.bodyeditor.BodyEditorViewImpl.java
License:Open Source License
@Override public void addHiddenComponent(Component c) { c.addStyleName("hidden-component"); layout.addComponent(c); }