public void addMenus(final HTMLElement element) { if (actionsMenu == null) { actionsMenu = (HTMLDivElement) document.createElement("div"); actionsMenu.classList.add("form-group"); if (actions.hasChildNodes()) { actions.insertBefore(actionsMenu, actions.childNodes.item(0)); } else { actions.appendChild(actionsMenu); } } actionsMenu.appendChild(element); }
@Override public void position(HTMLElement tooltip, HTMLElement target) { ClientRect targetRect = target.getBoundingClientRect(); ClientRect tooltipRect = tooltip.getBoundingClientRect(); tooltip.style.setProperty("top", ((targetRect.top + window.pageYOffset)-tooltipRect.height)+"px"); tooltip.style.setProperty("left", targetRect.left+window.pageXOffset+((targetRect.width-tooltipRect.width)/2)+"px"); }
@Override public void removeContributor() { // Use of removeChild() instead of remove() for IE compatibility purposes for (int i = container.childNodes.getLength() - 1; i > 0; i--) { container.removeChild(container.childNodes.item(i)); } }
@Override public HTMLElement apply(final MenuGroup menuItem, final List<HTMLElement> subMenus) { HTMLDivElement div = (HTMLDivElement) document.createElement("div"); div.classList.add("form-group"); subMenus.forEach(e -> div.appendChild(e)); return div; } }
@Override public void expand() { header.classList.remove("collapsed"); header.setAttribute("aria-expanded", "true"); panel.classList.add("in"); panel.setAttribute("aria-expanded", "true"); arrangeCaret(); }
private String getHTMLContent(final Element element) { final HTMLDivElement div = (HTMLDivElement) document.createElement("div"); div.appendChild(element); return div.innerHTML; }
@Override public void add(SSHKeyEditor editor) { Element li = document.createElement("li"); li.className = "list-group-item"; li.appendChild(editor.getElement()); keysContainer.appendChild(li); }
@Override public void render(ExperimentalFeatureEditor editor) { HTMLLIElement li = (HTMLLIElement) document.createElement("li"); li.setAttribute("class", "list-group-item"); li.appendChild(editor.getElement()); featuresContainer.appendChild(li); }
void disableWarningHighlight() { final NodeList<Element> warningElements = getElement().parentNode.querySelectorAll("." + WARNING_CSS_CLASS); for (int i = 0; i < warningElements.length; i++) { warningElements.getAt(i).classList.remove(WARNING_CSS_CLASS); } }
Element getLastSubDataTypeElement(final Element element) { final String parentUUID = element.getAttribute(UUID_ATTR); final String selector = "[" + PARENT_UUID_ATTR + "=\"" + parentUUID + "\"]"; final NodeList<Element> nestedElements = listItems.querySelectorAll(selector); if (nestedElements.length == 0) { return element; } else { return getLastSubDataTypeElement(nestedElements.getAt((int) nestedElements.length - 1)); } }
public void addMenus(final HTMLElement element) { if (actionsMenu == null) { actionsMenu = (HTMLDivElement) document.createElement("div"); actionsMenu.classList.add("form-group"); if (actions.hasChildNodes()) { actions.insertBefore(actionsMenu, actions.childNodes.item(0)); } else { actions.appendChild(actionsMenu); } } actionsMenu.appendChild(element); }
@Override public void collapse() { header.classList.add("collapsed"); header.setAttribute("aria-expanded", "false"); panel.classList.remove("in"); panel.setAttribute("aria-expanded", "false"); arrangeCaret(); }
@Override public void position(HTMLElement tooltip, HTMLElement target) { ClientRect targetRect = target.getBoundingClientRect(); ClientRect tooltipRect = tooltip.getBoundingClientRect(); tooltip.style.setProperty("top", (targetRect.top+ window.pageYOffset+targetRect.height)+"px"); tooltip.style.setProperty("left", targetRect.left+((targetRect.width-tooltipRect.width)/2)+"px"); }
void cleanSubTypes(final String uuid) { final String selector = "[" + PARENT_UUID_ATTR + "=\"" + uuid + "\"]"; final NodeList<Element> subDataTypeRows = listItems.querySelectorAll(selector); for (int i = 0; i < subDataTypeRows.length; i++) { final Element item = subDataTypeRows.getAt(i); if (item != null && item.parentNode != null) { cleanSubTypes(item.getAttribute(UUID_ATTR)); removeDataTypeRow(item); } } }
@Override public void position(HTMLElement tooltip, HTMLElement target) { ClientRect targetRect = target.getBoundingClientRect(); ClientRect tooltipRect = tooltip.getBoundingClientRect(); tooltip.style.setProperty("top", (targetRect.top+DomGlobal.window.pageYOffset)+((targetRect.height-tooltipRect.height)/2)+"px"); tooltip.style.setProperty("left", targetRect.left+DomGlobal.window.pageXOffset+targetRect.width+"px"); }
@Override public void position(HTMLElement tooltip, HTMLElement target) { ClientRect targetRect = target.getBoundingClientRect(); ClientRect tooltipRect = tooltip.getBoundingClientRect(); tooltip.style.setProperty("top", (targetRect.top+ window.pageYOffset)+((targetRect.height-tooltipRect.height)/2)+"px"); tooltip.style.setProperty("left", targetRect.left-window.pageXOffset-tooltipRect.width+"px"); }
@Override public void position(HTMLElement tooltip, HTMLElement target) { ClientRect targetRect = target.getBoundingClientRect(); ClientRect tooltipRect = tooltip.getBoundingClientRect(); tooltip.style.setProperty("top", ((targetRect.top + window.pageYOffset)-tooltipRect.height)+"px"); tooltip.style.setProperty("left", targetRect.left+window.pageXOffset+((targetRect.width-tooltipRect.width)/2)+"px"); }
@Override public void position(HTMLElement tooltip, HTMLElement target) { ClientRect targetRect = target.getBoundingClientRect(); ClientRect tooltipRect = tooltip.getBoundingClientRect(); tooltip.style.setProperty("top", (targetRect.top+ window.pageYOffset+targetRect.height)+"px"); tooltip.style.setProperty("left", targetRect.left+((targetRect.width-tooltipRect.width)/2)+"px"); }
@Override public void position(HTMLElement tooltip, HTMLElement target) { ClientRect targetRect = target.getBoundingClientRect(); ClientRect tooltipRect = tooltip.getBoundingClientRect(); tooltip.style.setProperty("top", (targetRect.top+ window.pageYOffset)+((targetRect.height-tooltipRect.height)/2)+"px"); tooltip.style.setProperty("left", targetRect.left-window.pageXOffset-tooltipRect.width+"px"); }
@Override public void position(HTMLElement tooltip, HTMLElement target) { ClientRect targetRect = target.getBoundingClientRect(); ClientRect tooltipRect = tooltip.getBoundingClientRect(); tooltip.style.setProperty("top", (targetRect.top+DomGlobal.window.pageYOffset)+((targetRect.height-tooltipRect.height)/2)+"px"); tooltip.style.setProperty("left", targetRect.left+DomGlobal.window.pageXOffset+targetRect.width+"px"); }