本文整理了Java中com.google.gwt.dom.client.Element.getFirstChildElement()
方法的一些代码示例,展示了Element.getFirstChildElement()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getFirstChildElement()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getFirstChildElement
[英]The first child of element this element. If there is no such element, this returns null.
[中]此元素的第一个子元素。如果没有这样的元素,则返回null。
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Returns the element that selection is applied to.
*
* @param nodeElem the element that represents the node
* @return the cell parent within the node
*/
static Element getSelectionElement(Element nodeElem) {
return nodeElem.getFirstChildElement();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Get the input element.
*
* @param parent the cell parent element
* @return the input element
*/
protected Element getInputElement(Element parent) {
return parent.getFirstChildElement();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public Element getContainerElement(Element outerElem) {
return isFF2Mac ? outerElem.getFirstChildElement() : outerElem;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Returns the element that selection is applied to.
*
* @param nodeElem the element that represents the node
* @return the cell parent within the node
*/
private static Element getImageElement(Element nodeElem) {
return getSelectionElement(nodeElem).getFirstChildElement().getFirstChildElement();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Gets the first child element of the given element.
*
* @param elem the element whose child is to be retrieved
* @return the child element
*/
public static com.google.gwt.user.client.Element getFirstChild(Element elem) {
return asOld(elem.getFirstChildElement());
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
protected Element getCellParent(Element item) {
return item.getFirstChildElement().getNextSiblingElement();
}
代码示例来源: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
/**
* Get the inner text or html of the element, taking the inner span wrap into consideration, if
* needed. Prefer using {@link #getText} or {@link #getHtml} instead of this method.
*
* @param isHtml true to get the inner html, false to get the inner text
* @return the text or html
*/
public String getTextOrHtml(boolean isHtml) {
Element elem = isSpanWrapped ? element.getFirstChildElement() : element;
return isHtml ? elem.getInnerHTML() : elem.getInnerText();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onUnpush(Element parent) {
parent.getFirstChildElement().removeClassName(style.buttonCellBasePushing());
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onPush(Element parent) {
parent.getFirstChildElement().addClassName(style.buttonCellBasePushing());
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void setFocus(Element parent, boolean focused) {
Element focusable = parent.getFirstChildElement().cast();
if (focused) {
focusable.focus();
} else {
focusable.blur();
}
}
}
代码示例来源: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
@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
public static Element fromHtml(@IsSafeHtml String html) {
ensureHiddenDiv();
hiddenDiv.setInnerHTML(html);
Element newbie = hiddenDiv.getFirstChildElement();
orphan(newbie);
return newbie;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
private void createFrame() {
// Attach a hidden IFrame to the form. This is the target iframe to which
// the form will be submitted. We have to create the iframe using innerHTML,
// because setting an iframe's 'name' property dynamically doesn't work on
// most browsers.
Element dummy = Document.get().createDivElement();
dummy.setInnerSafeHtml(IFrameTemplate.INSTANCE.get(frameName));
synthesizedFrame = dummy.getFirstChildElement();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
protected Element doFinishImpl() {
Element tmp = Document.get().createDivElement();
tmp.setInnerSafeHtml(asSafeHtml());
return tmp.getFirstChildElement();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onBrowserEvent(Context context, Element parent, C value,
NativeEvent event, ValueUpdater<C> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
if (CLICK.equals(event.getType())) {
EventTarget eventTarget = event.getEventTarget();
if (!Element.is(eventTarget)) {
return;
}
if (parent.getFirstChildElement().isOrHasChild(Element.as(eventTarget))) {
// Ignore clicks that occur outside of the main element.
onEnterKeyDown(context, parent, value, event, valueUpdater);
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public Element createStructure(SafeUri url, int left, int top, int width, int height) {
Element tmp = Document.get().createSpanElement();
tmp.setInnerSafeHtml(getSafeHtml(url, left, top, width, height));
Element elem = tmp.getFirstChildElement();
elem.setPropertyJSO("onload", createOnLoadHandlerFunction());
return elem;
}
内容来源于网络,如有侵权,请联系作者删除!