@Override public void setIconClass(final String iconClass) { if (iconClass != null && !iconClass.isEmpty()) { Stream.of(iconClass.split(" ")).forEach(clazz -> icon.getClassList().add(clazz)); } }
@Override public void setIconClass(final String iconClass) { if (iconClass != null && !iconClass.isEmpty()) { Stream.of(iconClass.split(" ")).forEach(clazz -> icon.getClassList().add(clazz)); } }
public void setIcon(final String iconClass){ icon.getClassList().add(iconClass); }
@Override public void setEnabled(final boolean enabled) { final DOMTokenList classList = text.getClassList(); if (enabled) { classList.remove(TEXT_MUTED); } else { classList.add(TEXT_MUTED); } }
private void openCloseExpand() { chevron.getClassList().toggle("fa-chevron-down"); if (!chevron.getClassList().contains("fa-chevron-down")) { expansionArea.getStyle().setProperty("display", "none"); chevron.getClassList().add("fa-chevron-right"); } else { chevron.getClassList().remove("fa-chevron-right"); expansionArea.getStyle().removeProperty("display"); } } }
@Override public void setStatus(final Collection<String> styles) { this.status.removeAttribute("class"); for (String style : styles) { this.status.getClassList().add(style); } }
private void openCloseExpand() { chevron.getClassList().toggle("fa-chevron-down"); if (!chevron.getClassList().contains("fa-chevron-down")) { expansionArea.getStyle().setProperty("display", "none"); chevron.getClassList().add("fa-chevron-right"); } else { chevron.getClassList().remove("fa-chevron-right"); expansionArea.getStyle().removeProperty("display"); } } }
@Override public void setStatus(final Collection<String> styles) { this.status.removeAttribute("class"); for (String style : styles) { this.status.getClassList().add(style); } }
@Override public void setValue(final ServiceTaskSummary model) { this.id = model.getId(); this.enabled.setValue(model.getEnabled(), false); this.serviceTasks.setModel(model); String[] classes = model.getIcon().split(" "); for (String css : classes) { this.icon.getClassList().add(css); } this.installedOn.setTextContent(String.valueOf(model.getInstalledOn().size())); }
@Override public void setValue(final ServiceTaskSummary model) { this.id = model.getId(); this.enabled.setValue(model.getEnabled(), false); this.serviceTasks.setModel(model); String[] classes = model.getIcon().split(" "); for (String css : classes) { this.icon.getClassList().add(css); } this.installedOn.setTextContent(String.valueOf(model.getInstalledOn().size())); }
@Test public void testType() { final DOMTokenList alertDomTokenList = mock(DOMTokenList.class); when(alert.getClassList()).thenReturn(alertDomTokenList); final DOMTokenList iconDomTokenList = mock(DOMTokenList.class); when(icon.getClassList()).thenReturn(iconDomTokenList); notification.setType(InlineNotification.InlineNotificationType.SUCCESS); verify(alertDomTokenList).add(InlineNotification.InlineNotificationType.SUCCESS.getCssClass()); verify(iconDomTokenList).add(InlineNotification.InlineNotificationType.SUCCESS.getIcon()); }
@Test public void testType() { final DOMTokenList alertDomTokenList = mock(DOMTokenList.class); when(alert.getClassList()).thenReturn(alertDomTokenList); final DOMTokenList iconDomTokenList = mock(DOMTokenList.class); when(icon.getClassList()).thenReturn(iconDomTokenList); notification.setType(InlineNotification.InlineNotificationType.SUCCESS); verify(alertDomTokenList).add(InlineNotification.InlineNotificationType.SUCCESS.getCssClass()); verify(iconDomTokenList).add(InlineNotification.InlineNotificationType.SUCCESS.getIcon()); }