private static void ensureHiddenDiv() { // If it's already been created, don't do anything. if (hiddenDiv != null) { return; } hiddenDiv = Document.get().createDivElement(); UIObject.setVisible(hiddenDiv, false); RootPanel.getBodyElement().appendChild(hiddenDiv); }
private static void ensureHiddenDiv() { // If the hidden DIV has not been created, create it. if (hiddenDiv == null) { hiddenDiv = Document.get().createDivElement(); UIObject.setVisible(hiddenDiv, false); RootPanel.getBodyElement().appendChild(hiddenDiv); } }
/** * Add a source element to this media. The browser will request source files * from the server until it finds one it can play. * * <p> * Only use this method if you do not know the type of the source file, as the * browser cannot determine the format from the filename and must download * each source until a compatible one is found. Instead, you should specify * the type for the media using {@link #addSource(String, String)} so the * browser can choose a source file without downloading the file. * </p> * * @param url a String URL * @see #addSource(String, String) */ public SourceElement addSource(String url) { SourceElement elem = Document.get().createSourceElement(); elem.setSrc(url); getElement().appendChild(elem); return elem; }
/** * Creates an empty popup panel. A child widget must be added to it before it * is shown. */ public PopupPanel() { super(); super.getContainerElement().appendChild(impl.createElement()); // Default position of popup should be in the upper-left corner of the // window. By setting a default position, the popup will not appear in // an undefined location if it is shown before its position is set. setPopupPosition(0, 0); setStyleName(DEFAULT_STYLENAME); setStyleName(getContainerElement(), "popupContent"); }
protected CheckBox(Element elem) { super(DOM.createSpan()); inputElem = InputElement.as(elem); labelElem = Document.get().createLabelElement(); getElement().appendChild(inputElem); getElement().appendChild(labelElem); String uid = DOM.createUniqueId(); inputElem.setPropertyString("id", uid); labelElem.setHtmlFor(uid); directionalTextHelper = new DirectionalTextHelper(labelElem, true); // Accessibility: setting tab index to be 0 by default, ensuring element // appears in tab sequence. FocusWidget's setElement method already // calls setTabIndex, which is overridden below. However, at the time // that this call is made, inputElem has not been created. So, we have // to call setTabIndex again, once inputElem has been created. setTabIndex(0); }
/** * Ensure that the animation frame exists and return it. * * @return the animation frame */ Element ensureAnimationFrame() { if (animationFrame == null) { animationFrame = Document.get().createDivElement(); animationFrame.getStyle().setOverflow(Overflow.HIDDEN); animationFrame.getStyle().setDisplay(Display.NONE); getElement().appendChild(animationFrame); } return animationFrame; }
private void startResizingFrom(int x, int y) { isResizing = true; onSplitterResizeStarted(x, y); // Resize glassElem to take up the entire scrollable window area int height = RootPanel.getBodyElement().getScrollHeight() - 1; int width = RootPanel.getBodyElement().getScrollWidth() - 1; glassElem.getStyle().setProperty("height", height + "px"); glassElem.getStyle().setProperty("width", width + "px"); RootPanel.getBodyElement().appendChild(glassElem); }
public Tab(Widget child) { super(Document.get().createDivElement()); getElement().appendChild(inner = Document.get().createDivElement()); setWidget(child); setStyleName(TAB_STYLE); inner.setClassName(TAB_INNER_STYLE); getElement().addClassName(CommonResources.getInlineBlockStyle()); }
/** * Appends a element. * * @param child the element to add * @return the child element */ public El appendChild(Element child) { dom.appendChild(child); return new El(child); }
hiddenDiv = Document.get().createDivElement(); UIObject.setVisible(hiddenDiv, false); RootPanel.getBodyElement().appendChild(hiddenDiv);
private void constructDOM() { setElement(root); root.appendChild(icon); root.appendChild(label); root.appendChild(ariaLink); root.appendChild(runningIndicator); addStyleName("item"); icon.addClassName("icon"); label.addClassName("label"); DOM.sinkEvents(getElement(), Event.MOUSEEVENTS); }
getElement().appendChild(scrollLock);
protected RadioButton(InputElement element) { super(DOM.createLabel(), element); setStyleName(Styles.BTN); setType(ButtonType.DEFAULT); getElement().appendChild(inputElem); getElement().appendChild(Document.get().createTextNode(" ")); getElement().appendChild(labelElem); getElement().appendChild(Document.get().createTextNode(" ")); }
@Override public void onChange(ChangeEvent event) { if (iconElement != null) { iconElement.removeFromParent(); } String html = getHTML(); if (showRequiredIndicator && html != null && !"".equals(html)) { iconElement = createIconElement(); getElement().appendChild(iconElement); } } }, ChangeEvent.getType());
/** * Sets the source of the quote. This may be a person or the title of a * book, song, ... * * @param source * the source of the quote */ public void setSource(String source) { getElement().appendChild(new SmallCite(source).getElement()); }
public Element getContainer(TreeNode node) { if (node.container == null) { String s = getTemplate(node.m, null, null, null, false, false, null, 0, TreeViewRenderMode.CONTAINER); node.container = node.getElement().appendChild(XDOM.create(s)); } return node.container; }
public SmallCite(String text) { setElement(DOM.createElement("small")); this.cite = new Cite(text); getElement().appendChild(cite.getElement()); }
private void addSearchPopUpToTreeIfNotDisplayed() { if (Document.get().getElementById(ID) == null) { searchPopUp.setVisible(true); tree.getParent().getElement().appendChild(searchPopUp.getElement()); } }
@Override public void add(String tag) { if (isAttached()) super.add(tag); else { OptionElement option = Document.get().createOptionElement(); option.setValue(tag); option.setInnerText(tag); getElement().appendChild(option); } }
private ListItem change2TextListItem(Widget w) { String text; if (w instanceof HasText) { text = ((HasText) w).getText(); } else { text = w.getElement().getInnerText(); } ListItem newest = new ListItem(); newest.setStyleName(Constants.ACTIVE); newest.getElement().appendChild(Document.get().createTextNode(text)); return newest; }