com.google.gwt.dom.client.Element.getChild()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中com.google.gwt.dom.client.Element.getChild()方法的一些代码示例,展示了Element.getChild()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getChild()方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getChild

Element.getChild介绍

暂无

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Get the element that represents the specified index.
 * 
 * @param index the index of the row value
 * @return the child element, or null if it does not exist
 */
protected Element getChildElement(int index) {
 Element childContainer = getChildContainer();
 int childCount = childContainer.getChildCount();
 return (index < childCount) ? childContainer.getChild(index).<Element> cast() : null;
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
  * Get the parent element of the decorated cell.
  * 
  * @param parent the parent of this cell
  * @return the decorated cell's parent
  */
 private Element getCellParent(Element parent) {
  return parent.getFirstChildElement().getChild(1).cast();
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
protected Element getKeyboardSelectedElement() {
 // Do not use getRowElement() because that will flush the presenter.
 int rowIndex = getKeyboardSelectedRow();
 if (rowIndex >= 0 && childContainer.getChildCount() > rowIndex) {
  return childContainer.getChild(rowIndex).cast();
 }
 return null;
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Returns the element that parents the cell contents of the node.
 *
 * @param nodeElem the element that represents the node
 * @return the cell parent within the node
 */
private static Element getCellParent(Element nodeElem) {
 return getSelectionElement(nodeElem).getFirstChildElement().getChild(1).cast();
}

代码示例来源:origin: com.google.gwt/gwt-servlet

Element toReplace = null;
if (start < childCount) {
 toReplace = childContainer.getChild(start).cast();
 if (toReplace == null) {
  childContainer.appendChild(newChildren.getChild(0));
 } else {
  Element nextSibling = toReplace.getNextSiblingElement();
  childContainer.replaceChild(newChildren.getChild(0), toReplace);
  toReplace = nextSibling;

代码示例来源:origin: com.google.gwt/gwt-servlet

private Element ensureColumn(int col) {
 prepareColumn(col);
 prepareColumnGroup();
 resizeColumnGroup(col + 1, true);
 return columnGroup.getChild(col).cast();
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Get the {@link Element} for the specified index. If the element has not
 * been created, null is returned.
 * 
 * @param indexOnPage the index on the page
 * @return the element, or null if it doesn't exists
 * @throws IndexOutOfBoundsException if the index is outside of the current
 *           page
 */
public Element getRowElement(int indexOnPage) {
 getPresenter().flush();
 checkRowBounds(indexOnPage);
 if (childContainer.getChildCount() > indexOnPage) {
  return childContainer.getChild(indexOnPage).cast();
 }
 return null;
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
public void onBrowserEvent(Context context, Element parent, String value,
  NativeEvent event, ValueUpdater<String> valueUpdater) {
 // The loading indicator can fire its own load or error event, so we check
 // that the event actually occurred on the main image.
 String type = event.getType();
 if (BrowserEvents.LOAD.equals(type) && eventOccurredOnImage(event, parent)) {
  // Remove the loading indicator.
  parent.getFirstChildElement().getStyle().setDisplay(Display.NONE);
  // Show the image.
  Element imgWrapper = parent.getChild(1).cast();
  imgWrapper.getStyle().setProperty("height", "auto");
  imgWrapper.getStyle().setProperty("width", "auto");
  imgWrapper.getStyle().setProperty("overflow", "auto");
 } else if (BrowserEvents.ERROR.equals(type) && eventOccurredOnImage(event, parent)) {
  // Replace the loading indicator with an error message.
  parent.getFirstChildElement().setInnerSafeHtml(errorRenderer.render(value));
 }
}

代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library

/**
 * Moves all children of "from" element onto "to" element.
 */
public static void moveChildren(Element from, Element to) {
  if (from == null || to == null || from == to) return;
  for (int k = from.getChildCount() - 1; k >= 0; k--) {
    Node node = from.getChild(k);
    from.removeChild(node);
    to.insertFirst(node);
  }
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
  * Get the parent element of the decorated cell.
  * 
  * @param parent the parent of this cell
  * @return the decorated cell's parent
  */
 private Element getCellParent(Element parent) {
  return parent.getFirstChildElement().getChild(1).cast();
 }
}

代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library

private void cleanUpLI() {
  Element elt = getElement();
  for (int i = elt.getChildCount() - 1; i >= 0; i--) {
    elt.removeChild(elt.getChild(i));
  }
  setStyleName("jqm4gwt-listitem");
}

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

public CubaScrollTableHeaderCell(String colId, String headerText) {
  super(colId, headerText);
  Element sortIndicator = td.getChild(1).cast();
  DOM.sinkEvents(sortIndicator, Event.ONCONTEXTMENU | DOM.getEventsSunk(sortIndicator));
  Element captionContainer = td.getChild(2).cast();
  DOM.sinkEvents(captionContainer, Event.ONCONTEXTMENU | DOM.getEventsSunk(captionContainer));
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets

private void restoreStyleForTDsInRow(VScrollTableRow row) {
    Element tr = row.getElement();
    for (int ix = 0; ix < tr.getChildCount(); ix++) {
      Element td = tr.getChild(ix).cast();
      td.getStyle().clearProperty("backgroundAttachment");
      td.getStyle().clearProperty("backgroundClip");
      td.getStyle().clearProperty("backgroundColor");
      td.getStyle().clearProperty("backgroundImage");
      td.getStyle().clearProperty("backgroundOrigin");
    }
  }
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
 * Returns the element that parents the cell contents of the node.
 *
 * @param nodeElem the element that represents the node
 * @return the cell parent within the node
 */
private static Element getCellParent(Element nodeElem) {
 return getSelectionElement(nodeElem).getFirstChildElement().getChild(1).cast();
}

代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material

public void testToastStructure() {
    MaterialToast.fireToast("test");
    Element toastContainer = $("body").find("#toast-container").asElement();
    assertNotNull(toastContainer);
    assertEquals(toastContainer.getChildCount(), 1);
    assertNotNull(toastContainer.getChild(0));
    assertTrue(toastContainer.getChild(0) instanceof Element);
    Element toastElement = (Element) toastContainer.getChild(0);
    assertEquals(toastElement.getInnerHTML(), "test");
    toastContainer.setInnerHTML("");
  }
}

代码示例来源:origin: fr.lteconsulting/hexa.core

public void setHdrText( int col, String text )
{
  ensureHeaderCell( col );
  Element th = Element.as( thead.getChild( col ) );
  clearTH( th, false );
  th.setInnerText( text );
}

代码示例来源:origin: GwtMaterialDesign/gwt-material

public void testToastStructure() {
    MaterialToast.fireToast("test");
    Element toastContainer = $("body").find("#toast-container").asElement();
    assertNotNull(toastContainer);
    assertEquals(toastContainer.getChildCount(), 1);
    assertNotNull(toastContainer.getChild(0));
    assertTrue(toastContainer.getChild(0) instanceof Element);
    Element toastElement = (Element) toastContainer.getChild(0);
    assertEquals(toastElement.getInnerHTML(), "test");
    toastContainer.setInnerHTML("");
  }
}

代码示例来源:origin: net.wetheinter/gwt-user

private Element ensureColumn(int col) {
 prepareColumn(col);
 prepareColumnGroup();
 resizeColumnGroup(col + 1, true);
 return columnGroup.getChild(col).cast();
}

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

public CubaGroupBoxWidget(String primaryStyleName) {
  setStylePrimaryName(primaryStyleName);
  setStyleName(primaryStyleName);
  captionWrap = captionNode.getParentElement().cast();
  captionTextNode = (Element) captionNode.getChild(0);
}

代码示例来源:origin: org.jboss.ballroom/widgets

private void scrollSelectedItemIntoView() {
    NodeList<Node> items = getSuggestionMenu().getElement().getChild(1).getChild(0).getChildNodes();
    for (int i = 0; i < items.getLength(); i++) {
      Element element = (Element) items.getItem(i);
      if (((Element) element.getChild(0)).getClassName().equals("item item-selected")) {
        element.scrollIntoView();
        break;
      }
    }
  }
}

相关文章

微信公众号

最新文章

更多

Element类方法