當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。