當前位置: 首頁>>代碼示例>>Java>>正文


Java HTML.setHTML方法代碼示例

本文整理匯總了Java中com.google.gwt.user.client.ui.HTML.setHTML方法的典型用法代碼示例。如果您正苦於以下問題:Java HTML.setHTML方法的具體用法?Java HTML.setHTML怎麽用?Java HTML.setHTML使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.user.client.ui.HTML的用法示例。


在下文中一共展示了HTML.setHTML方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initAppShare

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
/**
 * Helper method called by constructor to initialize the report section
 */
private void initAppShare() {
  final HTML sharePrompt = new HTML();
  sharePrompt.setHTML(MESSAGES.gallerySharePrompt());
  sharePrompt.addStyleName("primary-prompt");
  final TextBox urlText = new TextBox();
  urlText.addStyleName("action-textbox");
  urlText.setText(Window.Location.getHost() + MESSAGES.galleryGalleryIdAction() + app.getGalleryAppId());
  urlText.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      urlText.selectAll();
    }
  });
  appSharePanel.add(sharePrompt);
  appSharePanel.add(urlText);
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:20,代碼來源:GalleryPage.java

示例2: render

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
@Override
public void render(RendererCellReference cell, CellWrapper cellValue, HTML widget) {
	final int INTEND_IN_PIXELS = 19;
   	final String value=cellValue.getValue();
   	if(cellValue.hasChildren()) {
   		if(!widget.getElement().getClassName().contains("v-tree-grid-node")) {
   			widget.getElement().addClassName("v-tree-grid-node");
   		}
   		if(cellValue.isExpanded()){
   			widget.getElement().removeClassName("collapsed");
   			widget.getElement().addClassName("expanded");
   		}
   		else {
   			widget.getElement().removeClassName("expanded");
   			widget.getElement().addClassName("collapsed");
   		}
   	} else {
   		widget.getElement().removeClassName("v-tree-grid-node");
   		widget.getElement().removeClassName("collapsed");
   		widget.getElement().removeClassName("expanded");
   	}

	final int intend=INTEND_IN_PIXELS*cellValue.getLevel();
	widget.setHTML(value);
	widget.getElement().getStyle().setProperty("paddingLeft", intend+"px");
}
 
開發者ID:rogozinds,項目名稱:GridTree,代碼行數:27,代碼來源:TreeNodeExpandButtonRenderer.java

示例3: getEndPointDetails

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
private Widget getEndPointDetails(final String css, Date time,
		String address, final Wgs84LatLonBean position) {
	HTML line = new HTML();
	line.addStyleName("itinerary-details-line");
	line.addStyleName("itinerary-details-" + css);
	line.addStyleName(css + "-icon");
	String html = "<span class='time'>" + FormatUtils.formatTime(time)
			+ "</span> - " + FormatUtils.formatAddress(address);
	line.setHTML(html);
	final String infoHtml = "<div class='info-panel-" + css + " " + css
			+ "-icon'>" + html + "</div>";
	line.addMouseOverHandler(new MouseOverHandler() {

		@Override
		public void onMouseOver(MouseOverEvent event) {
			if (selected)
				listener.onItineraryStepClicked(infoHtml, position);
		}
	});
	return line;
}
 
開發者ID:mecatran,項目名稱:OpenTripPlanner-client-gwt,代碼行數:22,代碼來源:ItineraryDetailsWidget.java

示例4: redraw

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
@Override
public void redraw()
{
  m_tokenLastUpdate = GameEngine.game().getLastTokenUpdate().getTime();
  m_gameLastVersion = GameEngine.game().getVersion();
  // same game but something changed: redraw all visible layers.
  m_validLayersSet.clear();
  for( Map.Entry<EbTeam, HTML> entry : m_fireCoverLayers.entrySet() )
  {
    HTML layer = entry.getValue();
    if( layer.isVisible() )
    {
      layer.setHTML( getFireCoverHtml( (EbTeam)entry.getKey() ) );
      m_validLayersSet.add( (EbTeam)entry.getKey() );
    }
  }
}
 
開發者ID:kroc702,項目名稱:fullmetalgalaxy,代碼行數:18,代碼來源:WgtBoardLayerFireCover.java

示例5: setZoom

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
@Override
public void setZoom(EnuZoom p_zoom)
{
  super.setZoom( p_zoom );
  // redraw all visible layers.
  m_validLayersSet.clear();
  for( Map.Entry<EbTeam, HTML> entry : m_fireCoverLayers.entrySet() )
  {
    HTML layer = ((HTML)entry.getValue());
    if( layer.isVisible() )
    {
      layer.setHTML( getFireCoverHtml( (EbTeam)entry.getKey() ) );
      m_validLayersSet.add( (EbTeam)entry.getKey() );
    }
  }
}
 
開發者ID:kroc702,項目名稱:fullmetalgalaxy,代碼行數:17,代碼來源:WgtBoardLayerFireCover.java

示例6: NewURIFieldWidget

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public NewURIFieldWidget(AttributeValue v) {
	super(v.getLabel());
	this.value = v;
	if (value.getCtrl().isReadonly()) {
		HTML html = new HTML();
		if (!this.value.isNullValue()) {
			html.setHTML("<a href='javascript:;'>" + this.value.getStringValue() +"</a>");
		}
		html.addClickListener(new ClickListener() {

			public void onClick(Widget sender) {
				Window.open(value.getStringValue(), "_blank", "");
				
			}
			
		});
		
		html.setWordWrap(true);
		html.setTitle(this.value.getStringValue());
		addField(html);
		html.setStyleName("mdv-form-input-readonly");			
		setRequired(false);
		
	} else {
		box = new TextBox();
		box.setText(value.getStringValue());
		box.addKeyboardListener(this);
		setRequired(value.getCtrl().isRequiered());
		addField(box);
	}
	
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:33,代碼來源:NewURIFieldWidget.java

示例7: onRender

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
@Override
protected void onRender(Element parent, int index) {
	super.onRender(parent, index);
	HTML html = new HTML();
	// Hosted mode don't support applet loading....
	if (GWT.isScript()) {
		html.setHTML(getAppletTag());
	} else {
		html.setText(getAppletTag());
	}
	add(html);
	
	layout();
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:15,代碼來源:CMDBAppletWidget.java

示例8: updateHeaderTable

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
protected void updateHeaderTable(List<ColumnDefinition<TableData.Row, ?>> colDefs, boolean force) {

        if (!colDefs.equals(lastColDefs) || force) {
            lastColDefs = colDefs;
            int numColumns = colDefs.size();

            // clear the headers
            clearTable(headers, numColumns);

            // Add the column and group headers
            for (int i = 0; i < numColumns; i++) {
                // Add the name
                ColDef colDef = (ColDef) colDefs.get(i);

                if (colDef == null) continue;       // skip if colDef is null

                String title = colDef.isImmutable() ? "" : "<b>" + colDef.getTitle() + "</b>";
                HTML label = new HTML(title, false);
                label.setTitle(colDef.getShortDesc());
                label.setWidth("10px");
                DOM.setStyleAttribute(label.getElement(), "display", "inline");

                headers.setWidget(LABEL_IDX, i, label);
                setColumnWidth(i, colDef.getPreferredColumnWidth());
                headers.getFlexCellFormatter().setHorizontalAlignment(LABEL_IDX, i, HorizontalPanel.ALIGN_CENTER);

                if (isShowUnits()) {
                    String u =  colDef.getColumn() == null || StringUtils.isEmpty(colDef.getColumn().getUnits()) ? "&nbsp;" : "(" + colDef.getColumn().getUnits() + ")";
                    label.setHTML(label.getHTML() + "<br>" + u);
                }
                GwtUtil.setStyle(label, "display", "inline-table");
            }
            filterSupport.onUpdateHeaders(colDefs);
        }

        filterSupport.ensureFilterShow();

    }
 
開發者ID:lsst,項目名稱:firefly,代碼行數:39,代碼來源:BasicPagingTable.java

示例9: setMessageToHtml

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public static void setMessageToHtml(String message, ContentMode contentMode, HTML widget) {
    if(contentMode == ContentMode.HTML) {
        widget.setHTML(message);
    } else if(contentMode == ContentMode.PREFORMATTED) {
        PreElement preElement = Document.get().createPreElement();
        preElement.setInnerText(message);
        widget.setHTML(preElement.getString());
    } else {
        widget.setText(message);
    }
}
 
開發者ID:alump,項目名稱:IdleAlarm,代碼行數:12,代碼來源:IdleAlarmMessageUtil.java

示例10: initReportSection

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
/**
 * Helper method called by constructor to initialize the report section
 */
private void initReportSection() {
  final HTML reportPrompt = new HTML();
  reportPrompt.setHTML(MESSAGES.galleryReportPrompt());
  reportPrompt.addStyleName("primary-prompt");
  final TextArea reportText = new TextArea();
  reportText.addStyleName("action-textarea");
  final Button submitReport = new Button(MESSAGES.galleryReportButton());
  submitReport.addStyleName("action-button");
  final Label descriptionError = new Label();
  descriptionError.setText("Description required");
  descriptionError.setStyleName("ode-ErrorMessage");
  descriptionError.setVisible(false);
  appReportPanel.add(reportPrompt);
  appReportPanel.add(descriptionError);
  appReportPanel.add(reportText);
  appReportPanel.add(submitReport);

  final OdeAsyncCallback<Boolean> isReportdByUserCallback = new OdeAsyncCallback<Boolean>(
      // failure message
      MESSAGES.galleryError()) {
        @Override
        public void onSuccess(Boolean isAlreadyReported) {
          if(isAlreadyReported) { //already reported, cannot report again
            reportPrompt.setHTML(MESSAGES.galleryAlreadyReportedPrompt());
            reportText.setVisible(false);
            submitReport.setVisible(false);
            submitReport.setEnabled(false);
          } else {
            submitReport.addClickHandler(new ClickHandler() {
              public void onClick(ClickEvent event) {
                final OdeAsyncCallback<Long> reportClickCallback = new OdeAsyncCallback<Long>(
                    // failure message
                    MESSAGES.galleryError()) {
                      @Override
                      public void onSuccess(Long id) {
                        reportPrompt.setHTML(MESSAGES.galleryReportCompletionPrompt());
                        reportText.setVisible(false);
                        submitReport.setVisible(false);
                        submitReport.setEnabled(false);
                      }
                  };
                if (!reportText.getText().trim().isEmpty()){
                  Ode.getInstance().getGalleryService().addAppReport(app, reportText.getText(),
                    reportClickCallback);
                  descriptionError.setVisible(false);
                } else {
                  descriptionError.setVisible(true);
                }
              }
            });
          }
        }
    };
  Ode.getInstance().getGalleryService().isReportedByUser(app.getGalleryAppId(),
      isReportdByUserCallback);
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:60,代碼來源:GalleryPage.java

示例11: SetDialogContent

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public static void SetDialogContent(DialogBox dialog, String mess) {
  HTML html = (HTML) ((VerticalPanel) dialog.getWidget()).getWidget(0);
  html.setHTML(mess);
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:5,代碼來源:BlocklyPanel.java

示例12: render

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
@Override
public void render(RendererCellReference cell, String text, HTML button) {
	button.setHTML(text);
}
 
開發者ID:Koziolek,項目名稱:FontAwesomeRenderer,代碼行數:5,代碼來源:FontIconRenderer.java

示例13: ItineraryModeLineWidget

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public ItineraryModeLineWidget(ItineraryBean anItinerary) {
	itinerary = anItinerary;
	HorizontalPanel rootPanel = new HorizontalPanel();
	rootPanel.addStyleName("itinerary-modeline");
	// Display alerts (warn, crit) count summary
	int alertsCount = 0;
	for (AlertBean alert : anItinerary.getAlerts())
		if (alert.getLevel() >= AlertBean.LEVEL_WARN)
			alertsCount++;
	if (alertsCount > 0) {
		Label alertCountLabel = new Label("" + alertsCount);
		rootPanel.add(alertCountLabel);
		alertCountLabel.addStyleName("itinerary-alerts-count");
		alertCountLabel.addStyleName("warn-icon");
	}
	for (ItineraryLegBean leg : itinerary.getLegs()) {
		if (leg.getTravelType() == TravelType.ROAD) {
			ItineraryRoadLegBean roadLeg = leg.getAsRoadLeg();
			// Road mode icons
			Label roadLabel = new Label("");
			roadLabel.addStyleName("itinerary-modeline-road-icon");
			roadLabel.addStyleName(
					FormatUtils.getCssClassNameFromTransportMode(
							roadLeg.getMode()) + "-icon");
			rootPanel.add(roadLabel);
		} else if (leg.getTravelType() == TravelType.TRANSIT) {
			ItineraryTransitLegBean transitLeg = leg.getAsTransitLeg();
			TransitRouteBean route = transitLeg.getRoute();
			// Transit mode icons
			HTML transitLabel = new HTML();
			transitLabel.addStyleName("itinerary-modeline-transit-icon");
			transitLabel.addStyleName(
					FormatUtils.getCssClassNameFromTransportMode(
							transitLeg.getMode()) + "-icon");
			String code = transitLeg.getRoute().getCode();
			// Limit code to first 5 characters
			if (code.length() > 5)
				code = code.substring(0, 5);
			// TODO Use dedicated class for displaying route colors
			transitLabel.setHTML("<span class='route-code' style='color:"
					+ route.getForegroundColor() + "; background-color:"
					+ route.getBackgroundColor() + "'>" + code + "</span>");
			rootPanel.add(transitLabel);
		}
	}
	initWidget(rootPanel);
}
 
開發者ID:mecatran,項目名稱:OpenTripPlanner-client-gwt,代碼行數:48,代碼來源:ItineraryModeLineWidget.java

示例14: createText

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
private HTML createText(String auxDoc) {
	
	HTML richText = new HTML();
	
	richText.setHTML("<p>"+auxDoc+"</p>");
	
	//richText.getElement().getStyle().setProperty("height", "400px");
	
	getElement().getStyle().setProperty("width", __width_max_poppanel);
	richText.getElement().getStyle().setProperty("width", "100%");
	
	return richText;
}
 
開發者ID:WELTEN,項目名稱:dojo-ibl,代碼行數:14,代碼來源:SlideShow.java


注:本文中的com.google.gwt.user.client.ui.HTML.setHTML方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。