本文整理汇总了Java中com.google.gwt.safehtml.shared.SafeHtmlBuilder.append方法的典型用法代码示例。如果您正苦于以下问题:Java SafeHtmlBuilder.append方法的具体用法?Java SafeHtmlBuilder.append怎么用?Java SafeHtmlBuilder.append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.safehtml.shared.SafeHtmlBuilder
的用法示例。
在下文中一共展示了SafeHtmlBuilder.append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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>");
}
示例2: render
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
public SafeHtml render(KieContainer container) {
final KieImageType type = container.getType();
if (type != null) {
final KieContainerTypeSafeHtmlRenderer r = KieContainerTypeSafeHtmlRenderer.getInstance();
final SafeHtmlBuilder htmlBuilder = new SafeHtmlBuilder();
final SafeHtml typeHtml = r.render(type);
htmlBuilder.append(typeHtml);
final List<KieImageType> subTypes = container.getSubTypes();
if (subTypes != null && !subTypes.isEmpty()) {
for (final KieImageType _suType : subTypes) {
final SafeHtml sbuTypeHtml = r.render(_suType);
htmlBuilder.append(sbuTypeHtml);
}
}
return htmlBuilder.toSafeHtml();
}
return null;
}
示例3: render
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
public SafeHtml render(KieImage image) {
final KieImageType type = image.getType();
if (type != null) {
final KieContainerTypeSafeHtmlRenderer r = KieContainerTypeSafeHtmlRenderer.getInstance();
final SafeHtmlBuilder htmlBuilder = new SafeHtmlBuilder();
final SafeHtml typeHtml = r.render(type);
htmlBuilder.append(typeHtml);
final List<KieImageType> subTypes = image.getSubTypes();
if (subTypes != null && !subTypes.isEmpty()) {
for (final KieImageType _suType : subTypes) {
final SafeHtml sbuTypeHtml = r.render(_suType);
htmlBuilder.append(sbuTypeHtml);
}
}
return htmlBuilder.toSafeHtml();
}
return null;
}
示例4: render
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
public void render(Context context,
Boolean value,
SafeHtmlBuilder sb) {
// Get the view data.
Object key = context.getKey();
Boolean viewData = getViewData(key);
if (viewData != null && viewData.equals(value)) {
clearViewData(key);
viewData = null;
}
if (value != null && ((viewData != null) ? viewData : value)) {
if (isReadOnly) {
sb.append(READ_ONLY_INPUT_CHECKED);
} else {
sb.append(INPUT_CHECKED);
}
} else {
if (isReadOnly) {
sb.append(READ_ONLY_INPUT_UNCHECKED);
} else {
sb.append(INPUT_UNCHECKED);
}
}
}
示例5: render
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
public void render(Element itemElement, StackFrameDump itemData) {
TableCellElement label = Elements.createTDElement();
SafeHtmlBuilder sb = new SafeHtmlBuilder();
sb.appendEscaped(itemData.getLocation().getMethod().getName());
sb.appendEscaped("(");
List<? extends Variable> arguments = itemData.getLocation().getMethod().getArguments();
for (int i = 0; i < arguments.size(); i++) {
String type = arguments.get(i).getType();
sb.appendEscaped(type.substring(type.lastIndexOf(".") + 1));
if (i != arguments.size() - 1) {
sb.appendEscaped(", ");
}
}
sb.appendEscaped("):");
sb.append(itemData.getLocation().getLineNumber());
sb.appendEscaped(", ");
Path path = Path.valueOf(itemData.getLocation().getTarget());
String className;
if (path.isAbsolute()) {
className = path.removeFileExtension().lastSegment();
} else {
className = path.lastSegment();
}
sb.appendEscaped(className);
label.setInnerHTML(sb.toSafeHtml().asString());
itemElement.appendChild(label);
}
示例6: 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);
}
示例7: 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>");
}
}
示例8: 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>");
}
}
示例9: render
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
public void render(com.google.gwt.cell.client.Cell.Context context,
Boolean value, SafeHtmlBuilder sb) {
if(value == null) {
sb.append(INPUT_DISABLED);
} else {
super.render(context, value, sb);
}
}
示例10: render
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
public void render(final Context context, final Boolean value, final SafeHtmlBuilder sb) {
if (value) {
sb.append(INPUT_CHECKED);
} else if (!value && disableIfUnchecked) {
sb.append(INPUT_UNCHECKED_DISABLED);
} else {
sb.append(INPUT_UNCHECKED);
}
}
示例11: createCheckBoxImg
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
/**
* @param sb
* @param imgStyle
*/
@SuppressWarnings("unchecked")
private void createCheckBoxImg(SafeHtmlBuilder sb, SafeStyles imgStyle) {
imageWidthStyle = SafeStylesUtils
.fromTrustedString("float:left;width:16.0px;margin-right:2px;");
SelectionModel<T> sm = (SelectionModel<T>) treeGrid.getSelectionModel();
boolean selected = sm.isSelected(currentRow);
if (selected) {
if (currentRow.getChildren().size() > 0) {
if (currentRow.isChidlrenSelected()) {
rendered = nodeImageTemplate.cell("ICON_CHECKBOX",
imageWidthStyle, ICON_CHECHBOX_CHILDS_SELECTED);
} else {
rendered = nodeImageTemplate.cell("ICON_CHECKBOX",
imageWidthStyle, ICON_CHECHBOX_TRUE);
}
} else {
rendered = nodeImageTemplate.cell("ICON_CHECKBOX",
imageWidthStyle, ICON_CHECHBOX_TRUE);
}
} else {
rendered = nodeImageTemplate.cell("ICON_CHECKBOX", imageWidthStyle,
ICON_CHECHBOX_FALSE);
}
sb.append(rendered);
}
示例12: createOpenArrowAndFolderSafeHtml
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
private void createOpenArrowAndFolderSafeHtml(SafeHtmlBuilder sb,
SafeStyles imgStyle) {
SafeHtml rendered;
if (currentRow.getChildren().size() != 0) {
rendered = nodeImageTemplate.cell("ICON_ARROW__OPEN", imgStyle,
ICON_ARROW_OPEN);
sb.append(rendered);
}
if (treeGrid.isSelectable()) {
createCheckBoxImg(sb, imgStyle);
}
rendered = nodeImageTemplate.cell("ICON_FOLDER__OPEN", imgStyle,
ICON_FOLDER_OPEN);
sb.append(rendered);
}
示例13: render
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
public void render(final Context context,
final HyperLink value,
final SafeHtmlBuilder sb) {
if (value != null) {
if (value.isLink()) {
sb.append(hyperLinkTemplate.hyperLink(SafeHtmlUtils.fromString(value.getLabel()),
value.getLabel()));
} else {
sb.append(textTemplate.text(value.getLabel(),
value.getLabel()));
}
}
}
示例14: 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>");
}
}
}
}
示例15: createClearIcon
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
private void createClearIcon(SafeHtmlBuilder sb, SafeStyles imgStyle,
int times) {
imageWidthStyle = SafeStylesUtils
.fromTrustedString("float:left;width:16.0px;");
for (int i = 0; i < times; i++) {
rendered = nodeImageTemplate.cell("ICON_ARROW__CLOSE",
imageWidthStyle, ICON_CLEAR);
sb.append(rendered);
}
}