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


Java EscapeUtils.fromSafeConstant方法代码示例

本文整理汇总了Java中org.waveprotocol.wave.client.common.safehtml.EscapeUtils.fromSafeConstant方法的典型用法代码示例。如果您正苦于以下问题:Java EscapeUtils.fromSafeConstant方法的具体用法?Java EscapeUtils.fromSafeConstant怎么用?Java EscapeUtils.fromSafeConstant使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.waveprotocol.wave.client.common.safehtml.EscapeUtils的用法示例。


在下文中一共展示了EscapeUtils.fromSafeConstant方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleParticipantClicked

import org.waveprotocol.wave.client.common.safehtml.EscapeUtils; //导入方法依赖的package包/类
/**
 * Shows a participation profileUi for the clicked participant.
 */
private void handleParticipantClicked(Element context) {
  ParticipantView participantView = views.asParticipant(context);
  Pair<Conversation, ParticipantId> participation = models.getParticipant(participantView);
  Profile profile = profiles.getProfile(participation.second);

  // Summon a popup view from a participant, and attach profile-popup logic to
  // it.
  ProfilePopupView profileView = participantView.showParticipation();
  final Conversation conversation = participation.getFirst();
  final ParticipantId participantId = participation.getSecond();
  boolean isRemoved = ParticipantState.REMOVED.equals(participantView.getState());
  SafeHtml buttonText = EscapeUtils.fromSafeConstant(isRemoved ? messages.close()
      : messages.remove());
  Command buttonCommand = isRemoved ? null : new Command() {
    
    @Override
    public void execute() {
      conversation.removeParticipant(participantId);
      markAsRead();
    }
  };
  ProfilePopupPresenter profileUi = ProfilePopupPresenter.create(profile, profileView, profiles,
      (ObservableConversation) conversation, buttonText, buttonCommand);
  profileUi.show();
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:29,代码来源:ParticipantController.java

示例2: gwtSetUp

import org.waveprotocol.wave.client.common.safehtml.EscapeUtils; //导入方法依赖的package包/类
@Override
protected void gwtSetUp() {
  SafeHtml dom = EscapeUtils.fromSafeConstant("" + // \u2620
      "<div id='base' kind='base'>" + // \u2620
      "  <div>" + // \u2620
      "    <div kind='foo' id='foo'>" + // \u2620
      "      <div kind='unused'>" + // \u2620
      "        <div kind='bar' id='bar'>" + // \u2620
      "          <div id='source'></div>" + // \u2620
      "        </div>" + // \u2620
      "      </div>" + // \u2620
      "    </div>" + // \u2620
      "  </div>" + // \u2620
      "</div>");

  top = load(dom);
  foo = Document.get().getElementById("foo");
  bar = Document.get().getElementById("bar");

  // Register some handlers.
  handlers = new MockHandlers(top);
  fooHandler = new MyHandler();
  barHandler = new MyHandler();
  handlers.register("foo", fooHandler);
  handlers.register("bar", barHandler);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:27,代码来源:EventDispatcherPanelGwtTest.java

示例3: image

import org.waveprotocol.wave.client.common.safehtml.EscapeUtils; //导入方法依赖的package包/类
/**
 * Appends an image.
 *
 * @param url attribute-value safe URL
 * @param info attribute-value safe image information
 * @param style
 */
public static void image(
    SafeHtmlBuilder builder, String id, String style, SafeHtml url, SafeHtml info, String kind) {
  String safeUrl = url != null ? EscapeUtils.sanitizeUri(url.asString()) : null;
  SafeHtml img = EscapeUtils.fromSafeConstant("<img " //
      + "id='" + id + "' " //
      + "class='" + style + "' " //
      + (safeUrl != null ? "src='" + safeUrl + "' " : "") //
      + (info != null ? " alt='" + info.asString() + "' title='" + info.asString() + "' " : "") //
      + (kind != null ? " " + KIND_ATTRIBUTE + "='" + kind + "'" : "") //
      + "></img>");
  builder.append(img);
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:20,代码来源:OutputHelper.java


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