本文整理了Java中com.google.gwt.dom.client.Element.insertFirst()
方法的一些代码示例,展示了Element.insertFirst()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.insertFirst()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:insertFirst
暂无
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Ensure that the child container exists and return it.
*
* @return the child container
*/
Element ensureChildContainer() {
if (childContainer == null) {
childContainer = Document.get().createDivElement();
ensureContentContainer().insertFirst(childContainer);
}
return childContainer;
}
代码示例来源:origin: stephenh/tessell
@Override
public void insertFirst(IsElement element) {
this.element.insertFirst(element.asElement());
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
/**
* Inserts the selection checkbox in first column.
*/
private void insertSelectionCheckbox(final TableCellElement td) {
com.google.gwt.dom.client.Element container = td.getFirstChildElement();
container.insertFirst(selectionCheckBox.getElement());
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
/**
* Inserts a spacer element in the first column to ensure that positioning of content is the same when there is or is not a checkbox.
*/
private void insertSelectionCheckboxSpacer(final TableCellElement td) {
com.google.gwt.dom.client.Element container = td.getFirstChildElement();
container.insertFirst(selectionCheckBoxSpacer.getElement());
}
代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library
/**
* Moves all children of "from" element onto "to" element.
*/
public static void moveChildren(Element from, Element to) {
if (from == null || to == null || from == to) return;
for (int k = from.getChildCount() - 1; k >= 0; k--) {
Node node = from.getChild(k);
from.removeChild(node);
to.insertFirst(node);
}
}
代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-standalone
/**
* Moves all children of "from" element onto "to" element.
*/
public static void moveChildren(Element from, Element to) {
if (from == null || to == null || from == to) return;
for (int k = from.getChildCount() - 1; k >= 0; k--) {
Node node = from.getChild(k);
from.removeChild(node);
to.insertFirst(node);
}
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Ensure that the child container exists and return it.
*
* @return the child container
*/
Element ensureChildContainer() {
if (childContainer == null) {
childContainer = Document.get().createDivElement();
ensureContentContainer().insertFirst(childContainer);
}
return childContainer;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Ensure that the child container exists and return it.
*
* @return the child container
*/
Element ensureChildContainer() {
if (childContainer == null) {
childContainer = Document.get().createDivElement();
ensureContentContainer().insertFirst(childContainer);
}
return childContainer;
}
代码示例来源:origin: jqm4gwt/jqm4gwt
/**
* Moves all children of "from" element onto "to" element.
*/
public static void moveChildren(Element from, Element to) {
if (from == null || to == null || from == to) return;
for (int k = from.getChildCount() - 1; k >= 0; k--) {
Node node = from.getChild(k);
from.removeChild(node);
to.insertFirst(node);
}
}
代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library
private void insertFirstChild(Element elem) {
if (anchor == null) getElement().insertFirst(elem);
else if (controlGroup != null) controlGroup.getElement().insertFirst(elem);
else anchor.insertFirst(elem);
}
代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-standalone
private void insertFirstChild(Element elem) {
if (anchor == null) getElement().insertFirst(elem);
else if (controlGroup != null) controlGroup.getElement().insertFirst(elem);
else anchor.insertFirst(elem);
}
代码示例来源:origin: jqm4gwt/jqm4gwt
private void insertFirstChild(Element elem) {
if (anchor == null) getElement().insertFirst(elem);
else if (controlGroup != null) controlGroup.getElement().insertFirst(elem);
else anchor.insertFirst(elem);
}
代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library
/**
* Sets the image on this list item to the given source url.
* <br> Neither 'jqm4gwt-listitem-thumb' nor 'jqm4gwt-listitem-icon' class is added.
*/
public void setImage(String src) {
if (src == null) {
throw new RuntimeException("Cannot set image to null. Call removeImage() if you wanted to remove the image");
}
if (imageElem == null) {
imageElem = Document.get().createImageElement();
// must be first child according to jquery.mobile-1.4.x.css
if (anchor != null) anchor.insertFirst(imageElem);
else insertFirstChild(imageElem);
}
imageElem.setAttribute("src", src);
getElement().addClassName(STYLE_UI_LI_HAS_THUMB);
}
代码示例来源:origin: jqm4gwt/jqm4gwt
/**
* Sets the image on this list item to the given source url.
* <br> Neither 'jqm4gwt-listitem-thumb' nor 'jqm4gwt-listitem-icon' class is added.
*/
public void setImage(String src) {
if (src == null) {
throw new RuntimeException("Cannot set image to null. Call removeImage() if you wanted to remove the image");
}
if (imageElem == null) {
imageElem = Document.get().createImageElement();
// must be first child according to jquery.mobile-1.4.x.css
if (anchor != null) anchor.insertFirst(imageElem);
else insertFirstChild(imageElem);
}
imageElem.setAttribute("src", src);
getElement().addClassName(STYLE_UI_LI_HAS_THUMB);
}
代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-standalone
/**
* Sets the image on this list item to the given source url.
* <br> Neither 'jqm4gwt-listitem-thumb' nor 'jqm4gwt-listitem-icon' class is added.
*/
public void setImage(String src) {
if (src == null) {
throw new RuntimeException("Cannot set image to null. Call removeImage() if you wanted to remove the image");
}
if (imageElem == null) {
imageElem = Document.get().createImageElement();
// must be first child according to jquery.mobile-1.4.x.css
if (anchor != null) anchor.insertFirst(imageElem);
else insertFirstChild(imageElem);
}
imageElem.setAttribute("src", src);
getElement().addClassName(STYLE_UI_LI_HAS_THUMB);
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
public void setRequired(boolean required) {
if (required) {
if (requirementAsterisk == null) {
requirementAsterisk = SpanElement.as(DOM.createSpan());
requirementAsterisk.setClassName("requiredfield");
requirementAsterisk.setInnerText("*");
}
label.insertFirst(requirementAsterisk);
} else if (requirementAsterisk != null && label.isOrHasChild(requirementAsterisk)) {
label.removeChild(requirementAsterisk);
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui
public void onJointChange(NodeDescriptor node, Tree.Joint joint) {
Element currJointEl = getJointContainer(node);
if (currJointEl == null) {
return;
}
Element jointContainer = tree.getPresentationRenderer().getJointContainer(joint);
getNodeContainer(node).insertFirst(jointContainer);
currJointEl.removeFromParent();
node.setJointContainerElement(jointContainer);
}
代码示例来源:origin: org.geomajas/geomajas-client-gwt2-example-base
public void setTitle(String title) {
Element h2 = DOM.createElement("h2");
h2.setInnerHTML(title);
h2.getStyle().setMarginBottom(5, Style.Unit.PX);
h2.getStyle().setMarginLeft(15, Style.Unit.PX);
h2.getStyle().setPaddingTop(5, Style.Unit.PX);
descriptionElement.getStyle().setPaddingTop(0, Style.Unit.PX);
descriptionElement.getParentElement().insertFirst(h2);
}
代码示例来源: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: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
public void setCaption(String caption) {
final MatchResult localisedPropertyMatcher = localisedPropertyCaptionPattern.exec(caption);
if (localisedPropertyMatcher != null && localisedPropertyMatcher.getGroupCount() > 2) {
caption = localisedPropertyMatcher.getGroup(1);
label.setInnerText(caption);
final Element localeLabel = SpanElement.as(DOM.createSpan());
localeLabel.setClassName("locale-label");
localeLabel.setInnerText(localisedPropertyMatcher.getGroup(2));
if (requirementAsterisk != null && label.isOrHasChild(requirementAsterisk)) {
label.insertAfter(localeLabel, requirementAsterisk);
} else {
label.insertFirst(localeLabel);
}
} else {
label.setInnerText(caption);
}
if (caption != null) {
label.setTitle(caption);
}
}
内容来源于网络,如有侵权,请联系作者删除!