@Override public boolean hasNext() { return index < nodeList.getLength(); }
@Override public Element next() { if (hasNext()) { return (Element) nodeList.item(i++); } else { throw new NoSuchElementException(); } }
@Override public boolean hasNext() { return index < nodeList.getLength(); }
@Override public Node next() { if (hasNext()) { return nodeList.item(index++); } else { throw new NoSuchElementException(); } }
public void addAppLauncher(final String name, final String url, final String iconClass) { final AppLauncherItemView app = appLauncherItemViews.get(); app.setName(name); app.setIcon(isNullOrEmpty(iconClass) ? "fa-cube" : iconClass); app.setURL(url); if (leftColumn.getChildNodes().getLength() == rightColumn.getChildNodes().getLength()) { leftColumn.appendChild(app.getElement()); } else { rightColumn.appendChild(app.getElement()); } }
@Override public Element next() { if (hasNext()) { return (Element) nodeList.item(i++); } else { throw new NoSuchElementException(); } }
/** * @param element * Must not be null. * @return If the given element has any child elements, return an optional containing the last child element. * Otherwise return an empty optional. */ public static Optional<Element> getLastChildElement(final Element element) { final NodeList children = element.getChildNodes(); for (int i = children.getLength()-1; i > -1; i--) { if (isElement(children.item(i))) { return Optional.ofNullable((Element) children.item(i)); } } return Optional.empty(); }
@Override public void showResetHint(String column, boolean multiple) { String resetAction = multiple ? SelectorConstants.INSTANCE.selectorDisplayer_clearAll() : SelectorConstants.INSTANCE.selectorDisplayer_reset(); resetAnchor.setTextContent(resetAction); resetMenu.getStyle().removeProperty("display"); int n = dropDownMenu.getChildNodes().getLength() * 25; resetMenu.getStyle().setProperty("margin-top", (n > 250 ? 250 : n) + "px"); }
@Override public Node next() { if (hasNext()) { return nodeList.item(index++); } else { throw new NoSuchElementException(); } }
/** * @param element * Must not be null. * @return If the given element has any child elements, return an optional containing the last child element. * Otherwise return an empty optional. */ public static Optional<Element> getLastChildElement(final Element element) { final NodeList children = element.getChildNodes(); for (int i = children.getLength()-1; i > -1; i--) { if (isElement(children.item(i))) { return Optional.ofNullable((Element) children.item(i)); } } return Optional.empty(); }
@Override public void showResetHint(String column, boolean multiple) { String resetAction = multiple ? SelectorConstants.INSTANCE.selectorDisplayer_clearAll() : SelectorConstants.INSTANCE.selectorDisplayer_reset(); resetAnchor.setTextContent(resetAction); resetMenu.getStyle().removeProperty("display"); int n = dropDownMenu.getChildNodes().getLength() * 25; resetMenu.getStyle().setProperty("margin-top", (n > 250 ? 250 : n) + "px"); }
@Override public void addContentSlide(IsWidget widget) { DOMUtil.removeAllChildren(mainDiv); mainDiv.appendChild(carouselDiv); Div div = (Div) Window.getDocument().createElement("div"); div.setClassName(slidesDiv.getChildNodes().getLength() == 0 ? "item active" : "item"); super.appendWidgetToElement(div, widget); slidesDiv.appendChild(div); }
@Override public void addContentSlide(IsWidget widget) { DOMUtil.removeAllChildren(mainDiv); mainDiv.appendChild(carouselDiv); Div div = (Div) Window.getDocument().createElement("div"); div.setClassName(slidesDiv.getChildNodes().getLength() == 0 ? "item active" : "item"); super.appendWidgetToElement(div, widget); slidesDiv.appendChild(div); }
@Override public void infiniteRecursionError(String cause) { Div div = (Div) Window.getDocument().createElement("div"); div.setClassName(slidesDiv.getChildNodes().getLength() == 0 ? "item active" : "item"); alertBox.setMessage(NavigationConstants.INSTANCE.navCarouselDragComponentInfiniteRecursion() + " " + cause); div.appendChild(alertBox.getElement()); slidesDiv.appendChild(div); } }