/** * Finds the element that was previously stamped in the DOM. * For this to work properly the element must be attached to the document. */ public Element findStampedElement() { // TODO(rdcastro): Add a DEV-only check to make sure the element is attached. return Document.get().getElementById(token); }
this.root = config.rootPanel; } else { Element element = Document.get().getElementById("embed-" + GWT.getModuleName()); if (element == null) { VerticalPanel panel = new VerticalPanel();
this.root = config.rootPanel; } else { Element element = Document.get().getElementById("embed-" + GWT.getModuleName()); if (element == null) { VerticalPanel panel = new VerticalPanel();
/** * Gets the element associated with the given unique id within the entire * document. * * @param id the id whose associated element is to be retrieved * @return the associated element, or <code>null</code> if none is found */ public static com.google.gwt.user.client.Element getElementById(String id) { return asOld(Document.get().getElementById(id)); }
public void execute() { if (!canHaveMultipleRequestsForSameId) { // If there can me multiple requests for a particular ID, then we // don't want to unregister the callback since there may be pending // requests that have not yet come back and we don't want them to // have an undefined callback function. unregisterCallbacks(CALLBACKS, callbackId); } Node script = Document.get().getElementById(callbackId); if (script != null) { // The script may have already been deleted getHeadElement().removeChild(script); } } });
/** * Returns the dom element. * * @return the dom element * @throws RuntimeException if the element cannot be found */ public T get() { if (element == null) { element = Document.get().getElementById(domId).<T>cast(); if (element == null) { throw new RuntimeException("Cannot find element with id \"" + domId + "\". Perhaps it is not attached to the document body."); } element.removeAttribute("id"); } return element; } }
/** * Finds an {@link Element element} within this panel by its id. * * This method uses * {@link com.google.gwt.dom.client.Document#getElementById(String)}, so the * id must still be unique within the document. * * @param id the id of the element to be found * @return the element with the given id, or <code>null</code> if none is found */ public com.google.gwt.user.client.Element getElementById(String id) { Element elem = isAttached() ? Document.get().getElementById(id) : attachToDomAndGetElement(id); return DOM.asOld(elem); }
String renderedId = buildInnerId(fieldName, uiId); Element elementById = Document.get().getElementById(renderedId); if (elementById == null) { if (!isAttachedToDom(root)) {
if (id != null) { if (null == (elem = Document.get().getElementById(id))) { return null;
/** * Finds the element that was previously stamped in the DOM. * For this to work properly the element must be attached to the document. */ public Element findStampedElement() { // TODO(rdcastro): Add a DEV-only check to make sure the element is attached. return Document.get().getElementById(token); }
Element child = Document.get().getElementById(id);
private void removeSearchPopUpFromTreeIfIsShown() { searchRequest.setLength(0); Element popUp = Document.get().getElementById(ID); if (popUp != null) { popUp.removeFromParent(); } }
public T get() { if (this.element == null) { this.element = Document.get().getElementById(this.domId).<T> cast(); if (this.element == null) { throw new RuntimeException("Cannot find element with id \"" + this.domId + "\". Perhaps it is not attached to the document body."); } } return this.element; } }
private IFrameElement getOrMakeIFrame() { IFrameElement iFrame = null; try { iFrame = (IFrameElement) Document.get().getElementById(ERRAI_FORM_FRAME_ID); } catch (Exception e) { } if (iFrame == null) iFrame = Document.get().createIFrameElement(); return iFrame; }
public static NodeList<Element> veryQuickId(String id, Node ctx) { Document d = ctx.getNodeType() == Node.DOCUMENT_NODE ? ctx.<Document> cast() : ctx.getOwnerDocument(); return JsNodeArray.create(d.getElementById(id)); }
private void addSearchPopUpToTreeIfNotDisplayed() { if (Document.get().getElementById(ID) == null) { searchPopUp.setVisible(true); tree.getParent().getElement().appendChild(searchPopUp.getElement()); } }
@Override public void eval(String js) { Scheduler.get().scheduleFixedDelay(() -> { Element el = Document.get().getElementById(uniqueId); if (el != null) { ScriptInjector.fromString(js).setWindow(ScriptInjector.TOP_WINDOW).setRemoveTag(true).inject(); return false; } return true; }, 100); }
@Override public void eval(String js) { Scheduler.get().scheduleFixedDelay(() -> { Element el = Document.get().getElementById(uniqueId); if (el != null) { ScriptInjector.fromString(js).setWindow(ScriptInjector.TOP_WINDOW).setRemoveTag(true).inject(); return false; } return true; }, 100); }
private static void ensureFrame() { com.google.gwt.dom.client.Element frame = Document.get().getElementById( "__printingFrame" ); if( frame == null ) { frame = DOM.createIFrame(); frame.setId( "__printingFrame" ); frame.setAttribute( "style", "width:0;height:0;border:0" ); Document.get().getBody().appendChild( frame ); } }
protected LoadTracker() { if(Document.get().getElementById(m_trackerDivId) == null) { Element div = DOM.createDiv(); div.getStyle().setPosition(Position.ABSOLUTE); div.getStyle().setTop(0.0, Unit.PX); div.getStyle().setLeft(-9999.0, Unit.PX); div.getStyle().setVisibility(Visibility.HIDDEN); div.setId("loadTracker"); Document.get().getBody().appendChild(div); } }