当前位置: 首页>>代码示例>>Java>>正文


Java Element.setInnerHTML方法代码示例

本文整理汇总了Java中com.google.gwt.dom.client.Element.setInnerHTML方法的典型用法代码示例。如果您正苦于以下问题:Java Element.setInnerHTML方法的具体用法?Java Element.setInnerHTML怎么用?Java Element.setInnerHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.dom.client.Element的用法示例。


在下文中一共展示了Element.setInnerHTML方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSubmitCompleteHandler

import com.google.gwt.dom.client.Element; //导入方法依赖的package包/类
private SubmitCompleteHandler getSubmitCompleteHandler() {
	return new SubmitCompleteHandler() {
		public void onSubmitComplete(final SubmitCompleteEvent event) {

			final Element label = DOM.createLabel();
			label.setInnerHTML(event.getResults());

			final String csvData = label.getInnerText();
			if (hasError(csvData)) {
				showAlert("Error: " + csvData);
			} else {
				parseCsvData(csvData);
				autoMessageBox.hide();
			}
		}

		private boolean hasError(final String contentFile) {
			return contentFile.startsWith("413")
					|| contentFile.startsWith("500");
		}
	};
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:23,代码来源:JoinDataTool.java

示例2: createTimeBar

import com.google.gwt.dom.client.Element; //导入方法依赖的package包/类
private void createTimeBar(boolean format24h) {
    setStylePrimaryName("v-calendar-times");

    // Fist "time" is empty
    Element e = DOM.createDiv();
    setStyleName(e, "v-calendar-time");
    e.setInnerText("");
    getElement().appendChild(e);

    DateTimeService dts = new DateTimeService();

    if (format24h) {
        for (int i = firstHour + 1; i <= lastHour; i++) {
            e = DOM.createDiv();
            setStyleName(e, "v-calendar-time");
            String delimiter = dts.getClockDelimeter();
            e.setInnerHTML("<span>" + i + "</span>" + delimiter + "00");
            getElement().appendChild(e);
        }
    } else {
        // FIXME Use dts.getAmPmStrings(); and make sure that
        // DateTimeService has a some Locale set.
        String[] ampm = new String[] { "AM", "PM" };

        int amStop = (lastHour < 11) ? lastHour : 11;
        int pmStart = (firstHour > 11) ? firstHour % 11 : 0;

        if (firstHour < 12) {
            for (int i = firstHour + 1; i <= amStop; i++) {
                e = DOM.createDiv();
                setStyleName(e, "v-calendar-time");
                e.setInnerHTML("<span>" + timesFor12h[i] + "</span>"
                        + " " + ampm[0]);
                getElement().appendChild(e);
            }
        }

        if (lastHour > 11) {
            for (int i = pmStart; i < lastHour - 11; i++) {
                e = DOM.createDiv();
                setStyleName(e, "v-calendar-time");
                e.setInnerHTML("<span>" + timesFor12h[i] + "</span>"
                        + " " + ampm[1]);
                getElement().appendChild(e);
            }
        }
    }
}
 
开发者ID:blackbluegl,项目名称:calendar-component,代码行数:49,代码来源:WeekGrid.java

示例3: isBorked

import com.google.gwt.dom.client.Element; //导入方法依赖的package包/类
private static boolean isBorked() {
  Element e = Document.get().createDivElement();
  e.setInnerHTML("string");
  return e.getInnerHTML().length() == 0;
}
 
开发者ID:tbroyer,项目名称:gwt-history,代码行数:6,代码来源:HistoryTest.java


注:本文中的com.google.gwt.dom.client.Element.setInnerHTML方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。