本文整理汇总了Java中com.google.gwt.safehtml.shared.SafeHtmlBuilder.appendHtmlConstant方法的典型用法代码示例。如果您正苦于以下问题:Java SafeHtmlBuilder.appendHtmlConstant方法的具体用法?Java SafeHtmlBuilder.appendHtmlConstant怎么用?Java SafeHtmlBuilder.appendHtmlConstant使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.safehtml.shared.SafeHtmlBuilder
的用法示例。
在下文中一共展示了SafeHtmlBuilder.appendHtmlConstant方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRowExpander
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
private RowExpander<VehicleJSO> createRowExpander() {
return new RowExpander<VehicleJSO>(new AbstractCell<VehicleJSO>() {
@Override
public void render(Context context, VehicleJSO value,
SafeHtmlBuilder sb) {
String comment = value.getComments();
if( comment == null) {
comment = UISgfMessages.INSTANCE.noCommentLabel();
}
sb.appendHtmlConstant("<p style='margin: 5px 5px 10px'><b>"
+ UISgfMessages.INSTANCE.commentColumn() + ":</b> "
+ comment + "</p>");
}
});
}
示例2: render
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
public void render(Context context, TemplateInfo template, SafeHtmlBuilder sb) {
if (template == null)
return;
sb.appendHtmlConstant("<table>");
// Add the thumbnail image, if available, or a default image.
sb.appendHtmlConstant("<tr><td rowspan='3'>");
if ( !template.thumbStr.equals("") ) {
String src = hostUrl + TEMPLATES_ROOT_DIRECTORY + template.name + "/" + template.thumbStr;
sb.appendHtmlConstant("<img style='width:32px' src='" + src + "'>");
} else {
ImageResource imgResource = Ode.getImageBundle().appInventorLogo();
Image img = new Image(imgResource);
String url = img.getUrl();
sb.appendHtmlConstant("<img style='width:32px' src='" + url + "'>");
}
sb.appendHtmlConstant("</td>");
// Add the name and description.
sb.appendHtmlConstant("<td style='font-size:95%;'>");
sb.appendEscaped(template.name);
sb.appendHtmlConstant("</td></tr><tr><td>");
sb.appendEscaped(template.subtitle);
sb.appendHtmlConstant("</td></tr></table>");
}
示例3: render
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
/**
* This method provides style for your wrap data
*
*/
public void render(Cell.Context context, WrapString value, SafeHtmlBuilder sb) {
String longString = value.getLongString();
@SuppressWarnings("unused")
String row1Content = longString;
@SuppressWarnings("unused")
String row2Content = null;
int LINE_SIZE = 60;
sb.appendHtmlConstant("<div><table width='100%'>");
while (longString != null && !longString.isEmpty()) {
if (longString.length() <= LINE_SIZE) {
sb.appendHtmlConstant("<tr><td><div>"+longString+"</div></td></tr>");
break;
} else {
sb.appendHtmlConstant("<tr><td><div>"+longString.subSequence(0, LINE_SIZE)+"</div></td></tr>");
longString = longString.substring(LINE_SIZE);
}
}
sb.appendHtmlConstant("</table></div>");
}
示例4: render
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
public void render(Context context, SafeHtml data, SafeHtmlBuilder sb) {
final ButtonType type = getType();
final IconType icon = getIcon();
final ButtonSize size = getSize();
final String _title = this.title != null ? " title=\"" + this.title + "\" " : "";
sb.appendHtmlConstant("<button " + _title + " type=\"button\" class=\"btn "
+ (type != null ? type.get() : "") + (size != null ? " " + size.get() : "") + "\" tabindex=\"-1\">");
if (data != null) {
if (icon != null) {
sb.appendHtmlConstant("<i class=\"" + icon.get() + "\"></i> ");
}
sb.append(data);
}
sb.appendHtmlConstant("</button>");
}
示例5: onResponse
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
public void onResponse(String greet, String info, String agent) {
SafeHtmlBuilder builder = new SafeHtmlBuilder();
builder.appendEscaped(greet);
builder.appendHtmlConstant("<br><br>I am running ");
builder.appendEscaped(info);
builder.appendHtmlConstant(".<br><br>It looks like you are using:<br>");
builder.appendEscaped(agent);
dialogBox.setText("Remote Procedure Call");
dialogBox.center();
serverResponseLabel.removeStyleName(greetingCss.error());
serverResponseLabel.setHTML(builder.toSafeHtml());
closeButton.setFocus(true);
}
示例6: render
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
public SafeHtml render (Tag object) {
SafeHtmlBuilder builder = new SafeHtmlBuilder();
if (displayLabel) {
builder.appendHtmlConstant("<span class=\"glyphicon glyphicon-tags\" style=\"margin-right:2px;\"></span> ");
}
SafeUri href = PageTypeHelper.asHref(PageType.TagPostsPageType,
object.slug == null ? PostHelper.slugify(object.name)
: object.slug);
if (displayCount) {
builder.append(TagTemplate.INSTANCE.tagWithCount(href,
object.name,
object.posts == null ? 0 : object.posts.size()));
} else {
builder.append(TagTemplate.INSTANCE.tag(href, object.name));
}
return builder.toSafeHtml();
}
示例7: getDisplayString
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
public String getDisplayString() {
int start = 0;
int keyLen = keyword.length();
SafeHtmlBuilder builder = new SafeHtmlBuilder();
for (; ; ) {
int index = value.indexOf(keyword, start);
if (index == -1) {
builder.appendEscaped(value.substring(start));
break;
}
builder.appendEscaped(value.substring(start, index));
builder.appendHtmlConstant("<strong>");
start = index + keyLen;
builder.appendEscaped(value.substring(index, start));
builder.appendHtmlConstant("</strong>");
}
return builder.toSafeHtml().asString();
}
示例8: createStopButton
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
private ActionButton createStopButton(Process process, StopProcessHandler handler) {
final SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder.appendHtmlConstant(FontAwesome.STOP);
final ActionButton button = new ActionButton(safeHtmlBuilder.toSafeHtml());
button.addClickHandler(
event -> {
event.stopPropagation(); // prevent dropdown list from opening/closing
handler.onStopProcess(process);
});
button.ensureDebugId("dropdown-processes-stop");
Tooltip.create((Element) button.getElement(), BOTTOM, MIDDLE, "Stop");
return button;
}
示例9: createRerunButton
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
private ActionButton createRerunButton(Process process, RerunProcessHandler handler) {
final SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder.appendHtmlConstant(FontAwesome.REPEAT);
final ActionButton button = new ActionButton(safeHtmlBuilder.toSafeHtml());
button.addClickHandler(
event -> {
event.stopPropagation(); // prevent dropdown list from opening/closing
handler.onRerunProcess(process);
});
button.ensureDebugId("dropdown-processes-rerun");
Tooltip.create((Element) button.getElement(), BOTTOM, MIDDLE, "Re-run");
return button;
}
示例10: createRowExpander
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
private RowExpander<LayerDef> createRowExpander() {
return new RowExpander<LayerDef>(new AbstractCell<LayerDef>() {
@Override
public void render(Context context, LayerDef value,
SafeHtmlBuilder sb) {
sb.appendHtmlConstant("<p style='margin: 5px 5px 10px'><b>"
+ UICatalogMessages.INSTANCE.description() + ":</b> "
+ value.getDescription() + "</p>");
}
});
}
示例11: render
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
protected void render(Context context, SafeHtml value, SafeHtmlBuilder sb) {
if (!value.asString().equals("none")) {
sb.appendHtmlConstant("<div class=\""+style+"\">");
sb.append(value);
sb.appendHtmlConstant("</div>");
}
else
sb.append(value);
}
示例12: render
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
protected void render(Context context, SafeHtml value, SafeHtmlBuilder sb) {
// Make the details clickable for VOOB rule
if (value != null && !value.asString().isEmpty()) {
sb.appendHtmlConstant("<div class=\""+style+"\">");
sb.append(value);
sb.appendHtmlConstant("</div>");
}
}
示例13: render
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
protected void render(Context context, SafeHtml value, SafeHtmlBuilder sb) {
if (value != null && !value.asString().equals("Select Action")) {
sb.append(value);
}
// if the value is assign, then we need to make the cell clickable with underline
// otherwise, not.
if (value.asString().equals("Select Action")) {
sb.appendHtmlConstant("<div class=\""+style+"\">");
sb.append(value);
sb.appendHtmlConstant("</div>");
}
}
示例14: render
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
public void render(Context context, Term term, SafeHtmlBuilder sb) {
if(term != null) {
sb.appendHtmlConstant("<span class=\"codelist-term\">");
sb.appendEscaped(term.getName());
sb.appendHtmlConstant("</span>");
}
}
示例15: render
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
Object key = context.getKey();
ViewData viewData = getViewData(key);
if (viewData != null && viewData.getCurrentValue().equals(value)) {
clearViewData(key);
viewData = null;
}
// Get the view data.
String s = (viewData != null) ? viewData.getCurrentValue() : value;
if (isVisiblePredicate == null || isVisiblePredicate.isVisible((T) key)) {
if (isEnabledPredicate == null
|| isEnabledPredicate.isEnabled((T) key)) {
if (s != null) {
sb.append(template.input(s));
} else {
sb.appendHtmlConstant("<input type=\"text\" tabindex=\"-1\"></input>");
}
} else {
if (s != null) {
sb.append(disabledTemplate.input(s));
} else {
sb.appendHtmlConstant("<input type=\"text\" tabindex=\"-1\" disabled></input>");
}
}
}
}