@Override protected CssLayout createCompositionRoot() { CssLayout layout = new CssLayout(); layout.addStyleName(ValoTheme.MENU_PART); if (largeIcons) { layout.addStyleName(ValoTheme.MENU_PART_LARGE_ICONS); } layout.setWidth(null); layout.setHeight("100%"); if (logo != null) { layout.addComponent(logo); } if (headerLayout != null) { layout.addComponent(headerLayout); } return layout; }
private CssLayout createGroup(Component... components) { CssLayout group = new CssLayout(); group.addStyleName("toolbar-component-group"); group.setSizeFull(); for (Component eachComponent : components) { eachComponent.setPrimaryStyleName("toolbar-group-item"); group.addComponent(eachComponent); } return group; }
/** * @see org.opencms.ui.apps.I_CmsAppUIContext#setAppInfo(com.vaadin.ui.Component) */ public void setAppInfo(Component infoContent) { m_infoArea.removeAllComponents(); m_infoArea.addComponent(infoContent); }
addComponent(newComponent); } else if (newLocation == -1) { removeComponent(oldComponent); addComponent(newComponent, oldLocation); } else { if (oldLocation > newLocation) { markAsDirty();
protected Layout createLinksLayout() { CssLayout linksLayout = new CssLayout(); linksLayout.setPrimaryStyleName("c-breadcrumbs"); return linksLayout; }
protected void initLayout() { container = new CssLayout(); container.setSizeFull(); container.setPrimaryStyleName(CURRENCYFIELD_LAYOUT_STYLENAME); container.addComponent(currencyLabel); if (useWrapper()) { ie9InputWrapper = new CssLayout(textField); ie9InputWrapper.setSizeFull(); ie9InputWrapper.setPrimaryStyleName(IE9_INPUT_WRAP_STYLENAME); container.addComponent(ie9InputWrapper); } else { container.addComponent(textField); } setFocusDelegate(textField); }
public InfoPanel(SearchBox searchBox) { setId(ID); addStyleName(ID); addStyleName("v-scrollable"); // A CssLayout is a simple "div"-element. This makes it much easier to custom style it toggleButton = new CssLayout(); toggleButton.setStyleName("toggle-button"); toggleButton.setDescription(HIDE_TOOLTIP); toggleButton.addLayoutClickListener((event) -> { expanded = !expanded; if (expanded) { toggleButton.removeStyleName("info-panel-collapsed"); toggleButton.setDescription(HIDE_TOOLTIP); } else { toggleButton.addStyleName("info-panel-collapsed"); toggleButton.setDescription(SHOW_TOOLTIP); } refreshInfoArea(); }); staticComponents.add(searchBox); staticComponents.add(toggleButton); }
private void initMenu() { this.menuPart = new CssLayout(); this.menuPart.addStyleName(ValoTheme.MENU_PART); this.menuPart.addComponent(top); final Button showMenu = new Button("Menu", (Button.ClickListener) event -> { if (this.menuPart.getStyleName().contains(VALO_MENU_VISIBLE)) { this.menuPart.removeStyleName(VALO_MENU_VISIBLE); } else { this.menuPart.addStyleName(VALO_MENU_VISIBLE); showMenu.addStyleName(VALO_MENU_TOGGLE); showMenu.setIcon(VaadinIcons.MENU); menuPart.addComponent(showMenu); menuItemsLayout = new CssLayout(); menuItemsLayout.setPrimaryStyleName(VALO_MENUITEMS); menuPart.addComponent(menuItemsLayout);
private void initContainer() { CssLayout viewContainer = new CssLayout(); viewContainer.addStyleName("valo-content"); viewContainer.setSizeFull(); this.container = viewContainer; }
private Component createAutomaticUpdatePeriodControl(NativeSelect combo) { final CssLayout wrapper = new CssLayout() { @Override protected String getCss(Component c) { StringBuilder sb = new StringBuilder("display: inline-block; min-width: 50px;"); if (getComponentIndex(c) > 0) { sb.append("margin-left: 5px"); } return sb.toString(); } }; wrapper.setWidth("100%"); Label captionLabel = new Label(translator.translate(REPEAT_EVERY)); captionLabel.setSizeUndefined(); wrapper.addComponent(captionLabel); wrapper.addComponent(combo); Label minutesLabel = new Label(translator.translate(MINUTES)); minutesLabel.setSizeUndefined(); wrapper.addComponent(minutesLabel); return wrapper; } }
private Component buildHeader() { final CssLayout cssLayout = new CssLayout(); cssLayout.setStyleName("view-header"); return cssLayout; }
protected void initLayout() { container = new CubaCssActionsLayout(); container.setPrimaryStyleName(LAYOUT_STYLENAME); container.setWidth(100, Unit.PERCENTAGE); field.setWidth(100, Unit.PERCENTAGE); Page current = Page.getCurrent(); if (current != null) { WebBrowser browser = current.getWebBrowser(); if (browser != null && browser.isSafari()) { inputWrapper = new CssLayout(); inputWrapper.setWidth(100, Unit.PERCENTAGE); inputWrapper.setPrimaryStyleName("safari-input-wrap"); inputWrapper.addComponent(field); container.addComponent(inputWrapper); } else { container.addComponent(field); } } else { container.addComponent(field); } setFocusDelegate((Focusable) field); }
private Component buildLabels() { CssLayout labels = new CssLayout(); labels.addStyleName("labels"); Label welcome = new Label("Welcome"); welcome.setSizeUndefined(); welcome.addStyleName(ValoTheme.LABEL_H4); welcome.addStyleName(ValoTheme.LABEL_COLORED); labels.addComponent(welcome); Label title = new Label("Three <strong>Sixty</strong>", ContentMode.HTML); title.setSizeUndefined(); title.addStyleName(ValoTheme.LABEL_H3); title.addStyleName(ValoTheme.LABEL_LIGHT); labels.addComponent(title); return labels; }
final CssLayout content = new CssLayout(); content.setSizeFull(); content.addComponent(form.asVaadinComponent()); content.removeAllComponents(); content.addComponent(form.getLayout(locale)); });
protected void initDescription(HorizontalLayout layout) { final CssLayout descriptionLayout = new CssLayout(); descriptionLayout.setWidth(100, UNITS_PERCENTAGE); layout.addComponent(descriptionLayout); layout.setExpandRatio(descriptionLayout, 1.0f); descriptionLayout.addComponent(descriptionLabel); descriptionLayout.addListener(new LayoutClickListener() { public void layoutClick(LayoutClickEvent event) { if (event.getClickedComponent() != null && event.getClickedComponent().equals(descriptionLabel)) {
contentLayout = new CssLayout(); contentLayout.setSizeFull(); contentLayout.addComponent(new Label("Nothing to display"));
private CssLayout buildLoginInformation() { CssLayout loginInformation = new CssLayout(); loginInformation.setStyleName("login-information"); Label loginInfoText = new Label(MNls.find(this,"login.info.text=Content Editor"), ContentMode.HTML); loginInformation.addComponent(loginInfoText); return loginInformation; }
public void switchTo(State state) { if (this.state != state) { component.getUI().focus(); component.removeAllComponents(); component.addComponent(singleContainer); } else { component.addComponent(tabbedContainer); component.addStyleName(STATE_WINDOWS_STYLENAME); component.removeStyleName(STATE_INITIAL_STYLENAME); } else { component.addComponent(initialLayout.unwrapComposition(com.vaadin.ui.Component.class)); component.removeStyleName(STATE_WINDOWS_STYLENAME); component.addStyleName(STATE_INITIAL_STYLENAME);
protected void initHeader() { header = new CssLayout(); header.addStyleName(ExplorerLayout.STYLE_HEADER); header.setWidth(100, UNITS_PERCENTAGE); addComponent(header); }
public Window build() { Window dialog = new Window(); dialog.addStyleName("light-box"); dialog.setDraggable(false); dialog.setResizable(false); dialog.setModal(true); dialog.setWidth(95, Sizeable.Unit.PERCENTAGE); CssLayout contentWrapper = new CssLayout(content); contentWrapper.setSizeFull(); contentWrapper.setStyleName("light-box-content"); dialog.setContent(contentWrapper); dialog.center(); return dialog; }