本文整理了Java中com.google.gwt.dom.client.Element.appendChild()
方法的一些代码示例,展示了Element.appendChild()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.appendChild()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:appendChild
暂无
代码示例来源:origin: libgdx/libgdx
panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
element.appendChild(panel.getElement());
root = panel;
代码示例来源:origin: libgdx/libgdx
panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
element.appendChild(panel.getElement());
root = panel;
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Appends one element to another's list of children.
* <p>
* If the child element is a {@link com.google.gwt.user.client.ui.PotentialElement}, it is first
* resolved.
* </p>
*
* @param parent the parent element
* @param child its new child
* @see com.google.gwt.user.client.ui.PotentialElement#resolve(Element)
*/
public static void appendChild(Element parent, Element child) {
assert !isPotential(parent) : "Cannot append to a PotentialElement";
// If child isn't a PotentialElement, resolve() returns
// the Element itself.
parent.appendChild(resolve(child));
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public void initParent(Element parent) {
parent.getStyle().setPosition(Position.RELATIVE);
parent.appendChild(relativeRuler = createRuler(EM, EX));
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Creates an empty scroll panel.
*/
public ScrollPanel() {
this.scrollableElem = getElement();
this.containerElem = Document.get().createDivElement();
scrollableElem.appendChild(containerElem);
initialize();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
void addCells(Element tbody, int row, int num) {
com.google.gwt.dom.client.Element rowElem = impl.getRows(tbody).get(row);
for (int i = 0; i < num; i++) {
TableCellElement tdElement = Document.get().createTDElement();
rowElem.appendChild(tdElement);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Start a child element.
*
* @param element the element to start
* @param builder the builder used to builder the new element
*/
private void start(Element element, ElementBuilderBase<?> builder) {
onStart(element.getTagName(), builder);
// Set the root element.
if (rootElement == null) {
// This is the new root element.
rootElement = element;
} else {
// Appending to the current element.
getCurrentElement().appendChild(element);
}
// Add the element to the stack.
currentElement = element;
}
代码示例来源: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
/**
* Resize the column group element.
*
* @param columns the number of columns
* @param growOnly true to only grow, false to shrink if needed
*/
void resizeColumnGroup(int columns, boolean growOnly) {
// The colgroup should always have at least one element. See
// prepareColumnGroup() for more details.
columns = Math.max(columns, 1);
int num = columnGroup.getChildCount();
if (num < columns) {
for (int i = num; i < columns; i++) {
columnGroup.appendChild(Document.get().createColElement());
}
} else if (!growOnly && num > columns) {
for (int i = num; i > columns; i--) {
columnGroup.removeChild(columnGroup.getLastChild());
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Add a widget to the panel in the specified container. Note that this method
* does not do the logical attach.
*
* @param w the widget to add
* @param toReplace the widget to replace
* @param container the container in which to place the widget
*/
private void add(Widget w, Widget toReplace, Element container) {
// Validate.
if (w == toReplace) {
return;
}
// Detach new child.
if (w != null) {
w.removeFromParent();
}
// Remove old child.
if (toReplace != null) {
remove(toReplace);
}
if (w != null) {
// Physical attach.
container.appendChild(w.getElement());
container.getStyle().clearDisplay();
adopt(w);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Ensure that the content container exists and return it.
*
* @return the content container
*/
Element ensureContentContainer() {
if (contentContainer == null) {
contentContainer = Document.get().createDivElement();
ensureAnimationFrame().appendChild(contentContainer);
emptyMessageElem = Document.get().createDivElement();
emptyMessageElem.setInnerText(messages.emptyTree());
setStyleName(emptyMessageElem, tree.getStyle().cellTreeEmptyMessage(), true);
showOrHide(emptyMessageElem, false);
contentContainer.appendChild(emptyMessageElem);
showMoreElem = Document.get().createAnchorElement();
// CellTree prevents strict-CSP violation by cancelling event default action.
showMoreElem.setHref("javascript:;");
showMoreElem.setInnerText(messages.showMore());
setStyleName(showMoreElem, tree.getStyle().cellTreeShowMoreButton(), true);
showOrHide(showMoreElem, false);
contentContainer.appendChild(showMoreElem);
}
return contentContainer;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
childContainer.appendChild(item.getElement());
} else {
Element beforeElem = getChild(beforeIndex).getElement();
代码示例来源:origin: com.google.gwt/gwt-servlet
public HeaderPanel() {
// Create the outer element
Element elem = Document.get().createDivElement().cast();
elem.getStyle().setPosition(Position.RELATIVE);
elem.getStyle().setOverflow(Overflow.HIDDEN);
setElement(elem);
// Create a delegate to handle resize from the header and footer.
ResizeLayoutPanel.Impl.Delegate resizeDelegate = new ResizeLayoutPanel.Impl.Delegate() {
public void onResize() {
scheduledLayout();
}
};
// Create the header container.
headerContainer = createContainer();
headerContainer.getStyle().setTop(0.0, Unit.PX);
headerImpl.init(headerContainer, resizeDelegate);
elem.appendChild(headerContainer);
// Create the footer container.
footerContainer = createContainer();
footerContainer.getStyle().setBottom(0.0, Unit.PX);
footerImpl.init(footerContainer, resizeDelegate);
elem.appendChild(footerContainer);
// Create the content container.
contentContainer = createContainer();
contentContainer.getStyle().setOverflow(Overflow.HIDDEN);
contentContainer.getStyle().setTop(0.0, Unit.PX);
contentContainer.getStyle().setHeight(0.0, Unit.PX);
elem.appendChild(contentContainer);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
if (toReplace == null) {
childContainer.appendChild(newChildren.getChild(0));
} else {
Element nextSibling = toReplace.getNextSiblingElement();
代码示例来源:origin: com.google.gwt/gwt-servlet
hiddenDiv.appendChild(element);
wrapInitializationCallback.execute();
element.getParentNode().removeChild(element);
代码示例来源:origin: com.google.gwt/gwt-servlet
expandable.getStyle().setOverflow(Overflow.SCROLL);
expandable.getStyle().setZIndex(-1);
elem.appendChild(expandable);
expandableInner = Document.get().createDivElement().cast();
expandable.appendChild(expandableInner);
DOM.sinkEvents(expandable, Event.ONSCROLL);
collapsible.getStyle().setOverflow(Overflow.SCROLL);
collapsible.getStyle().setZIndex(-1);
elem.appendChild(collapsible);
collapsibleInner = Document.get().createDivElement().cast();
collapsibleInner.getStyle().setWidth(200, Unit.PCT);
collapsibleInner.getStyle().setHeight(200, Unit.PCT);
collapsible.appendChild(collapsibleInner);
DOM.sinkEvents(collapsible, Event.ONSCROLL);
代码示例来源:origin: com.google.gwt/gwt-servlet
hiddenDiv.appendChild(getElement());
代码示例来源:origin: com.google.gwt/gwt-servlet
scrollable.appendChild(containerElem);
scrollableLayer = layout.attachChild(scrollable);
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Recalculate the height and width of a native scrollbar.
*/
private static void maybeRecalculateNativeScrollbarSize() {
// Check if the size has already been calculated.
if (nativeHeight > -1) {
return;
}
// Create a scrollable element and attach it to the body.
Element scrollable = Document.get().createDivElement();
scrollable.getStyle().setPosition(Position.ABSOLUTE);
scrollable.getStyle().setTop(-1000.0, Unit.PX);
scrollable.getStyle().setLeft(-1000.0, Unit.PX);
scrollable.getStyle().setHeight(100.0, Unit.PX);
scrollable.getStyle().setWidth(100.0, Unit.PX);
scrollable.getStyle().setOverflow(Overflow.SCROLL);
scrollable.getStyle().setProperty("direction", "rtl");
Document.get().getBody().appendChild(scrollable);
// Add some content.
Element content = Document.get().createDivElement();
content.setInnerText("content");
scrollable.appendChild(content);
// Measure the height and width.
nativeHeight = scrollable.getOffsetHeight() - scrollable.getClientHeight();
nativeWidth = scrollable.getOffsetWidth() - scrollable.getClientWidth();
nativeRtl = (content.getAbsoluteLeft() > scrollable.getAbsoluteLeft());
// Detach the scrollable element.
scrollable.removeFromParent();
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
private void cloneAndAppendRow(VScrollTableRow row) {
Element clonedTR = null;
clonedTR = row.getElement().cloneNode(true).cast();
clonedTR.getStyle().setVisibility(Visibility.VISIBLE);
cloneTable.appendChild(clonedTR);
}
内容来源于网络,如有侵权,请联系作者删除!