/** * Removes one or more style names from component. Multiple styles can be * specified by using multiple parameters. * * @param styles * the style name or style names to be removed * @see #removeStyleName(String) * @see #setStyleName(String) * @see #addStyleName(String) * @since 8.1 */ public default void removeStyleNames(String... styles) { for (String style : styles) { removeStyleName(style); } }
@Override public void removeStyleName(String style) { getRootOrThrow().removeStyleName(style); }
/** * Adds or removes a style name. Multiple styles can be specified as a * space-separated list of style names. * * If the {@code add} parameter is true, the style name is added to the * component. If the {@code add} parameter is false, the style name is * removed from the component. * <p> * Functionally this is equivalent to using {@link #addStyleName(String)} or * {@link #removeStyleName(String)} * * @since 8.5 * @param style * the style name to be added or removed * @param add * <code>true</code> to add the given style, <code>false</code> * to remove it * @see #addStyleName(String) * @see #removeStyleName(String) */ public default void setStyleName(String style, boolean add) { if (add) { addStyleName(style); } else { removeStyleName(style); } }
protected void showTabContent(Component component) { component.removeStyleName(HIDDEN_TAB); component.addStyleName(VISIBLE_TAB); }
@Override public void removeStyleName(String styleName) { getComposition().removeStyleName(styleName); }
protected void hideTabContent(Component component) { component.removeStyleName(VISIBLE_TAB); component.addStyleName(HIDDEN_TAB); }
/** * Call this method, when a new item is selected. It will adjust the style of the option buttons, thus that they stay visible. * * @param itemId the id of the newly selected item (row). */ void selectItem(final Object itemId) { if ((null != m_selectedItem) && (null != m_buttons.get(m_selectedItem))) { for (Component button : m_buttons.get(m_selectedItem)) { button.removeStyleName("borderless"); button.addStyleName("borderless-colored"); } } m_selectedItem = itemId; if ((null != m_selectedItem) && (null != m_buttons.get(m_selectedItem))) { for (Component button : m_buttons.get(m_selectedItem)) { button.removeStyleName("borderless-colored"); button.addStyleName("borderless"); } } }
@Override public void removeStyleName(String style) { super.removeStyleName(style); // replicate to content getContent().ifPresent(c -> c.removeStyleName(style)); }
@Override public void removeStyleName(String style) { super.removeStyleName(style); // replicate to content getContent().ifPresent(c -> c.removeStyleName(style)); }
@Override public void buttonClick(final ClickEvent event) { if (getCompositionRoot().getStyleName().contains(STYLE_VISIBLE)) { getCompositionRoot().removeStyleName(STYLE_VISIBLE); } else { getCompositionRoot().addStyleName(STYLE_VISIBLE); } } }
@Override public void buttonClick(final ClickEvent event) { if (getCompositionRoot().getStyleName().contains(STYLE_VISIBLE)) { getCompositionRoot().removeStyleName(STYLE_VISIBLE); } else { getCompositionRoot().addStyleName(STYLE_VISIBLE); } } }
protected void toggleMaximized(final Component panel, final boolean maximized) { if (maximized) { panel.setVisible(true); panel.addStyleName("max"); } else { panel.removeStyleName("max"); } }
@Override public void removeStyleName(String style) { super.removeStyleName(style); getContent().removeStyleName(style); }
@Override public void removeStyleName(String style) { super.removeStyleName(style); getContent().removeStyleName(style); }
@Override public void removeStyleName(String style) { super.removeStyleName(style); getContent().removeStyleName(style); }
private void toggleMaximized(final Component panel, final boolean maximized) { if (maximized) { panel.setVisible(true); panel.addStyleName("max"); } else { panel.removeStyleName("max"); } }
protected void setIconStyle() { if (StringUtils.isNotEmpty(getIcon()) && StringUtils.isEmpty(getCaption())) { getComposition().addStyleName("popupview-icon-on-left"); } else { getComposition().removeStyleName("popupview-icon-on-left"); } } }
/** * Sets the style.<p> * * @param style the style to set */ public void setStyle(String style) { if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_style)) { m_component.removeStyleName(m_style); } m_style = style; if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_style)) { m_component.addStyleName(m_style); } }
@Override public void setIcon(String icon) { this.icon = icon; if (StringUtils.isNotEmpty(icon)) { Resource iconResource = getIconResource(icon); getComposition().setIcon(iconResource); getComposition().addStyleName(ICON_STYLE); } else { getComposition().setIcon(null); getComposition().removeStyleName(ICON_STYLE); } }
public void setSelectionStatusComponent(Component c) { if (getState().selectionStatusComponent != null) { ((Component)getState().selectionStatusComponent).removeStyleName(""); } getState().selectionStatusComponent = c; if (getSession() != null) { c.addStyleName("crop-status" + getConnectorId()); } }