/** * Reattach a table section element from its parent. * * @param parent the parent element * @param section the element to reattach * @param nextSection the next section */ protected void reattachSectionElement(Element parent, TableSectionElement section, Element nextSection) { parent.insertBefore(section, nextSection); }
/** * Restore to previous DOM state before attachment. */ public void detach() { // Put the panel's element back where it was. if (origParent != null) { origParent.insertBefore(element, origSibling); } else { orphan(element); } } }
/** * Inserts an element as a child of the given parent element, before another * child of that parent. * <p> * If the child element is a {@link com.google.gwt.user.client.ui.PotentialElement}, it is first * resolved. * </p> * * @param parent the parent element * @param child the child element to add to <code>parent</code> * @param before an existing child element of <code>parent</code> before which * <code>child</code> will be inserted * @see com.google.gwt.user.client.ui.PotentialElement#resolve(Element) */ public static void insertBefore(Element parent, Element child, Element before) { assert !isPotential(parent) : "Cannot insert into a PotentialElement"; // If child isn't a PotentialElement, resolve() returns // the Element itself. parent.insertBefore(resolve(child), before); }
/** * Restore to previous DOM state before attachment. */ public void detach() { // Put the panel's element back where it was. if (origParent != null) { origParent.insertBefore(element, origSibling); } else { orphan(element); } } }
/** * Reattach a table section element from its parent. * * @param parent the parent element * @param section the element to reattach * @param nextSection the next section */ protected void reattachSectionElement(Element parent, TableSectionElement section, Element nextSection) { parent.insertBefore(section, nextSection); }
/** * Restore to previous DOM state before attachment. */ public void detach() { // Put the panel's element back where it was. if (origParent != null) { origParent.insertBefore(element, origSibling); } else { orphan(element); } } }
/** * Reattach a table section element from its parent. * * @param parent the parent element * @param section the element to reattach * @param nextSection the next section */ protected void reattachSectionElement(Element parent, TableSectionElement section, Element nextSection) { parent.insertBefore(section, nextSection); }
} else { Element beforeElem = getChild(beforeIndex).getElement(); childContainer.insertBefore(item.getElement(), beforeElem);
public Element attachChild(Element parent, Element child, Element before) { DivElement container = Document.get().createDivElement(); container.appendChild(child); container.getStyle().setPosition(Position.ABSOLUTE); container.getStyle().setOverflow(Overflow.HIDDEN); fillParent(child); Element beforeContainer = null; if (before != null) { beforeContainer = before.getParentElement(); assert beforeContainer.getParentElement() == parent : "Element to insert before must be a sibling"; } parent.insertBefore(container, beforeContainer); return container; }
/** * Inserts this element before the passed element. * * @param before the element to insert before * @return this */ public El insertBefore(Element before) { before.getParentElement().insertBefore(dom, before); return this; }
origParent.insertBefore(getElement(), origSibling); } else { hiddenDiv.removeChild(getElement());
/** * Inserts an element as a child of the given parent element, before another * child of that parent. * <p> * If the child element is a {@link com.google.gwt.user.client.ui.PotentialElement}, it is first * resolved. * </p> * * @param parent the parent element * @param child the child element to add to <code>parent</code> * @param before an existing child element of <code>parent</code> before which * <code>child</code> will be inserted * @see com.google.gwt.user.client.ui.PotentialElement#resolve(Element) */ public static void insertBefore(Element parent, Element child, Element before) { assert !isPotential(parent) : "Cannot insert into a PotentialElement"; // If child isn't a PotentialElement, resolve() returns // the Element itself. parent.insertBefore(resolve(child), before); }
private void showDraggingCurtain() { getElement().getParentElement().insertBefore(getDraggingCurtain(), getElement()); }
private void showResizingCurtain() { getElement().getParentElement().insertBefore(getResizingCurtain(), getElement()); }
public void setField(Widget child) { if (this.field != null) { remove(field); } this.field = child; if (child != null) { child.removeFromParent(); AriaHelper.bindCaption(child, label); getChildren().add(child); fieldWrapper.insertBefore(child.getElement(), helpButton.getElement()); adopt(child); } }
public void onIconStyleChange(TreeNode node, AbstractImagePrototype icon) { Element iconEl = getIconElement(node); if (iconEl != null) { Element e; if (icon != null) { e = (Element) icon.createElement().cast(); } else { e = DOM.createSpan(); } El.fly(e).addStyleName("x-tree3-node-icon"); node.icon = (Element) iconEl.getParentElement().insertBefore(e, iconEl); El.fly(iconEl).remove(); } }
public Element attachChild(Element parent, Element child, Element before) { DivElement container = Document.get().createDivElement(); container.appendChild(child); container.getStyle().setPosition(Position.ABSOLUTE); container.getStyle().setOverflow(Overflow.HIDDEN); fillParent(child); Element beforeContainer = null; if (before != null) { beforeContainer = before.getParentElement(); assert beforeContainer.getParentElement() == parent : "Element to insert before must be a sibling"; } parent.insertBefore(container, beforeContainer); return container; }
@Override public void onBrowserEvent(Event event) { // Fix webkit bug // input file will not fire change event if one chooses the same file twice in a row super.onBrowserEvent(event); Element parent = getElement().getParentElement(); Element nextSibling = getElement().getNextSiblingElement(); FormElement form = Document.get().createFormElement(); form.appendChild(getElement()); form.reset(); parent.insertBefore(getElement(), nextSibling); }
public Element attachChild(Element parent, Element child, Element before) { DivElement container = Document.get().createDivElement(); container.appendChild(child); container.getStyle().setPosition(Position.ABSOLUTE); container.getStyle().setOverflow(Overflow.HIDDEN); fillParent(child); Element beforeContainer = null; if (before != null) { beforeContainer = before.getParentElement(); assert beforeContainer.getParentElement() == parent : "Element to insert before must be a sibling"; } parent.insertBefore(container, beforeContainer); return container; }
@PatchMethod static TableRowElement insertRow(TableElement e, int index) { NodeList<TableRowElement> rows = e.getRows(); TableRowElement newRow = Document.get().createTRElement(); if (rows.getLength() < 1) { TableSectionElement tbody = Document.get().createTBodyElement(); e.appendChild(tbody); tbody.appendChild(newRow); } else { if (index == -1 || index >= rows.getLength()) { TableRowElement after = rows.getItem(rows.getLength() - 1); after.getParentElement().insertAfter(newRow, after); } else { TableRowElement before = rows.getItem(index); before.getParentElement().insertBefore(newRow, before); } } return newRow; }