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


Java SafeHtmlBuilder.toSafeHtml方法代码示例

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


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

示例1: 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

示例2: 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

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

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

示例5: 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();
}
 
开发者ID:billy1380,项目名称:blogwt,代码行数:23,代码来源:TagCell.java

示例6: createAddressColumn

import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
private Column<OrderDataDto, SafeHtml> createAddressColumn() {
	return new Column<OrderDataDto, SafeHtml>(new SafeHtmlCell()) {

		@Override
		public SafeHtml getValue(OrderDataDto orderData) {
			SafeHtmlBuilder builder = new SafeHtmlBuilder();
			builder.appendEscapedLines(orderData.getAddress());
			return builder.toSafeHtml();
		}
	};
}
 
开发者ID:wte4j,项目名称:wte4j,代码行数:12,代码来源:GenerateDocumentPanel.java

示例7: parseCode

import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
public static SafeHtml parseCode(String code) {
    SafeHtmlBuilder builder = new SafeHtmlBuilder();
    String[] splitted = code.replaceAll("\\\\s", " ").split("\\\\n\\s?");
    String[] arr$ = splitted;
    int len$ = splitted.length;

    for (int i$ = 0; i$ < len$; ++i$) {
        String s = arr$[i$];
        builder.append(SafeHtmlUtils.fromTrustedString(SafeHtmlUtils.htmlEscapeAllowEntities(s)));
        builder.appendHtmlConstant("<br>");
    }

    return builder.toSafeHtml();
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:15,代码来源:CodeHelper.java

示例8: getIconForGoal

import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
/** Returns {@link FontAwesome} icon for the given goal. */
private SafeHtml getIconForGoal(CommandGoal goal) {
  final SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();

  if (goal.equals(runGoal)) {
    safeHtmlBuilder.appendHtmlConstant(FontAwesome.PLAY);
  } else if (goal.equals(debugGoal)) {
    safeHtmlBuilder.appendHtmlConstant(FontAwesome.BUG);
  }

  return safeHtmlBuilder.toSafeHtml();
}
 
开发者ID:eclipse,项目名称:che,代码行数:13,代码来源:ExecuteCommandButtonFactory.java

示例9: init

import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
public void init(List<ERDDAPConstraintGroup> constraintGroups) {
    panel = 0;
    displayPanel.clear();
    
    if ( constraintPanel.getWidgetCount() > 0 ) constraintPanel.clear();
    for (Iterator iterator = constraintGroups.iterator(); iterator.hasNext();) {
        ERDDAPConstraintGroup erddapConstraintGroup = (ERDDAPConstraintGroup) iterator.next();
        
        String name = erddapConstraintGroup.getName();
        SafeHtmlBuilder builder = new SafeHtmlBuilder();
        builder.appendHtmlConstant("<div style='font-size:.7em'>").appendEscaped(name).appendHtmlConstant("</div");
        SafeHtml title = builder.toSafeHtml();
        
        
        if ( erddapConstraintGroup.getType().equals("selection") ) {
            SelectionConstraintPanel selectionConstraintPanel = new SelectionConstraintPanel();
            selectionConstraintPanel.init(erddapConstraintGroup);
            constraintPanel.add(selectionConstraintPanel, erddapConstraintGroup.getName(), 22);       
            constraintPanel.setHeaderHTML(panel, title);
            panel++;
        } else if ( erddapConstraintGroup.getType().equals("subset")) {
            SubsetConstraintPanel subsetConstraintPanel = new SubsetConstraintPanel();
            subsetConstraintPanel.init(erddapConstraintGroup);
            constraintPanel.add(subsetConstraintPanel, erddapConstraintGroup.getName(), 22);
            constraintPanel.setHeaderHTML(panel, title);
            panel++;
        } else if ( erddapConstraintGroup.getType().equals("season") ) {
            SeasonConstraintPanel seasonConstraintPanel = new SeasonConstraintPanel();
            seasonConstraintPanel.init(erddapConstraintGroup);
            constraintPanel.add(seasonConstraintPanel, erddapConstraintGroup.getName(), 22);
            constraintPanel.setHeaderHTML(panel, title);
            panel++;
        } else if ( erddapConstraintGroup.getType().equals(Constants.VARIABLE_CONSTRAINT) ) {
            constraintPanel.add(variableConstraints, erddapConstraintGroup.getName(), 22);
            constraintPanel.setHeaderHTML(panel, title);
            panel++;
        } else if ( erddapConstraintGroup.getType().equals("valid") ) {
            constraintPanel.add(validConstraints, erddapConstraintGroup.getName(), 22);
            constraintPanel.setHeaderHTML(panel, title);
            panel++;
        } else if ( erddapConstraintGroup.getType().equals("regex") ) {
            RegexSubsetConstraintPanel regexSubsetConstraintPanel = new RegexSubsetConstraintPanel();
            regexSubsetConstraintPanel.init(erddapConstraintGroup);
            constraintPanel.add(regexSubsetConstraintPanel, erddapConstraintGroup.getName(), 22);
            constraintPanel.setHeaderHTML(panel, title);
            panel++;
        }
    }
 
    if ( constraintPanel.getWidgetCount() > 0 ) {
        constraintPanel.showWidget(0);
    }
    
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:55,代码来源:ConstraintWidgetGroup.java

示例10: AccessConfigurationSheet

import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
public AccessConfigurationSheet(PermissionsSubTab permissionsTab) {
  this.permissionsTab = permissionsTab;
  initWidget(uiBinder.createAndBindUi(this));
  sinkEvents(Event.ONCHANGE | Event.ONCLICK);
  
  downloadCsv.setHref(UIConsts.GET_USERS_AND_PERMS_CSV_SERVLET_ADDR);

  SafeHtmlBuilder sb = new SafeHtmlBuilder();
  sb.appendHtmlConstant("<img src=\"images/red_x.png\" />");
  UIEnabledActionColumn<UserSecurityInfo> deleteMe = new UIEnabledActionColumn<UserSecurityInfo>(
      sb.toSafeHtml(), null, new EnableNotAnonymousOrSuperUserPredicate(),
      new DeleteActionCallback());
  userTable.addColumn(deleteMe, "");

  // Username
  UsernameTextColumn username = new UsernameTextColumn();
  userTable.addColumn(username, "Username");

  // Full Name
  FullNameTextColumn fullname = new FullNameTextColumn();
  userTable.addColumn(fullname, "Full Name");

  // Change Password
  UIEnabledActionColumn<UserSecurityInfo> changePassword = new UIEnabledActionColumn<UserSecurityInfo>(
      "Change Password", new EnableLocalAccountPredicate(), new ChangePasswordActionCallback());
  userTable.addColumn(changePassword, "");

  // Type of User
  AccountTypeSelectionColumn type = new AccountTypeSelectionColumn();
  userTable.addColumn(type, "Account Type");

  GroupMembershipColumn dc = new GroupMembershipColumn(GrantedAuthorityName.GROUP_DATA_COLLECTORS);
  userTable.addColumn(dc, GrantedAuthorityName.GROUP_DATA_COLLECTORS.getDisplayText());

  GroupMembershipColumn dv = new GroupMembershipColumn(GrantedAuthorityName.GROUP_DATA_VIEWERS);
  userTable.addColumn(dv, GrantedAuthorityName.GROUP_DATA_VIEWERS.getDisplayText());

  formsAdmin = new GroupMembershipColumn(GrantedAuthorityName.GROUP_FORM_MANAGERS);
  userTable.addColumn(formsAdmin, GrantedAuthorityName.GROUP_FORM_MANAGERS.getDisplayText());

  columnSortHandler.setComparator(username, username.getComparator());
  columnSortHandler.setComparator(fullname, fullname.getComparator());
  columnSortHandler.setComparator(type, type.getComparator());
  columnSortHandler.setComparator(dc, dc.getComparator());
  columnSortHandler.setComparator(dv, dv.getComparator());
  columnSortHandler.setComparator(formsAdmin, formsAdmin.getComparator());

  synchronizeTables = new GroupMembershipColumn(GrantedAuthorityName.GROUP_SYNCHRONIZE_TABLES);
  if ( Preferences.getOdkTablesEnabled() ) {
    userTable.addColumn(synchronizeTables, GrantedAuthorityName.GROUP_SYNCHRONIZE_TABLES.getDisplayText());
  }

  superUserTables = new GroupMembershipColumn(GrantedAuthorityName.GROUP_SUPER_USER_TABLES);
  if ( Preferences.getOdkTablesEnabled() ) {
    userTable.addColumn(superUserTables, GrantedAuthorityName.GROUP_SUPER_USER_TABLES.getDisplayText());
  }

  administerTables = new GroupMembershipColumn(GrantedAuthorityName.GROUP_ADMINISTER_TABLES);
  if ( Preferences.getOdkTablesEnabled() ) {
    userTable.addColumn(administerTables, GrantedAuthorityName.GROUP_ADMINISTER_TABLES.getDisplayText());
  }

  columnSortHandler.setComparator(synchronizeTables, synchronizeTables.getComparator());
  columnSortHandler.setComparator(superUserTables, superUserTables.getComparator());
  columnSortHandler.setComparator(administerTables, administerTables.getComparator());

  siteAdmin = new GroupMembershipColumn(GrantedAuthorityName.GROUP_SITE_ADMINS);
  userTable.addColumn(siteAdmin, GrantedAuthorityName.GROUP_SITE_ADMINS.getDisplayText());
  columnSortHandler.setComparator(siteAdmin, siteAdmin.getComparator());

  dataProvider.addDataDisplay(userTable);

  userTable.addColumnSortHandler(columnSortHandler);
}
 
开发者ID:opendatakit,项目名称:aggregate,代码行数:75,代码来源:AccessConfigurationSheet.java

示例11: toSafeHtml

import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
/**
 * Convert String to a SafeHtml
 * @param html
 * @return
 */
public static SafeHtml toSafeHtml(final String html) {
    final SafeHtmlBuilder builder = new SafeHtmlBuilder();
    builder.appendHtmlConstant(html);
    return builder.toSafeHtml();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:11,代码来源:Util.java


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