當前位置: 首頁>>代碼示例>>Java>>正文


Java Element.appendChild方法代碼示例

本文整理匯總了Java中com.google.gwt.dom.client.Element.appendChild方法的典型用法代碼示例。如果您正苦於以下問題:Java Element.appendChild方法的具體用法?Java Element.appendChild怎麽用?Java Element.appendChild使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.dom.client.Element的用法示例。


在下文中一共展示了Element.appendChild方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getConfig

import com.google.gwt.dom.client.Element; //導入方法依賴的package包/類
@Override
public GwtApplicationConfiguration getConfig() {
    GwtApplicationConfiguration config = new GwtApplicationConfiguration(WIDTH, HEIGHT);

    Element element = Document.get().getElementById("embed-html");
    VerticalPanel panel = new VerticalPanel();
    panel.setWidth("100%");
    panel.setHeight("100%");
    panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    element.appendChild(panel.getElement());
    config.rootPanel = panel;
    config.width = 2000;
    config.height = 2000;

    return config;
}
 
開發者ID:Anuken,項目名稱:Mindustry,代碼行數:18,代碼來源:HtmlLauncher.java

示例2: print

import com.google.gwt.dom.client.Element; //導入方法依賴的package包/類
protected void print() {
	final DataTable table = new DataTable(iLastResponse);
	Element headerRow = table.getRowFormatter().getElement(0);
	Element tableElement = table.getElement();
	Element thead = DOM.createTHead();
	tableElement.insertFirst(thead);
	headerRow.getParentElement().removeChild(headerRow);
	thead.appendChild(headerRow);
	Page page = new Page() {
		@Override
		public String getName() {
			return MESSAGES.sectNotAssignedClasses();
		}
		@Override
		public String getUser() {
			return "";
		}
		@Override
		public String getSession() {
			return "";
		}
		@Override
		public Element getBody() {
			return table.getElement();
		}
	};
	ToolBox.print(page);
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:29,代碼來源:NotAssignedClassesPage.java

示例3: print

import com.google.gwt.dom.client.Element; //導入方法依賴的package包/類
protected void print() {
	final DataTable table = new DataTable(iLastResponse);
	Element headerRow = table.getRowFormatter().getElement(0);
	Element tableElement = table.getElement();
	Element thead = DOM.createTHead();
	tableElement.insertFirst(thead);
	headerRow.getParentElement().removeChild(headerRow);
	thead.appendChild(headerRow);
	Page page = new Page() {
		@Override
		public String getName() {
			return MESSAGES.sectAssignedClasses();
		}
		@Override
		public String getUser() {
			return "";
		}
		@Override
		public String getSession() {
			return "";
		}
		@Override
		public Element getBody() {
			return table.getElement();
		}
	};
	ToolBox.print(page);
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:29,代碼來源:AssignedClassesPage.java

示例4: createChildDiv_withId

import com.google.gwt.dom.client.Element; //導入方法依賴的package包/類
private DivElement createChildDiv_withId(Document document, Element parent, String nameId) {
	DivElement result = createDiv_withId(document, nameId);
	parent.appendChild(result);

	return result;
}
 
開發者ID:WhitesteinTechnologies,項目名稱:wt-pdf-viewer,代碼行數:7,代碼來源:WTPdfViewerWidget.java

示例5: createChildDiv

import com.google.gwt.dom.client.Element; //導入方法依賴的package包/類
private DivElement createChildDiv(Document document, Element parent, String nameId) {
	DivElement result = createDiv(document, nameId);
	parent.appendChild(result);

	return result;
}
 
開發者ID:WhitesteinTechnologies,項目名稱:wt-pdf-viewer,代碼行數:7,代碼來源:WTPdfViewerWidget.java

示例6: createChildButton

import com.google.gwt.dom.client.Element; //導入方法依賴的package包/類
private ButtonElement createChildButton(Document document, Element parent, String nameId) {
	ButtonElement result = createButton(document, nameId);
	parent.appendChild(result);

	return result;
}
 
開發者ID:WhitesteinTechnologies,項目名稱:wt-pdf-viewer,代碼行數:7,代碼來源:WTPdfViewerWidget.java

示例7: createChildInput

import com.google.gwt.dom.client.Element; //導入方法依賴的package包/類
private InputElement createChildInput(Document document, Element parent, String nameId) {
	InputElement result = createInput(document, nameId);
	parent.appendChild(result);

	return result;
}
 
開發者ID:WhitesteinTechnologies,項目名稱:wt-pdf-viewer,代碼行數:7,代碼來源:WTPdfViewerWidget.java

示例8: createChildNumber

import com.google.gwt.dom.client.Element; //導入方法依賴的package包/類
private InputElement createChildNumber(Document document, Element parent, String nameId) {
	InputElement result = createNumber(document, nameId);
	parent.appendChild(result);

	return result;
}
 
開發者ID:WhitesteinTechnologies,項目名稱:wt-pdf-viewer,代碼行數:7,代碼來源:WTPdfViewerWidget.java

示例9: createChildCheckbox

import com.google.gwt.dom.client.Element; //導入方法依賴的package包/類
private InputElement createChildCheckbox(Document document, Element parent, String nameId) {
	InputElement result = createCheckbox(document, nameId);
	parent.appendChild(result);

	return result;
}
 
開發者ID:WhitesteinTechnologies,項目名稱:wt-pdf-viewer,代碼行數:7,代碼來源:WTPdfViewerWidget.java

示例10: createChildLabel

import com.google.gwt.dom.client.Element; //導入方法依賴的package包/類
private LabelElement createChildLabel(Document document, Element parent, String nameId) {
	LabelElement result = createLabel(document, nameId);
	parent.appendChild(result);

	return result;
}
 
開發者ID:WhitesteinTechnologies,項目名稱:wt-pdf-viewer,代碼行數:7,代碼來源:WTPdfViewerWidget.java

示例11: createChildProgress

import com.google.gwt.dom.client.Element; //導入方法依賴的package包/類
private Element createChildProgress(Document document, Element parent, int value, int max) {
	Element result = createProgress(document, value, max);
	parent.appendChild(result);

	return result;
}
 
開發者ID:WhitesteinTechnologies,項目名稱:wt-pdf-viewer,代碼行數:7,代碼來源:WTPdfViewerWidget.java

示例12: createChildP

import com.google.gwt.dom.client.Element; //導入方法依賴的package包/類
private ParagraphElement createChildP(Document document, Element parent) {
	ParagraphElement result = createP(document);
	parent.appendChild(result);

	return result;
}
 
開發者ID:WhitesteinTechnologies,項目名稱:wt-pdf-viewer,代碼行數:7,代碼來源:WTPdfViewerWidget.java

示例13: createChildSelect

import com.google.gwt.dom.client.Element; //導入方法依賴的package包/類
private SelectElement createChildSelect(Document document, Element parent, String nameId) {
	SelectElement result = createSelect(document, nameId);
	parent.appendChild(result);

	return result;
}
 
開發者ID:WhitesteinTechnologies,項目名稱:wt-pdf-viewer,代碼行數:7,代碼來源:WTPdfViewerWidget.java

示例14: getVerticalScrollbarWidth

import com.google.gwt.dom.client.Element; //導入方法依賴的package包/類
private static int getVerticalScrollbarWidth() {
  // We only calculate the vertical scroll bar width once, then we store it in the static field
  // verticalScrollbarWidth. If the field is non-zero, we don't need to calculate it again.
  if (verticalScrollbarWidth == 0) {
    // The following code will calculate (on the fly) the width of a vertical scroll bar.
    // We'll create two divs, one inside the other and add the outer div to the document body,
    // but off-screen where the user won't see it.
    // We'll measure the width of the inner div twice: (first) when the outer div's vertical
    // scrollbar is hidden and (second) when the outer div's vertical scrollbar is visible.
    // The width of inner div will be smaller when outer div's vertical scrollbar is visible.
    // By subtracting the two measurements, we can calculate the width of the vertical scrollbar.

    // I used code from the following websites as reference material:
    // http://jdsharp.us/jQuery/minute/calculate-scrollbar-width.php
    // http://www.fleegix.org/articles/2006-05-30-getting-the-scrollbar-width-in-pixels

    Document document = Document.get();

    // Create an outer div.
    DivElement outerDiv = document.createDivElement();
    Style outerDivStyle = outerDiv.getStyle();
    // Use absolute positioning and set the top/left so that it is off-screen.
    // We don't want the user to see anything while we do this calculation.
    outerDivStyle.setProperty("position", "absolute");
    outerDivStyle.setProperty("top", "-1000px");
    outerDivStyle.setProperty("left", "-1000px");
    // Set the width and height of the outer div to a fixed size in pixels.
    outerDivStyle.setProperty("width", "100px");
    outerDivStyle.setProperty("height", "50px");
    // Hide the outer div's scrollbar by setting the "overflow" property to "hidden".
    outerDivStyle.setProperty("overflow", "hidden");

    // Create an inner div and put it inside the outer div.
    DivElement innerDiv = document.createDivElement();
    Style innerDivStyle = innerDiv.getStyle();
    // Set the height of the inner div to be 4 times the height of the outer div so that a
    // vertical scrollbar will be necessary (but hidden for now) on the outer div.
    innerDivStyle.setProperty("height", "200px");
    outerDiv.appendChild(innerDiv);

    // Temporarily add the outer div to the document body. It's off-screen so the user won't
    // actually see anything.
    Element bodyElement = document.getElementsByTagName("body").getItem(0);
    bodyElement.appendChild(outerDiv);

    // Get the width of the inner div while the outer div's vertical scrollbar is hidden.
    int widthWithoutScrollbar = innerDiv.getOffsetWidth();
    // Show the outer div's vertical scrollbar by setting the "overflow" property to "auto".
    outerDivStyle.setProperty("overflow", "auto");
    // Now, get the width of the inner div while the vertical scrollbar is visible.
    int widthWithScrollbar = innerDiv.getOffsetWidth();

    // Remove the outer div from the document body.
    bodyElement.removeChild(outerDiv);

    // Calculate the width of the vertical scrollbar by subtracting the two widths.
    verticalScrollbarWidth = widthWithoutScrollbar - widthWithScrollbar;
  }

  return verticalScrollbarWidth;
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:62,代碼來源:MockForm.java

示例15: createChildSpan

import com.google.gwt.dom.client.Element; //導入方法依賴的package包/類
private SpanElement createChildSpan(Document document, Element parent, String nameId) {
	SpanElement result = createSpan(document, nameId);
	parent.appendChild(result);

	return result;
}
 
開發者ID:WhitesteinTechnologies,項目名稱:wt-pdf-viewer,代碼行數:7,代碼來源:WTPdfViewerWidget.java


注:本文中的com.google.gwt.dom.client.Element.appendChild方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。