本文整理汇总了Java中com.google.gwt.dom.client.HeadElement.appendChild方法的典型用法代码示例。如果您正苦于以下问题:Java HeadElement.appendChild方法的具体用法?Java HeadElement.appendChild怎么用?Java HeadElement.appendChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.dom.client.HeadElement
的用法示例。
在下文中一共展示了HeadElement.appendChild方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import com.google.gwt.dom.client.HeadElement; //导入方法依赖的package包/类
public static void load(Chronoscope.URLResolver resolver, final String libName,
final String version, final Command callback) {
if (!injectedLoader) {
final ScriptElement se = Document.get().createScriptElement();
// se.setSrc(intrinsics.getCachedUrl("http://www.google.com/jsapi?callback=" + JSAPI_CALLBACK));
se.setSrc("http://www.google.com/jsapi?callback=" + JSAPI_CALLBACK);
final HeadElement he = HeadElement.as(Document.get().getElementsByTagName("head").getItem(0));
exportHandler(new Command() {
public void execute() {
injectedLoader=true;
he.removeChild(se);
nativeLoad(libName, version, callback);
}
});
he.appendChild(se);
} else {
nativeLoad(libName, version, callback);
}
}
示例2: setMultiRowDragDecoration
import com.google.gwt.dom.client.HeadElement; //导入方法依赖的package包/类
/**
* Styles a multi-row selection with the number of elements.
*
* @param drag
* the current drag event holding the context.
*/
void setMultiRowDragDecoration(VDragEvent drag) {
Widget widget = drag.getTransferable().getDragSource().getWidget();
if (widget instanceof VScrollTable) {
VScrollTable table = (VScrollTable) widget;
int rowCount = table.selectedRowKeys.size();
Element dragCountElement = Document.get().getElementById(SP_DRAG_COUNT);
if (rowCount > 1 && table.selectedRowKeys.contains(table.focusedRow.getKey())) {
if (dragCountElement == null) {
dragCountElement = Document.get().createStyleElement();
dragCountElement.setId(SP_DRAG_COUNT);
HeadElement head = HeadElement.as(Document.get().getElementsByTagName(HeadElement.TAG).getItem(0));
head.appendChild(dragCountElement);
}
SafeHtml formattedCssStyle = getDraggableTemplate().multiSelectionStyle(determineActiveTheme(drag),
String.valueOf(rowCount));
StyleElement dragCountStyleElement = StyleElement.as(dragCountElement);
dragCountStyleElement.setInnerSafeHtml(formattedCssStyle);
} else if (dragCountElement != null) {
dragCountElement.removeFromParent();
}
}
}
示例3: onModuleLoad
import com.google.gwt.dom.client.HeadElement; //导入方法依赖的package包/类
public void onModuleLoad() {
final String linkTxt = Resources.INSTANCE.linkTxt().getText();
final Document document = Document.get();
HeadElement headElement = document.getHead();
if (headElement == null) {
headElement = document.createHeadElement();
document.appendChild(headElement);
}
LinkElement linkElement = document.createLinkElement();
linkElement.setType("text/css");
linkElement.setRel("stylesheet");
linkElement.setHref(linkTxt);
headElement.appendChild(linkElement);
}
示例4: injectStyleSheet
import com.google.gwt.dom.client.HeadElement; //导入方法依赖的package包/类
public static void injectStyleSheet(String href, String id) {
HeadElement head = getHead();
LinkElement element = createLinkElement();
element.setHref(href);
element.setId(id);
head.appendChild(element);
}
示例5: inject
import com.google.gwt.dom.client.HeadElement; //导入方法依赖的package包/类
public static void inject(String javascript) {
HeadElement head = getHead();
new Timer() {
public void run() {
// goJsPlumb();
goJS();
}
}.schedule(1);
ScriptElement element = createScriptElement();
element.setText(javascript);
head.appendChild(element);
}
示例6: intject
import com.google.gwt.dom.client.HeadElement; //导入方法依赖的package包/类
public static void intject(String javaScript) {
HeadElement head = getHead();
ScriptElement element = createScriptElement();
element.setText(javaScript);
head.appendChild(element);
}
示例7: inject
import com.google.gwt.dom.client.HeadElement; //导入方法依赖的package包/类
public static void inject(String javascript) {
HeadElement head = getHead();
ScriptElement element = createScriptElement();
element.setText(javascript);
head.appendChild(element);
}
示例8: injectStyleSheet
import com.google.gwt.dom.client.HeadElement; //导入方法依赖的package包/类
/**
* Injects the css url code into a
* {@code <link rel="stylesheet" href="...." />} element in the document
* header.
*
* @param javascript
* the JavaScript code
*/
public static void injectStyleSheet(String href) {
HeadElement head = getHead();
LinkElement element = createLinkElement();
element.setHref(href);
head.appendChild(element);
}