本文整理了Java中com.google.gwt.dom.client.Element.getNextSiblingElement()
方法的一些代码示例,展示了Element.getNextSiblingElement()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getNextSiblingElement()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getNextSiblingElement
[英]The element immediately following this element. If there is no such element, this returns null.
[中]
代码示例来源:origin: kaaproject/kaa
private void setCheckBoxStyle(CheckBox box) {
Element input = box.getElement().getFirstChildElement();
input.getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
Element label = input.getNextSiblingElement();
label.getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
label.getStyle().setPaddingLeft(5, Unit.PX);
label.getStyle().setFontSize(13, Unit.PX);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
protected Element getCellParent(Element item) {
return item.getFirstChildElement().getNextSiblingElement();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void setValue(Context context, Element parent, C object) {
Element curChild = getContainerElement(parent).getFirstChildElement();
for (HasCell<C, ?> hasCell : hasCells) {
setValueImpl(context, curChild, object, hasCell);
curChild = curChild.getNextSiblingElement();
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public boolean isEditing(Context context, Element parent, C value) {
Element curChild = getContainerElement(parent).getFirstChildElement();
for (HasCell<C, ?> hasCell : hasCells) {
if (isEditingImpl(context, curChild, value, hasCell)) {
return true;
}
curChild = curChild.getNextSiblingElement();
}
return false;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public boolean resetFocus(Context context, Element parent, C value) {
Element curChild = getContainerElement(parent).getFirstChildElement();
for (HasCell<C, ?> hasCell : hasCells) {
// The first child that takes focus wins. Only one child should ever be in
// edit mode, so this is safe.
if (resetFocusImpl(context, curChild, value, hasCell)) {
return true;
}
curChild = curChild.getNextSiblingElement();
}
return false;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* This method is used for legacy AbstractCellTable that's not a
* {@link TableSectionChangeHandler}.
*/
protected void replaceAllRowsImplLegacy(AbstractCellTable<?> table, TableSectionElement section,
SafeHtml html) {
// Remove all children.
Element child = section.getFirstChildElement();
while (child != null) {
Element next = child.getNextSiblingElement();
section.removeChild(child);
child = next;
}
// Add new child elements.
TableSectionElement newSection = convertToSectionElement(table, section.getTagName(), html);
child = newSection.getFirstChildElement();
while (child != null) {
Element next = child.getNextSiblingElement();
section.appendChild(child);
child = next;
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Attaches the element to the dom temporarily. Keeps track of where it is
* attached so that things can be put back latter.
*
* @return attachment record which can be used for reverting back to previous
* DOM state
*/
public static TempAttachment attachToDom(Element element) {
// TODO(rjrjr) This is copied from HTMLPanel. Reconcile
ensureHiddenDiv();
// Hang on to the panel's original parent and sibling elements so that it
// can be replaced.
Element origParent = element.getParentElement();
Element origSibling = element.getNextSiblingElement();
// Attach the panel's element to the hidden div.
hiddenDiv.appendChild(element);
return new TempAttachment(origParent, origSibling, element);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onBrowserEvent(Context context, Element parent, C value,
NativeEvent event, ValueUpdater<C> valueUpdater) {
int index = 0;
EventTarget eventTarget = event.getEventTarget();
if (Element.is(eventTarget)) {
Element target = eventTarget.cast();
Element container = getContainerElement(parent);
Element wrapper = container.getFirstChildElement();
while (wrapper != null) {
if (wrapper.isOrHasChild(target)) {
onBrowserEventImpl(context, wrapper, value, event, valueUpdater,
hasCells.get(index));
}
index++;
wrapper = wrapper.getNextSiblingElement();
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Check whether or not an event occurred within the wrapper around the image
* element.
*
* @param event the event
* @param parent the parent element
* @return true if the event targets the image
*/
private boolean eventOccurredOnImage(NativeEvent event, Element parent) {
EventTarget eventTarget = event.getEventTarget();
if (!Element.is(eventTarget)) {
return false;
}
Element target = eventTarget.cast();
// Make sure the target occurred within the div around the image.
Element imgWrapper = parent.getFirstChildElement().getNextSiblingElement();
return imgWrapper.isOrHasChild(target);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
Element nextSibling = toReplace.getNextSiblingElement();
childContainer.replaceChild(newChildren.getChild(0), toReplace);
toReplace = nextSibling;
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Redraw the widget.
*/
public void redraw() {
SafeHtmlBuilder sb = new SafeHtmlBuilder();
cell.render(createContext(), value, sb);
getElement().setInnerSafeHtml(sb.toSafeHtml());
/*
* The rendered Cell should fill the root element so height and width styles
* applied to the widget also apply to the Cell. If there is exactly one
* child element, the height and width are set to 100% to fill the parent.
*/
Element child = getElement().getFirstChildElement();
if (child != null && child.getNextSiblingElement() == null) {
child.getStyle().setHeight(100, Unit.PCT);
child.getStyle().setWidth(100, Unit.PCT);
}
}
代码示例来源:origin: stephenh/tessell
private com.google.gwt.dom.client.Element findBodyTr(final int i) {
int j = 0;
Element tr = body.getFirstChildElement();
while (tr != null && j < i) {
tr = tr.getNextSiblingElement();
j++;
}
return tr;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
@Override
protected Element getCellParent(Element item) {
return item.getFirstChildElement().getNextSiblingElement();
}
代码示例来源:origin: errai/errai
private static Element firstNonMetaElement(final Element parserDiv) {
Element displayable = parserDiv.getFirstChildElement();
while (displayable != null && displayable.getTagName().equalsIgnoreCase("meta")) {
displayable = displayable.getNextSiblingElement();
}
return displayable;
}
代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-standalone
private Element getToolBar(String role) {
Element element = getElement().getFirstChildElement();
while (element != null) {
if (role.equals(element.getAttribute("data-role"))) {
return element;
}
element = element.getNextSiblingElement();
}
return null;
}
代码示例来源:origin: net.wetheinter/gwt-user
@Override
public void setValue(Context context, Element parent, C object) {
Element curChild = getContainerElement(parent).getFirstChildElement();
for (HasCell<C, ?> hasCell : hasCells) {
setValueImpl(context, curChild, object, hasCell);
curChild = curChild.getNextSiblingElement();
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
Element newChild = newSection.getFirstChildElement();
while (newChild != null) {
Element next = newChild.getNextSiblingElement();
section.insertBefore(newChild, insertBefore);
newChild = next;
代码示例来源:origin: org.jboss.errai/errai-ui
private static <T> VisitContext<T> depthFirst(VisitContextImpl<T> context, Element root, Visitor<T> visitor) {
Element current = root;
// If visit returns false, stop visiting down (but keep visiting)
if (visitor.visit(context, current)) {
current = current.getFirstChildElement();
while (current != null && !context.isVisitComplete()) {
depthFirst(context, current, visitor);
current = current.getNextSiblingElement();
}
}
return context;
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
/**
* Get all following siblings of each element in the set of matched elements, filtered by a
* selector.
*/
public GQuery nextAll(String filter) {
JsNodeArray result = JsNodeArray.create();
for (Element e : elements) {
allNextSiblingElements(e.getNextSiblingElement(), result, null, null, filter);
}
return pushStack(unique(result), "nextAll", getSelector());
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
/**
* Get all following siblings of each element up to but not including the element matched by the
* GQuery object, filtered by a selector.
*
* @return
*/
public GQuery nextUntil(GQuery until, String filter) {
JsNodeArray result = JsNodeArray.create();
for (Element e : elements) {
allNextSiblingElements(e.getNextSiblingElement(), result, null, until, filter);
}
return pushStack(unique(result), "nextUntil", getSelector());
}
内容来源于网络,如有侵权,请联系作者删除!