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


Java SafeHtmlBuilder.append方法代码示例

本文整理汇总了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>");
}
 
开发者ID:kiegroup,项目名称:kie-docker-ci,代码行数:17,代码来源:ButtonWithTitleCell.java

示例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;
}
 
开发者ID:kiegroup,项目名称:kie-docker-ci,代码行数:21,代码来源:KieContainerTypesSafeHtmlRenderer.java

示例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;
}
 
开发者ID:kiegroup,项目名称:kie-docker-ci,代码行数:21,代码来源:KieImageTypesSafeHtmlRenderer.java

示例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);
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:27,代码来源:CheckboxCellImpl.java

示例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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:37,代码来源:FrameItemRender.java

示例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);
}
 
开发者ID:dpinney,项目名称:essence,代码行数:11,代码来源:ClickableTextCellRuleID.java

示例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>");
  }
}
 
开发者ID:dpinney,项目名称:essence,代码行数:10,代码来源:VOOBDetailClickableCellText.java

示例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>");
  }
}
 
开发者ID:dpinney,项目名称:essence,代码行数:14,代码来源:MyClickableCellTextDecision.java

示例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);
	}
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:10,代码来源:DisableableCheckboxCell.java

示例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);
    }
}
 
开发者ID:Teiid-Designer,项目名称:teiid-webui,代码行数:11,代码来源:DisableableCheckboxCell.java

示例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);
}
 
开发者ID:treblereel,项目名称:TreeGridGWT,代码行数:31,代码来源:ExpandableCell.java

示例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);
}
 
开发者ID:treblereel,项目名称:TreeGridGWT,代码行数:16,代码来源:ExpandableCell.java

示例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()));
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:15,代码来源:HyperLinkCell.java

示例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>");
            }
        }
    }
}
 
开发者ID:opendatakit,项目名称:aggregate,代码行数:30,代码来源:UIEnabledValidatingTextInputCell.java

示例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);
	}
}
 
开发者ID:treblereel,项目名称:TreeGridGWT,代码行数:11,代码来源:ExpandableCell.java


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