本文整理了Java中com.google.gwt.dom.client.Element.getParentNode()
方法的一些代码示例,展示了Element.getParentNode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getParentNode()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getParentNode
暂无
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void initializeClaimedElement() {
if (renderable != null) {
renderable.initializeClaimedElement();
} else {
elementToWrap.getParentNode().replaceChild(widget.getElement(), elementToWrap);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
private static Element getFirstAncestorWithListener(Event evt) {
Element curElem = evt.getCurrentEventTarget().cast();
while (curElem != null && getEventListener(curElem) == null) {
curElem = curElem.getParentNode().cast();
}
return curElem;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public void setCaption(
FieldSetElement fieldset, Element legend, @IsSafeHtml String caption, boolean asHTML) {
// TODO(bruce): rewrite to be inlinable
assert (caption != null);
if (asHTML) {
legend.setInnerHTML(caption);
} else {
legend.setInnerText(caption);
}
if (!"".equals(caption)) {
// This is formulated to become an append (if there's no widget), an
// insertion at index 0 (if there is a widget but no legend already), or
// a no-op (if the legend is already in place).
fieldset.insertBefore(legend, fieldset.getFirstChild());
} else if (legend.getParentNode() != null) {
// We remove the legend from the DOM because leaving it in with an empty
// string renders as an ugly gap in the top border on some browsers.
fieldset.removeChild(legend);
}
}
}
代码示例来源:origin: thothbot/parallax
@Override
public void onRemove(Object3D object) {
if (element.getParentNode() != null) {
element.getParentNode().removeChild(element);
}
}
});
代码示例来源:origin: com.google.gwt/gwt-servlet
hiddenDiv.appendChild(element);
wrapInitializationCallback.execute();
element.getParentNode().removeChild(element);
代码示例来源:origin: net.wetheinter/gwt-user
@Override
public void initializeClaimedElement() {
if (renderable != null) {
renderable.initializeClaimedElement();
} else {
elementToWrap.getParentNode().replaceChild(widget.getElement(), elementToWrap);
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
@Override
public void initializeClaimedElement() {
if (renderable != null) {
renderable.initializeClaimedElement();
} else {
elementToWrap.getParentNode().replaceChild(widget.getElement(), elementToWrap);
}
}
代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils
@PatchMethod
static void replaceNode(UIObject uiObject, Element node, Element newNode) {
Node parent = node.getParentNode();
if (parent != null) {
parent.insertBefore(newNode, node);
parent.removeChild(node);
}
}
代码示例来源:origin: gwt-test-utils/gwt-test-utils
@PatchMethod
static void replaceNode(UIObject uiObject, Element node, Element newNode) {
Node parent = node.getParentNode();
if (parent != null) {
parent.insertBefore(newNode, node);
parent.removeChild(node);
}
}
代码示例来源:origin: net.wetheinter/gwt-user
private static Element getFirstAncestorWithListener(Event evt) {
Element curElem = evt.getCurrentEventTarget().cast();
while (curElem != null && getEventListener(curElem) == null) {
curElem = curElem.getParentNode().cast();
}
return curElem;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
private static Element getFirstAncestorWithListener(Event evt) {
Element curElem = evt.getCurrentEventTarget().cast();
while (curElem != null && getEventListener(curElem) == null) {
curElem = curElem.getParentNode().cast();
}
return curElem;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
public void setCaption(FieldSetElement fieldset, Element legend,
String caption, boolean asHTML) {
// TODO(bruce): rewrite to be inlinable
assert (caption != null);
if (asHTML) {
legend.setInnerHTML(caption);
} else {
legend.setInnerText(caption);
}
if (!"".equals(caption)) {
// This is formulated to become an append (if there's no widget), an
// insertion at index 0 (if there is a widget but no legend already), or
// a no-op (if the legend is already in place).
fieldset.insertBefore(legend, fieldset.getFirstChild());
} else if (legend.getParentNode() != null) {
// We remove the legend from the DOM because leaving it in with an empty
// string renders as an ugly gap in the top border on some browsers.
fieldset.removeChild(legend);
}
}
}
代码示例来源:origin: net.wetheinter/gwt-user
public void setCaption(FieldSetElement fieldset, Element legend,
String caption, boolean asHTML) {
// TODO(bruce): rewrite to be inlinable
assert (caption != null);
if (asHTML) {
legend.setInnerHTML(caption);
} else {
legend.setInnerText(caption);
}
if (!"".equals(caption)) {
// This is formulated to become an append (if there's no widget), an
// insertion at index 0 (if there is a widget but no legend already), or
// a no-op (if the legend is already in place).
fieldset.insertBefore(legend, fieldset.getFirstChild());
} else if (legend.getParentNode() != null) {
// We remove the legend from the DOM because leaving it in with an empty
// string renders as an ugly gap in the top border on some browsers.
fieldset.removeChild(legend);
}
}
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
private GQuery parentsUntil(Predicate predicate) {
JsNodeArray result = JsNodeArray.create();
for (Element e : elements) {
int i = 0;
Node par = e.getParentNode();
while (par != null && par != document) {
if (predicate.f(par, i)) {
break;
}
result.addNode(par);
par = par.getParentNode();
i++;
}
}
return new GQuery(unique(result)).setPreviousObject(this);
}
代码示例来源:origin: Putnami/putnami-web-toolkit
private void loadAnalyticsScript() {
ScriptElement script = Document.get().createScriptElement();
script.setSrc(GoogleAnalyticsImpl.SCRIPT_URL);
script.setType("text/javascript");
script.setAttribute("async", "true");
Element firstScript = Document.get().getElementsByTagName("script").getItem(0);
firstScript.getParentNode().insertBefore(script, firstScript);
}
代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library
private void checkAnchorPanel() {
if (anchorPanel == null) {
anchorPanel = new CustomFlowPanel(anchor);
int anchorIdx = -1;
Node parent = anchor.getParentNode();
if (parent != null && parent == getElement()) {
for (int i = 0; i < parent.getChildCount(); i++) {
if (parent.getChild(i) == anchor) {
anchorIdx = i;
break;
}
}
}
if (anchorIdx >= 0) insert(anchorPanel, anchorIdx);
else add(anchorPanel);
}
if (controlGroupRoot != null && controlGroupRoot.getParent() != anchorPanel) {
anchorPanel.add(controlGroupRoot);
}
}
代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-standalone
private void checkAnchorPanel() {
if (anchorPanel == null) {
anchorPanel = new CustomFlowPanel(anchor);
int anchorIdx = -1;
Node parent = anchor.getParentNode();
if (parent != null && parent == getElement()) {
for (int i = 0; i < parent.getChildCount(); i++) {
if (parent.getChild(i) == anchor) {
anchorIdx = i;
break;
}
}
}
if (anchorIdx >= 0) insert(anchorPanel, anchorIdx);
else add(anchorPanel);
}
if (controlGroupRoot != null && controlGroupRoot.getParent() != anchorPanel) {
anchorPanel.add(controlGroupRoot);
}
}
代码示例来源:origin: jqm4gwt/jqm4gwt
private void checkAnchorPanel() {
if (anchorPanel == null) {
anchorPanel = new CustomFlowPanel(anchor);
int anchorIdx = -1;
Node parent = anchor.getParentNode();
if (parent != null && parent == getElement()) {
for (int i = 0; i < parent.getChildCount(); i++) {
if (parent.getChild(i) == anchor) {
anchorIdx = i;
break;
}
}
}
if (anchorIdx >= 0) insert(anchorPanel, anchorIdx);
else add(anchorPanel);
}
if (controlGroupRoot != null && controlGroupRoot.getParent() != anchorPanel) {
anchorPanel.add(controlGroupRoot);
}
}
代码示例来源:origin: gwt-test-utils/gwt-test-utils
@PatchMethod
static Element getNextSiblingElement(Object domImpl, Element elem) {
Node parent = elem.getParentNode();
if (parent == null) {
return null;
}
NodeList<Node> list = parent.getChildNodes();
for (int i = 0; i < list.getLength(); i++) {
Node current = list.getItem(i);
if (current.equals(elem) && i < list.getLength() - 1) {
while (i < list.getLength() - 1) {
i++;
if (list.getItem(i).getNodeType() == Node.ELEMENT_NODE) {
return list.getItem(i).cast();
}
}
}
}
return null;
}
代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils
@PatchMethod
static Element getNextSiblingElement(Object domImpl, Element elem) {
Node parent = elem.getParentNode();
if (parent == null) {
return null;
}
NodeList<Node> list = parent.getChildNodes();
for (int i = 0; i < list.getLength(); i++) {
Node current = list.getItem(i);
if (current.equals(elem) && i < list.getLength() - 1) {
while (i < list.getLength() - 1) {
i++;
if (list.getItem(i).getNodeType() == Node.ELEMENT_NODE) {
return list.getItem(i).cast();
}
}
}
}
return null;
}
内容来源于网络,如有侵权,请联系作者删除!