/** * @param element * Must not be null. * @param className * The name of a CSS class. Must not be null. * @return True iff the given element has the given CSS class as part of its class list. */ public static boolean hasCSSClass(final HTMLElement element, final String className) { return element.getClassList().contains(className); }
/** * @param element * Must not be null. * @param className * The name of a CSS class. Must not be null. * @return True iff the given element has the given CSS class as part of its class list. */ public static boolean hasCSSClass(final HTMLElement element, final String className) { return element.getClassList().contains(className); }
@Override public boolean isSelected() { return card.getClassList().contains("active"); }
private boolean isOverCellEditorContainer(final HTMLElement e) { return e.getClassList().contains(CONTAINER_CLASS); }
@Override public boolean isSelected() { return accentedArea.getClassList().contains("card-pf-accented"); }
@Override public boolean isSelected() { return accentedArea.getClassList().contains("card-pf-accented"); }
public boolean isDisabled() { return getAccentedArea().getClassList().contains(REMOVE_OPTION); }
@Override public void setContextMenuActive(final boolean active) { if (active) { if (!contextMenuItemsContainer.getClassList().contains("active")) { contextMenuItemsContainer.getClassList().add("active"); } } else { if (contextMenuItemsContainer.getClassList().contains("active")) { contextMenuItemsContainer.getClassList().remove("active"); } } } }
@Override public void setContextMenuActive(final boolean active) { if (active) { if (!contextMenuItemsContainer.getClassList().contains("active")) { contextMenuItemsContainer.getClassList().add("active"); } } else { if (contextMenuItemsContainer.getClassList().contains("active")) { contextMenuItemsContainer.getClassList().remove("active"); } } } }
@EventHandler("image") public void onClick(@ForEvent("click") final Event event) { if (!accentedArea.getClassList().contains("remove-option")) { accentedArea.getClassList().toggle("card-pf-accented"); if (accentedArea.getClassList().contains("card-pf-accented")) { removeOpacity(); } else { addOpacity(); } presenter.onContentChange(); } }
@EventHandler("image") public void onClick(@ForEvent("click") final Event event) { if (!accentedArea.getClassList().contains("remove-option")) { accentedArea.getClassList().toggle("card-pf-accented"); if (accentedArea.getClassList().contains("card-pf-accented")) { removeOpacity(); } else { addOpacity(); } presenter.onContentChange(); } }
@EventHandler("refine-apply") public void onApplyClick(@ForEvent("click") Event e) { for (Element child : elementIterable(filtersInput.getChildNodes())) { if (child.getTagName().equals("INPUT")) { Input input = (Input) child; if (input.getClassList().contains("hidden") == false) { input.getOnkeypress().call(null); break; } } } }
@Test public void testClearValidationState() { when(domTokenList.contains(anyString())).thenReturn(true); formGroup.clearValidationState(); for (ValidationState v : ValidationState.values()) { verify(domTokenList).remove(v.getCssName()); } }
@Test public void testClearValidationState() { when(domTokenList.contains(anyString())).thenReturn(true); formGroup.clearValidationState(); for (ValidationState v : ValidationState.values()) { verify(domTokenList).remove(v.getCssName()); } }
@Override public void addMenuItemOnLeft(ChildMenuItemPresenter itemPresenter) { singleMenuItems.appendChild(itemPresenter.getView().getElement()); if (singleMenuItemsContainer.getClassList().contains("empty")) { singleMenuItemsContainer.getClassList().remove("empty"); } }
@Override public void addMenuItemOnLeft(ChildMenuItemPresenter itemPresenter) { singleMenuItems.appendChild(itemPresenter.getView().getElement()); if (singleMenuItemsContainer.getClassList().contains("empty")) { singleMenuItemsContainer.getClassList().remove("empty"); } }
@Override public void clear() { singleMenuItems.setTextContent(""); rightMenuItems.setTextContent(""); for (int index = leftMenuItems.getChildNodes().getLength() - 1; index >= 0; index--) { final Node child = leftMenuItems.getChildNodes().item(index); if (child.getChildNodes().getLength() > 0 && !child.equals(singleMenuItemsContainer)) { leftMenuItems.removeChild(child); } } if (!singleMenuItemsContainer.getClassList().contains("empty")) { singleMenuItemsContainer.getClassList().add("empty"); } menuItemByIdentifier = new HashMap<>(); }
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"); } } }
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"); } } }