com.vaadin.flow.dom.Element.indexOfChild()方法的使用及代码示例

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

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

Element.indexOfChild介绍

暂无

代码示例

代码示例来源:origin: appreciated/vaadin-app-layout

  1. public void setSelected(PaperTab tab) {
  2. final int indexOfTab = getElement().indexOfChild(tab.getElement());
  3. long index = getChildren()
  4. .filter(component -> getElement().indexOfChild(component.getElement()) < indexOfTab)
  5. .filter(component -> component instanceof PaperTab)
  6. .count();
  7. setSelected((int) index);
  8. }

代码示例来源:origin: com.vaadin/vaadin-accordion-flow

  1. /**
  2. * Opens the specified panel.
  3. *
  4. * @param panel the non-null panel to be opened
  5. */
  6. public void open(AccordionPanel panel) {
  7. Objects.requireNonNull(panel, "The panel to be opened cannot be null");
  8. open(getElement().indexOfChild(panel.getElement()));
  9. }

代码示例来源:origin: com.vaadin/vaadin-button-flow

  1. int iconIndex = getElement().indexOfChild(iconComponent.getElement());
  2. int textIndex;
  3. textIndex = getElement().indexOfChild(span);
  4. } else if (iconAfterText) {
  5. textIndex = getElement()
  6. .indexOfChild(textNodes[textNodes.length - 1]);
  7. } else {
  8. textIndex = getElement().indexOfChild(textNodes[0]);

代码示例来源:origin: com.vaadin/flow-server

  1. } else {
  2. Element element = getElement();
  3. int oldIndex = element.indexOfChild(oldComponent.getElement());
  4. int newIndex = element.indexOfChild(newComponent.getElement());
  5. if (oldIndex >= 0 && newIndex >= 0) {
  6. element.insertChild(oldIndex, newComponent.getElement());

相关文章