本文整理了Java中com.google.gwt.dom.client.Element.getFirstChild()
方法的一些代码示例,展示了Element.getFirstChild()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getFirstChild()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getFirstChild
[英]The first child of element this element. If there is no such element, this returns null.
[中]此元素的第一个子元素。如果没有这样的元素,则返回null。
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Get the input element in edit mode.
*/
private InputElement getInputElement(Element parent) {
return parent.getFirstChild().<InputElement> cast();
}
代码示例来源:origin: com.extjs/gxt
protected void doAllWidths(List<Integer> ws, int tw) {
if (!enableGrouping) return;
NodeList<Element> gs = getGroups();
for (int i = 0, len = gs.getLength(); i < len; i++) {
Element s = gs.getItem(i).getChildNodes().getItem(2).cast();
El.fly(s).setWidth(tw);
if (s.getFirstChild() == null) return;
El.fly(s.getFirstChildElement()).setWidth(tw);
TableSectionElement tse = s.getFirstChildElement().cast();
NodeList<Element> cells = tse.getRows().getItem(0).getChildNodes().cast();
for (int j = 0, wlen = ws.size(); j < wlen; j++) {
El.fly(cells.getItem(j)).setWidth(ws.get(j));
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Update the view data based on the current value.
*
* @param parent the parent element
* @param viewData the {@link ViewData} object to update
* @param isEditing true if in edit mode
* @return the new value
*/
private String updateViewData(Element parent, ViewData viewData,
boolean isEditing) {
InputElement input = (InputElement) parent.getFirstChild();
String value = input.getValue();
viewData.setText(value);
viewData.setEditing(isEditing);
return value;
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui
public void onElementChanged(NodeDescriptor node, Element element) {
Element el = getRootContainer(node).getFirstChildElement();
if (el == null) {
return;
}
el.removeFromParent();
getRootContainer(node).insertFirst(element.getFirstChild());
node.setNodeContainerElement(null);
node.setJointContainerElement(null);
onSelectChange(node.getNode(), tree.getSelectionModel().isSelected(node.getNode()));
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Creates an HTML IFRAME element with a name.
*
* @param name the name of the frame, which must contain at least one
* non-whitespace character and must not contain reserved HTML markup
* characters such as '<code><</code>', '<code>></code>',
* or '<code>&</code>'
* @return the newly-created element
* @throws IllegalArgumentException if the supplied name is not allowed
*/
private static IFrameElement createIFrame(String name) {
if (name == null || !isValidName(name.trim())) {
throw new IllegalArgumentException(
"expecting one or more non-whitespace chars with no '<', '>', or '&'");
}
// Use innerHTML to implicitly create the <iframe>. This is necessary
// because most browsers will not respect a dynamically-set iframe name.
Element div = DOM.createDiv();
div.setInnerSafeHtml(IFrameTemplate.INSTANCE.get(name));
return div.getFirstChild().cast();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onBrowserEvent(Context context, Element parent, String value,
NativeEvent event, ValueUpdater<String> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
String type = event.getType();
if (BrowserEvents.CHANGE.equals(type)) {
Object key = context.getKey();
SelectElement select = parent.getFirstChild().cast();
String newValue = options.get(select.getSelectedIndex());
setViewData(key, newValue);
finishEditing(parent, newValue, key, valueUpdater);
if (valueUpdater != null) {
valueUpdater.update(newValue);
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
&& event.getKeyCode() == KeyCodes.KEY_ENTER;
if (BrowserEvents.CHANGE.equals(type) || enterPressed) {
InputElement input = parent.getFirstChild().cast();
Boolean isChecked = input.isChecked();
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Get the input element in edit mode.
*/
private InputElement getInputElement(Element parent) {
return parent.getFirstChild().<InputElement> cast();
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Get the input element in edit mode.
*/
private InputElement getInputElement(Element parent) {
return parent.getFirstChild().<InputElement> cast();
}
代码示例来源:origin: bedatadriven/activityinfo
/**
* Get the input element in edit mode.
*/
private InputElement getInputElement(Element parent) {
return parent.getFirstChild().<InputElement> cast();
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui
private boolean isRowRendered(int i, List<Node> visible) {
Element e = view.getRootContainer(getNodeDescriptor(visible.get(i)));
return e != null && e.getFirstChild().hasChildNodes();
}
代码示例来源:origin: org.eagle-i/eagle-i-datatools-sweet-gwt
/**
* Need to do some additional clean up to really clear the list
*/
public void clear() {
super.clear();
// remove the option group elements
Element elm = getElement();
while (elm.hasChildNodes()) {
elm.removeChild(elm.getFirstChild());
}
groupMap.clear();
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Update the view data based on the current value.
*
* @param parent the parent element
* @param viewData the {@link ViewData} object to update
* @param isEditing true if in edit mode
* @return the new value
*/
private String updateViewData(Element parent, ViewData viewData,
boolean isEditing) {
InputElement input = (InputElement) parent.getFirstChild();
String value = input.getValue();
viewData.setText(value);
viewData.setEditing(isEditing);
return value;
}
}
代码示例来源:origin: net.wetheinter/gwt-user
@Override
public void onBrowserEvent(Context context, Element parent, String value,
NativeEvent event, ValueUpdater<String> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
String type = event.getType();
if (BrowserEvents.CHANGE.equals(type)) {
Object key = context.getKey();
SelectElement select = parent.getFirstChild().cast();
String newValue = options.get(select.getSelectedIndex());
setViewData(key, newValue);
finishEditing(parent, newValue, key, valueUpdater);
if (valueUpdater != null) {
valueUpdater.update(newValue);
}
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
@Override
public void onBrowserEvent(Context context, Element parent, String value,
NativeEvent event, ValueUpdater<String> valueUpdater) {
super.onBrowserEvent(context, parent, value, event, valueUpdater);
String type = event.getType();
if (BrowserEvents.CHANGE.equals(type)) {
Object key = context.getKey();
SelectElement select = parent.getFirstChild().cast();
String newValue = options.get(select.getSelectedIndex());
setViewData(key, newValue);
finishEditing(parent, newValue, key, valueUpdater);
if (valueUpdater != null) {
valueUpdater.update(newValue);
}
}
}
代码示例来源:origin: com.extjs/gxt
/**
* Returns the grid's <TD> HtmlElement at the specified coordinates.
*
* @param row the row index in which to find the cell
* @param col the column index of the cell
* @return the <TD> at the specified coordinates
*/
public Element getCell(int row, int col) {
// ROW DIV TABLE TR TD
Element rowEl = getRow(row);
return (Element) ((rowEl != null && rowEl.hasChildNodes())
? rowEl.getFirstChild().getFirstChild().getFirstChild().getChildNodes().getItem(col) : null);
}
代码示例来源:origin: com.extjs/gxt
private void updateGroupWidths() {
if (!enableGrouping || ds.getCount() < 1) {
return;
}
String tw = Math.max(cm.getTotalWidth(), el.dom.getOffsetWidth() - getScrollAdjust()) + "px";
NodeList<Element> gs = getGroups();
for (int i = 0, len = gs.getLength(); i < len; i++) {
Element e = gs.getItem(i).getFirstChild().cast();
e.getStyle().setProperty("width", tw);
}
}
代码示例来源:origin: org.n52.sensorweb/sensorwebclient-ui
public static void continueStartup() {
// init handlers before throwing events
SosDataManager.getDataManager();
new SOSController();
if (ClientUtils.isSesEnabled()) {
new SesController();
}
View.getView();
Element element = Document.get().getElementById("loadingWrapper");
while (element.hasChildNodes()) {
element.removeChild(element.getFirstChild());
}
Application.finishStartup();
}
代码示例来源:origin: SwellRT/swellrt
protected void assertStructure(ContentElement e,
ContentElement parent, ContentNode prev, ContentNode next,
ContentNode first, ContentNode last) {
assertStructure(e, parent, prev, next);
assertSame(first, c.getFirstChild(e));
assertSame(last, c.getLastChild(e));
assertSame(first == null ? null : first.getImplNodelet(), e.getImplNodelet().getFirstChild());
assertSame(last == null ? null : last.getImplNodelet(), e.getImplNodelet().getLastChild());
}
代码示例来源:origin: apache/incubator-wave
protected void assertStructure(ContentElement e,
ContentElement parent, ContentNode prev, ContentNode next,
ContentNode first, ContentNode last) {
assertStructure(e, parent, prev, next);
assertSame(first, c.getFirstChild(e));
assertSame(last, c.getLastChild(e));
assertSame(first == null ? null : first.getImplNodelet(), e.getImplNodelet().getFirstChild());
assertSame(last == null ? null : last.getImplNodelet(), e.getImplNodelet().getLastChild());
}
内容来源于网络,如有侵权,请联系作者删除!