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

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

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

Element.getNextSiblingElement介绍

[英]The element immediately following this element. If there is no such element, this returns null.
[中]

代码示例

代码示例来源:origin: kaaproject/kaa

  1. private void setCheckBoxStyle(CheckBox box) {
  2. Element input = box.getElement().getFirstChildElement();
  3. input.getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
  4. Element label = input.getNextSiblingElement();
  5. label.getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
  6. label.getStyle().setPaddingLeft(5, Unit.PX);
  7. label.getStyle().setFontSize(13, Unit.PX);
  8. }

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

  1. @Override
  2. protected Element getCellParent(Element item) {
  3. return item.getFirstChildElement().getNextSiblingElement();
  4. }

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

  1. @Override
  2. public void setValue(Context context, Element parent, C object) {
  3. Element curChild = getContainerElement(parent).getFirstChildElement();
  4. for (HasCell<C, ?> hasCell : hasCells) {
  5. setValueImpl(context, curChild, object, hasCell);
  6. curChild = curChild.getNextSiblingElement();
  7. }
  8. }

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

  1. @Override
  2. public boolean isEditing(Context context, Element parent, C value) {
  3. Element curChild = getContainerElement(parent).getFirstChildElement();
  4. for (HasCell<C, ?> hasCell : hasCells) {
  5. if (isEditingImpl(context, curChild, value, hasCell)) {
  6. return true;
  7. }
  8. curChild = curChild.getNextSiblingElement();
  9. }
  10. return false;
  11. }

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

  1. @Override
  2. public boolean resetFocus(Context context, Element parent, C value) {
  3. Element curChild = getContainerElement(parent).getFirstChildElement();
  4. for (HasCell<C, ?> hasCell : hasCells) {
  5. // The first child that takes focus wins. Only one child should ever be in
  6. // edit mode, so this is safe.
  7. if (resetFocusImpl(context, curChild, value, hasCell)) {
  8. return true;
  9. }
  10. curChild = curChild.getNextSiblingElement();
  11. }
  12. return false;
  13. }

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

  1. /**
  2. * This method is used for legacy AbstractCellTable that's not a
  3. * {@link TableSectionChangeHandler}.
  4. */
  5. protected void replaceAllRowsImplLegacy(AbstractCellTable<?> table, TableSectionElement section,
  6. SafeHtml html) {
  7. // Remove all children.
  8. Element child = section.getFirstChildElement();
  9. while (child != null) {
  10. Element next = child.getNextSiblingElement();
  11. section.removeChild(child);
  12. child = next;
  13. }
  14. // Add new child elements.
  15. TableSectionElement newSection = convertToSectionElement(table, section.getTagName(), html);
  16. child = newSection.getFirstChildElement();
  17. while (child != null) {
  18. Element next = child.getNextSiblingElement();
  19. section.appendChild(child);
  20. child = next;
  21. }
  22. }

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

  1. /**
  2. * Attaches the element to the dom temporarily. Keeps track of where it is
  3. * attached so that things can be put back latter.
  4. *
  5. * @return attachment record which can be used for reverting back to previous
  6. * DOM state
  7. */
  8. public static TempAttachment attachToDom(Element element) {
  9. // TODO(rjrjr) This is copied from HTMLPanel. Reconcile
  10. ensureHiddenDiv();
  11. // Hang on to the panel's original parent and sibling elements so that it
  12. // can be replaced.
  13. Element origParent = element.getParentElement();
  14. Element origSibling = element.getNextSiblingElement();
  15. // Attach the panel's element to the hidden div.
  16. hiddenDiv.appendChild(element);
  17. return new TempAttachment(origParent, origSibling, element);
  18. }

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

  1. @Override
  2. public void onBrowserEvent(Context context, Element parent, C value,
  3. NativeEvent event, ValueUpdater<C> valueUpdater) {
  4. int index = 0;
  5. EventTarget eventTarget = event.getEventTarget();
  6. if (Element.is(eventTarget)) {
  7. Element target = eventTarget.cast();
  8. Element container = getContainerElement(parent);
  9. Element wrapper = container.getFirstChildElement();
  10. while (wrapper != null) {
  11. if (wrapper.isOrHasChild(target)) {
  12. onBrowserEventImpl(context, wrapper, value, event, valueUpdater,
  13. hasCells.get(index));
  14. }
  15. index++;
  16. wrapper = wrapper.getNextSiblingElement();
  17. }
  18. }
  19. }

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

  1. /**
  2. * Check whether or not an event occurred within the wrapper around the image
  3. * element.
  4. *
  5. * @param event the event
  6. * @param parent the parent element
  7. * @return true if the event targets the image
  8. */
  9. private boolean eventOccurredOnImage(NativeEvent event, Element parent) {
  10. EventTarget eventTarget = event.getEventTarget();
  11. if (!Element.is(eventTarget)) {
  12. return false;
  13. }
  14. Element target = eventTarget.cast();
  15. // Make sure the target occurred within the div around the image.
  16. Element imgWrapper = parent.getFirstChildElement().getNextSiblingElement();
  17. return imgWrapper.isOrHasChild(target);
  18. }
  19. }

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

  1. Element nextSibling = toReplace.getNextSiblingElement();
  2. childContainer.replaceChild(newChildren.getChild(0), toReplace);
  3. toReplace = nextSibling;

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

  1. /**
  2. * Redraw the widget.
  3. */
  4. public void redraw() {
  5. SafeHtmlBuilder sb = new SafeHtmlBuilder();
  6. cell.render(createContext(), value, sb);
  7. getElement().setInnerSafeHtml(sb.toSafeHtml());
  8. /*
  9. * The rendered Cell should fill the root element so height and width styles
  10. * applied to the widget also apply to the Cell. If there is exactly one
  11. * child element, the height and width are set to 100% to fill the parent.
  12. */
  13. Element child = getElement().getFirstChildElement();
  14. if (child != null && child.getNextSiblingElement() == null) {
  15. child.getStyle().setHeight(100, Unit.PCT);
  16. child.getStyle().setWidth(100, Unit.PCT);
  17. }
  18. }

代码示例来源:origin: stephenh/tessell

  1. private com.google.gwt.dom.client.Element findBodyTr(final int i) {
  2. int j = 0;
  3. Element tr = body.getFirstChildElement();
  4. while (tr != null && j < i) {
  5. tr = tr.getNextSiblingElement();
  6. j++;
  7. }
  8. return tr;
  9. }

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

  1. @Override
  2. protected Element getCellParent(Element item) {
  3. return item.getFirstChildElement().getNextSiblingElement();
  4. }

代码示例来源:origin: errai/errai

  1. private static Element firstNonMetaElement(final Element parserDiv) {
  2. Element displayable = parserDiv.getFirstChildElement();
  3. while (displayable != null && displayable.getTagName().equalsIgnoreCase("meta")) {
  4. displayable = displayable.getNextSiblingElement();
  5. }
  6. return displayable;
  7. }

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

  1. private Element getToolBar(String role) {
  2. Element element = getElement().getFirstChildElement();
  3. while (element != null) {
  4. if (role.equals(element.getAttribute("data-role"))) {
  5. return element;
  6. }
  7. element = element.getNextSiblingElement();
  8. }
  9. return null;
  10. }

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

  1. @Override
  2. public void setValue(Context context, Element parent, C object) {
  3. Element curChild = getContainerElement(parent).getFirstChildElement();
  4. for (HasCell<C, ?> hasCell : hasCells) {
  5. setValueImpl(context, curChild, object, hasCell);
  6. curChild = curChild.getNextSiblingElement();
  7. }
  8. }

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

  1. Element newChild = newSection.getFirstChildElement();
  2. while (newChild != null) {
  3. Element next = newChild.getNextSiblingElement();
  4. section.insertBefore(newChild, insertBefore);
  5. newChild = next;

代码示例来源:origin: org.jboss.errai/errai-ui

  1. private static <T> VisitContext<T> depthFirst(VisitContextImpl<T> context, Element root, Visitor<T> visitor) {
  2. Element current = root;
  3. // If visit returns false, stop visiting down (but keep visiting)
  4. if (visitor.visit(context, current)) {
  5. current = current.getFirstChildElement();
  6. while (current != null && !context.isVisitComplete()) {
  7. depthFirst(context, current, visitor);
  8. current = current.getNextSiblingElement();
  9. }
  10. }
  11. return context;
  12. }

代码示例来源:origin: com.googlecode.gwtquery/gwtquery

  1. /**
  2. * Get all following siblings of each element in the set of matched elements, filtered by a
  3. * selector.
  4. */
  5. public GQuery nextAll(String filter) {
  6. JsNodeArray result = JsNodeArray.create();
  7. for (Element e : elements) {
  8. allNextSiblingElements(e.getNextSiblingElement(), result, null, null, filter);
  9. }
  10. return pushStack(unique(result), "nextAll", getSelector());
  11. }

代码示例来源:origin: com.googlecode.gwtquery/gwtquery

  1. /**
  2. * Get all following siblings of each element up to but not including the element matched by the
  3. * GQuery object, filtered by a selector.
  4. *
  5. * @return
  6. */
  7. public GQuery nextUntil(GQuery until, String filter) {
  8. JsNodeArray result = JsNodeArray.create();
  9. for (Element e : elements) {
  10. allNextSiblingElements(e.getNextSiblingElement(), result, null, until, filter);
  11. }
  12. return pushStack(unique(result), "nextUntil", getSelector());
  13. }

相关文章

Element类方法