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


Java DivElement.setInnerHTML方法代码示例

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


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

示例1: appendEntry

import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
/**
 * Appends an entry to the log panel.
 * @param formatted
 * @param level
 */
public static void appendEntry(String formatted, Level level) {
  DivElement entry = Document.get().createDivElement();
  entry.setClassName(RESOURCES.css().entry());
  entry.setInnerHTML(formatted);

  // Add the style name associated with the log level.
  switch (level) {
    case ERROR:
      entry.addClassName(RESOURCES.css().error());
      break;
    case FATAL:
      entry.addClassName(RESOURCES.css().fatal());
      break;
    case TRACE:
      entry.addClassName(RESOURCES.css().trace());
      break;
  }

  // Make fatals detectable by WebDriver, so that tests can early out on
  // failure:
  if (level.equals(Level.FATAL)) {
    latestFatalError = formatted;
  }
  writeOrCacheOutput(entry);
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:31,代码来源:DomLogger.java

示例2: appendToDocument

import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
private void appendToDocument(HTML target, PluginContext pluginContext, CajolerResponse response) {
  DivElement domitaVdocElement = Document.get().createDivElement();
  domitaVdocElement.setClassName("innerHull");

  target.getElement().setInnerHTML("");
  target.getElement().setClassName("outerHull");
  target.getElement().appendChild(domitaVdocElement);

  initializeDoodadEnvironment(
      cajaFrame, domitaVdocElement, pluginContext.getJSOInterface());

  // Render HTML
  domitaVdocElement.setInnerHTML(response.getHtml());

  // Inject JS
  Document cajaFrameDoc = cajaFrame.getContentDocument();
  cajaFrameDoc.getBody().appendChild(cajaFrameDoc.createScriptElement(response.getJs()));
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:19,代码来源:CajolerFacade.java

示例3: ItemWidget

import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
ItemWidget(MenuItem item) {
  this.item = item;

  addStyleName(resources.css().popupItem());

  final Element itemLabel = Document.get().createDivElement();
  itemLabel.setInnerText(item.getName());
  itemLabel.getStyle().setFloat(Style.Float.LEFT);

  getElement().appendChild(itemLabel);

  if (dataProvider.isGroup(item)) {
    DivElement arrow = Document.get().createDivElement();
    arrow.setInnerHTML(FontAwesome.PLAY);
    arrow.addClassName(resources.css().arrow());
    getElement().appendChild(arrow);
  }

  attachEventHandlers();
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:ItemsList.java

示例4: Form

import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
public Form()
{
	snip.addElement( "DATABINDING" );
	snip.addElement( "PERSISTENCE" );
	
	DivElement main = Document.get().createDivElement();
	
	main.setInnerHTML( snip.getSnip() );
	
	addDomHandler( new ClickHandler()
	{
		@Override
		public void onClick( ClickEvent event )
		{
			if( event.getNativeEvent().getEventTarget() == dataBinding.cast() )
				Window.alert( "Data Binding !" );
			if( event.getNativeEvent().getEventTarget() == persistence.cast() )
				Window.alert( "Persistence !" );
		}
	}, ClickEvent.getType() );
}
 
开发者ID:ltearno,项目名称:hexa.tools,代码行数:22,代码来源:HexaDemo.java

示例5: updateFontDimensions

import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
private void updateFontDimensions() {

		// Test element for font size
		DivElement test = Document.get().createDivElement();
		test.setAttribute("style", "position: absolute;");
		test.setInnerHTML("X");
		term.appendChild(test);

		fontW = test.getClientWidth();
		fontH = test.getClientHeight();
		if (fontW <= 0 || fontW > 100) {
			fontW = test.getOffsetWidth();
		}
		if (fontH <= 0 || fontH > 100) {
			fontH = test.getOffsetHeight();
		}
		if (fontW <= 0 || fontW > 100) {
			fontW = 1;
		}
		if (fontH <= 0 || fontH > 100) {
			fontH = 1;
		}
		term.removeChild(test);
	}
 
开发者ID:indvd00m,项目名称:vaadin7-console-addon,代码行数:25,代码来源:TextConsole.java

示例6: setCaption

import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
public final boolean setCaption(String caption, Icon icon,
        String captionStyleName) {
    DivElement captionElement = getFirstChildElement().cast();

    boolean hasIcon = icon != null;
    boolean needsCaption = hasIcon
            || (caption != null && !caption.isEmpty());

    if (needsCaption) {
        String captionHtml = hasIcon ? icon.getElement().getString()
                : "";
        captionHtml += caption == null ? "" : caption;
        captionElement.setInnerHTML(captionHtml);
        captionElement.getStyle().setProperty("display", null);
        // copy v-caption prefixed styles from widget to caption
        captionElement.setClassName(captionStyleName);
        setClassName(ROW_CLASSNAME + " " + ROW_WITH_CAPTION_STYLENAME);
    } else {
        setClassName(ROW_CLASSNAME + " "
                + ROW_WITHOUT_CAPTION_STYLENAME);
    }
    return needsCaption;
}
 
开发者ID:vaadin,项目名称:touchkit,代码行数:24,代码来源:VerticalComponentGroupWidget.java

示例7: appendLogLine

import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
private void appendLogLine(String line) {
  DivElement element = Document.get().createDivElement();
  element.setInnerHTML(line);
  element.getStyle().setProperty("borderBottomStyle", "dotted");
  element.getStyle().setBorderWidth(1, Unit.PX);
  element.getStyle().setBorderColor("#c0c0c0");
  logContainer.appendChild(element);
  lastElement = element;
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:10,代码来源:DebugDialog.java

示例8: print

import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
public void print(String j,int calc, PrayTime p, double latitude,double longitude, int day){
	Element sub = DOM.getElementById("prayer-times-"+j+"-" + day);
	if(sub != null){
		String[] dateTitle = p.getMonthInfo(day);
		sub.removeAllChildren();
		Document doc = Document.get();
		DivElement l = doc.createDivElement();
		l.setAttribute("class", "timeslot__label g-color-slate-grey js-timeslot-label js-sticky-element fixed");
		l.setAttribute("style", "position: absolute; top: 0px; width: 100px; height: 100px; overflow: hidden; display: block; z-index: 1000; -webkit-transform: translate3d(0px, 0px, 0px); left: 0px;");
		l.setInnerHTML(dateTitle[0] +"<span>"+dateTitle[1]+"</span>");
		sub.appendChild(l);
		DivElement l1 = doc.createDivElement();
		l1.setAttribute("class", "event__content -quran");
		l1.setAttribute("id", "prayer-times-2");
		String html = p.print(latitude, longitude, title, day);
		l1.setInnerHTML(html);
		sub.appendChild(l1);
		//<span  class="video-card__speakers g-light-grey" style="position:relative; bottom:0; right:0; font-size:10px;">Shafii,ISNA</span>
		SpanElement l2 = doc.createSpanElement();
		l2.setAttribute("class", "video-card__speakers g-light-grey");
		l2.setAttribute("style", "position:relative; bottom:0; right:0; font-size:10px;");
		l2.setInnerText(createSubText(j, calc));
		sub.appendChild(l2);
		if(j.equals("Shafii") && calc == 0){
			//updateDescription(html);
		}
	}
}
 
开发者ID:arscyper,项目名称:adan,代码行数:29,代码来源:Schedule.java

示例9: createContentFromGMWindow

import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
DivElement createContentFromGMWindow(GoogleMapInfoWindow gmWindow) {
    String content = gmWindow.getContent();

    // wrap the contents inside a div if there's a defined width or
    // height
    if (gmWindow.getHeight() != null
            || gmWindow.getWidth() != null) {
        StringBuffer contentWrapper = new StringBuffer(
                "<div style=\"");
        if (gmWindow.getWidth() != null) {
            contentWrapper.append("width:");
            contentWrapper.append(gmWindow.getWidth());
            contentWrapper.append(";");
        }
        if (gmWindow.getHeight() != null) {
            contentWrapper.append("height:");
            contentWrapper.append(gmWindow.getHeight());
            contentWrapper.append(";");
        }
        contentWrapper.append("\" >");
        contentWrapper.append(content);
        contentWrapper.append("</div>");
        content = contentWrapper.toString();
    }

    DivElement div = Document.get().createDivElement();
    div.setInnerHTML(content);
    return div;
}
 
开发者ID:tapioaali,项目名称:GoogleMapsVaadin7,代码行数:30,代码来源:GoogleMapWidget.java

示例10: updatePreview

import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
private void updatePreview () {
	pnlPreview.getElement().removeAllChildren();

	Document d = Document.get();
	HeadingElement title = d.createHElement(1);

	title.setInnerHTML(PostHelper.makeHeading(txtTitle.getValue()));
	pnlPreview.getElement().appendChild(title);

	User user = SessionController.get().user();

	DivElement elDate = d.createDivElement();
	if (post != null) {
		if (post.published == null) {
			elDate.setInnerSafeHtml(PostSummaryCell.Templates.INSTANCE
					.notPublished(DateTimeHelper.ago(post.created)));
		} else {
			elDate.setInnerSafeHtml(PostSummaryCell.Templates.INSTANCE
					.publishedDate(DateTimeHelper.ago(post.published)));
		}
	} else {
		elDate.setInnerSafeHtml(PostSummaryCell.Templates.INSTANCE
				.notPublished(DateTimeHelper.ago(new Date())));
	}

	pnlPreview.getElement().appendChild(elDate);

	DivElement elAuthor = d.createDivElement();
	if (PropertyController.get()
			.booleanProperty(PropertyHelper.POST_SHOW_AUTHOR, false)) {
		elAuthor.setInnerSafeHtml(PostSummaryCell.Templates.INSTANCE.author(
				UriUtils.fromString(
						(post != null ? post.author.avatar : user.avatar)
								+ "?s=" + UserHelper.AVATAR_HEADER_SIZE
								+ "&default=retro"),
				UserHelper.handle((post != null ? post.author : user))));
	}

	pnlPreview.getElement().appendChild(elAuthor);

	tagList.getList().clear();
	List<String> tags = TagHelper.convertToTagList(txtTags.getValue());
	if (tags != null) {
		for (String tag : tags) {
			tagList.getList().add(new Tag().name(tag));
		}
	}

	DivElement summary = d.createDivElement();
	summary.setInnerHTML(markup(txtSummary));
	pnlPreview.getElement().appendChild(summary);

	DivElement content = d.createDivElement();
	content.setInnerHTML(markup(txtContent));
	pnlPreview.getElement().appendChild(content);
}
 
开发者ID:billy1380,项目名称:blogwt,代码行数:57,代码来源:EditPostPage.java


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