本文整理汇总了Java中com.google.gwt.dom.client.HeadElement类的典型用法代码示例。如果您正苦于以下问题:Java HeadElement类的具体用法?Java HeadElement怎么用?Java HeadElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HeadElement类属于com.google.gwt.dom.client包,在下文中一共展示了HeadElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getHead
import com.google.gwt.dom.client.HeadElement; //导入依赖的package包/类
private HeadElement getHead() {
if(this.head == null) {
Element element = Document.get().getElementsByTagName(HEAD_TAG_NAME).getItem(0);
assert element != null : ERROR_HEAD_NOT_FOUND;
this.head = HeadElement.as(element);
}
return this.head;
}
示例5: getHead
import com.google.gwt.dom.client.HeadElement; //导入依赖的package包/类
private static HeadElement getHead() {
if (head == null) {
Element element = Document.get().getElementsByTagName("head").getItem(0);
assert element != null : "HTML Head element required";
head = HeadElement.as(element);
}
return head;
}
示例6: getHead
import com.google.gwt.dom.client.HeadElement; //导入依赖的package包/类
private static HeadElement getHead() {
if (head == null) {
Element element = Document.get().getElementsByTagName("head").getItem(0);
assert element != null : "HTML Head element required";
HeadElement headElement = HeadElement.as(element);
head = headElement;
}
return head;
}
示例7: getHead
import com.google.gwt.dom.client.HeadElement; //导入依赖的package包/类
/**
* Gets the head tag element.
*
* @return the head tag element
*/
protected HeadElement getHead() {
if (this.head == null) {
Element elt = Document.get().getElementsByTagName("head").getItem(0);
assert elt != null : "The host HTML page does not have a <head> element" + " which is required by this injector";
this.head = HeadElement.as(elt);
}
return this.head;
}
示例8: 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);
}
示例9: getHead
import com.google.gwt.dom.client.HeadElement; //导入依赖的package包/类
private static HeadElement getHead() {
if (head == null) {
Element element = Document.get().getElementsByTagName("head")
.getItem(0);
assert element != null : "HTML Head element required";
head = HeadElement.as(element);
}
return head;
}
示例10: 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);
}
示例11: getHead
import com.google.gwt.dom.client.HeadElement; //导入依赖的package包/类
private static HeadElement getHead() {
if (head == null) {
Element element = Document.get().getElementsByTagName("head").getItem(0);
assert element != null : "HTML Head element required";
HeadElement head = HeadElement.as(element);
ESBJavaScriptInjector.head = head;
}
return ESBJavaScriptInjector.head;
}
示例12: getHead
import com.google.gwt.dom.client.HeadElement; //导入依赖的package包/类
private static HeadElement getHead() {
if (head == null) {
Element element = Document.get().getElementsByTagName("head")
.getItem(0);
assert element != null : "HTML Head element required";
HeadElement head = HeadElement.as(element);
JSLibInjector.head = head;
}
return JSLibInjector.head;
}
示例13: getHead
import com.google.gwt.dom.client.HeadElement; //导入依赖的package包/类
private static HeadElement getHead() {
if (head == null) {
Element element = Document.get().getElementsByTagName("head").getItem(0);
assert element != null : "HTML Head element required";
HeadElement head = HeadElement.as(element);
PlusOne.head = head;
}
return PlusOne.head;
}
示例14: 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);
}
示例15: 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);
}