/** * Adds a menu entry button.<p> * * @param entryButton the entry button */ public void addMenuEntry(Button entryButton) { entryButton.setPrimaryStyleName(OpenCmsTheme.VERTICAL_MENU_ITEM); addComponent(entryButton); }
resize.setWidth("100%"); resize.setHeight("10px"); resize.setPrimaryStyleName("resize-button"); layout.addComponent(resize);
/** * Adds an entry to the menu, returns the entry button.<p> * * @param label the label * @param icon the icon * * @return the entry button */ public Button addMenuEntry(String label, Resource icon) { Button button = new Button(label, icon); button.setPrimaryStyleName(OpenCmsTheme.VERTICAL_MENU_ITEM); addComponent(button); return button; } }
public Button addTab(String text) { Button button = new Button(text); button.setPrimaryStyleName(lightTheme ? Styles.Tabs.Text.LIGHT : Styles.Tabs.Text.DARK); button.addClickListener(event -> selectTab(button)); buttons.add(button); addComponent(button); return button; }
public Button addToggleButton(Resource icon) { Button button = new Button(icon); button.setPrimaryStyleName(Styles.Buttons.Toggle.BUTTON); button.addClickListener(event -> selectToggleButton(button)); buttons.add(button); addComponent(button); return button; }
public Button addTab(MaterialIcons icon) { Button button = new Button(); button.setPrimaryStyleName(lightTheme ? Styles.Tabs.Icon.LIGHT : Styles.Tabs.Icon.DARK); button.setIcon(icon); button.addClickListener(event -> selectTab(button)); buttons.add(button); addComponent(button); return button; }
/** * Creates a navigation button to the view identified by {@code name} using * {@code caption} and {@code icon}. * * @param name view name * @param caption view caption in the menu * @param icon view icon in the menu */ public void addViewButton(final String name, String caption, Resource icon) { Button button = new Button(caption, (Button.ClickListener) event -> navigator.navigateTo("detail/" + CACHE_PARAMETER_KEY + "=" + name)); button.setPrimaryStyleName(ValoTheme.MENU_ITEM); button.setIcon(icon); menuItemsLayout.addComponent(button); viewButtons.put(name, button); }
public Button addTab(MaterialIcons icon, String text) { Button button = new Button(text); button.setPrimaryStyleName(lightTheme ? Styles.Tabs.IconText.LIGHT : Styles.Tabs.IconText.DARK); button.setIcon(icon); button.addClickListener(event -> selectTab(button)); buttons.add(button); addComponent(button); return button; }
public DatePickerFooter(InlineDateField field, boolean lightTheme) { setAlignItems(FlexLayout.AlignItems.CENTER); setJustifyContent(FlexLayout.JustifyContent.FLEX_END); addStyleName(Paddings.All.SMALL); addStyleName(Spacings.Right.SMALL); addStyleName(FlexItem.FlexShrink.SHRINK_0); cancel = new Button("Cancel"); cancel.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK); ok = new Button("OK"); ok.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK); ok.setEnabled(field.getValue() != null); this.field = field; this.field.addValueChangeListener(event -> ok.setEnabled(this.field.getValue() != null)); addComponents(cancel, ok); }
public AppBar() { super(); setPrimaryStyleName("md-appbar"); addStyleName(MaterialColor.BLUE_500.getBackgroundColorStyle()); naviIcon.setIcon(MaterialIcons.MENU); naviIcon.setPrimaryStyleName(Styles.Buttons.NAV_ICON); Label appBarTitle = new Label("Material Design"); appBarTitle.setPrimaryStyleName(Typography.Light.Title.PRIMARY); appBarTitle.setSizeUndefined(); addComponents(naviIcon, appBarTitle); }
@Override public Object generateCell(Table table, Object itemId, Object propertyId) { final SurveillanceViewService.NodeRtc nodeRtc = (SurveillanceViewService.NodeRtc) itemId; Button button = new Button(nodeRtc.getNode().getLabel()); button.setPrimaryStyleName(BaseTheme.BUTTON_LINK); button.setEnabled(m_enabled); button.addStyleName("white"); button.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent clickEvent) { final URI currentLocation = Page.getCurrent().getLocation(); final String contextRoot = VaadinServlet.getCurrent().getServletContext().getContextPath(); final String redirectFragment = contextRoot + "/element/node.jsp?quiet=true&node=" + nodeRtc.getNode().getId(); LOG.debug("node {} clicked, current location = {}, uri = {}", nodeRtc.getNode().getId(), currentLocation, redirectFragment); try { SurveillanceViewNodeRtcTable.this.getUI().addWindow(new InfoWindow(new URL(currentLocation.toURL(), redirectFragment), new InfoWindow.LabelCreator() { @Override public String getLabel() { return "Node Info " + nodeRtc.getNode().getId(); } })); } catch (MalformedURLException e) { LOG.error(e.getMessage(), e); } } }); return button; } });
@Override public Object generateCell(Table table, Object itemId, Object propertyId) { final SurveillanceViewService.NodeRtc nodeRtc = (SurveillanceViewService.NodeRtc) itemId; Button button = new Button(nodeRtc.getNode().getLabel()); button.setPrimaryStyleName(BaseTheme.BUTTON_LINK); button.setEnabled(m_enabled); button.addStyleName("white"); button.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent clickEvent) { final URI currentLocation = getUI().getPage().getLocation(); final String contextRoot = VaadinServlet.getCurrent().getServletContext().getContextPath(); final String redirectFragment = contextRoot + "/element/node.jsp?quiet=true&node=" + nodeRtc.getNode().getId(); LOG.debug("node {} clicked, current location = {}, uri = {}", nodeRtc.getNode().getId(), currentLocation, redirectFragment); try { SurveillanceViewNodeRtcTable.this.getUI().addWindow(new InfoWindow(new URL(currentLocation.toURL(), redirectFragment), new InfoWindow.LabelCreator() { @Override public String getLabel() { return "Node Info " + nodeRtc.getNode().getId(); } })); } catch (MalformedURLException e) { LOG.error(e.getMessage(), e); } } }); return button; } });
private Component buildToggleButton() { showMenuButton.addClickListener(new ClickListener() { @Override public void buttonClick(final ClickEvent event) { if(menu.getStyleName().contains("valo-menu-visible")) { menu.setVisible(false); menu.removeStyleName("valo-menu-visible"); } else { menu.setVisible(true); menu.addStyleName("valo-menu-visible"); } } }); menu.setVisible(false); showMenuButton.addStyleName(ValoTheme.BUTTON_PRIMARY); showMenuButton.addStyleName(ValoTheme.BUTTON_SMALL); showMenuButton.setIcon(FontAwesome.LIST); showMenuButton.setPrimaryStyleName("valo-menu-item"); menu.setStyleName("valo-menu-visible"); return showMenuButton; }
public SimpleDialog(String title, String message, boolean lightTheme) { super(title); addStyleName(lightTheme ? Styles.Windows.LIGHT : Styles.Windows.DARK); label = new Label(message); label.setPrimaryStyleName(lightTheme ? Typography.Dark.Subheader.SECONDARY : Typography.Light.Subheader.SECONDARY); label.addStyleName(Paddings.Horizontal.LARGE + " " + Paddings.Bottom.LARGE); // Footer cancel = new Button("Cancel"); cancel.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK); cancel.addClickListener(e -> close()); ok = new Button("OK"); ok.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK); ok.addClickListener(e -> close()); footer = new FlexLayout(cancel, ok); footer.setJustifyContent(FlexLayout.JustifyContent.FLEX_END); footer.addStyleName(Paddings.All.SMALL + " " + Spacings.Right.SMALL + " " + FlexItem.FlexShrink.SHRINK_0); footer.setWidth(100, Unit.PERCENTAGE); // Content wrapper content = new FlexLayout(FlexLayout.FlexDirection.COLUMN, label, footer); setContent(content); }
private void construct() { mainLayout.setPrimaryStyleName("switcher"); mainLayout.addStyleName(VARIATION_GREEN.equals(colorVariation) ? cssGreenVariationClassname : cssBlackVariationClassname); // back-arrow back = new Button(""); back.setPrimaryStyleName(cssSwitcherArrowClassname); back.addStyleName("icon-arrow2_w"); mainLayout.addComponent(back); // combobox with descriptionLabel below wrapped in verticalLayout // comboLayout.setWidth(100, Unit.PERCENTAGE); combobox.setWidth(100, Unit.PERCENTAGE); comboLayout.addComponent(combobox); // descriptionLabel descriptionLabel = new Label(""); descriptionLabel.setPrimaryStyleName("switcherItemDescription"); descriptionLabel.addStyleName("descriptionLabel"); comboLayout.addComponent(descriptionLabel); mainLayout.addComponent(comboLayout); mainLayout.setExpandRatio(comboLayout, 1.0f); // forward arrow forward = new Button(""); forward.setPrimaryStyleName(cssSwitcherArrowClassname); forward.addStyleName("icon-arrow2_e"); mainLayout.addComponent(forward); updateButtonState(getValue()); updateItemDescription(); }
public ScrollableDialog(String title, boolean lightTheme) { super(title); setPrimaryStyleName(lightTheme ? Styles.Windows.LIGHT : Styles.Windows.DARK); addStyleName(Styles.Windows.SCROLLABLE); scrollableLayout = new FlexLayout(FlexLayout.FlexDirection.COLUMN); scrollableLayout.setOverflow(FlexLayout.Overflow.AUTO); scrollableLayout.addStyleName(Paddings.Horizontal.LARGE); scrollableLayout.addStyleName(FlexItem.FlexGrow.GROW_1); // Footer cancel = new Button("Cancel"); cancel.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK); cancel.addClickListener(e -> close()); ok = new Button("OK"); ok.setPrimaryStyleName(lightTheme ? Styles.Buttons.Flat.LIGHT : Styles.Buttons.Flat.DARK); ok.addClickListener(e -> close()); footer = new FlexLayout(cancel, ok); footer.setJustifyContent(FlexLayout.JustifyContent.FLEX_END); footer.addStyleName(Paddings.All.SMALL + " " + Spacings.Right.SMALL + " " + FlexItem.FlexShrink.SHRINK_0); footer.addStyleName(lightTheme ? Borders.Light.TOP : Borders.Dark.TOP); footer.setWidth(100, Sizeable.Unit.PERCENTAGE); // Content wrapper content = new FlexLayout(FlexLayout.FlexDirection.COLUMN, scrollableLayout, footer); content.addStyleName(MaxHeights.MH_FULL); setContent(content); }
button.setPrimaryStyleName(BaseTheme.BUTTON_LINK); button.setEnabled(m_enabled);
button.setPrimaryStyleName(BaseTheme.BUTTON_LINK); button.setEnabled(m_enabled);
button.setPrimaryStyleName(BaseTheme.BUTTON_LINK); button.setEnabled(m_enabled);
button.setPrimaryStyleName(BaseTheme.BUTTON_LINK); button.setEnabled(m_enabled);