本文整理汇总了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);
}
示例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");
}
示例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;
}
示例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() );
}
}
}
示例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() );
}
}
}
示例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);
}
}
示例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();
}
示例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()) ? " " : "(" + colDef.getColumn().getUnits() + ")";
label.setHTML(label.getHTML() + "<br>" + u);
}
GwtUtil.setStyle(label, "display", "inline-table");
}
filterSupport.onUpdateHeaders(colDefs);
}
filterSupport.ensureFilterShow();
}
示例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);
}
}
示例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);
}
示例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);
}
示例12: render
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
@Override
public void render(RendererCellReference cell, String text, HTML button) {
button.setHTML(text);
}
示例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);
}
示例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;
}