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


Java SafeHtmlBuilder类代码示例

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


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

示例1: createColumnList

import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入依赖的package包/类
private ColumnModel<LayerDef> createColumnList(LayerDefProperties props, 
		RowExpander<LayerDef> rowExpander) {
	
	rowExpander.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
	rowExpander.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
	
	ColumnConfig<LayerDef, String> nameColumn = new ColumnConfig<LayerDef, String>(
			props.name(), 200, SafeHtmlUtils.fromTrustedString("<b>"
					+ UIMessages.INSTANCE.layerManagerToolText() + "</b>"));
	nameColumn.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);		
	
	ColumnConfig<LayerDef, String> typeColumn = new ColumnConfig<LayerDef, String>(
			props.type(), 75, UICatalogMessages.INSTANCE.type());
	typeColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
	typeColumn.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);		
	
	ColumnConfig<LayerDef, ImageResource> iconColumn = new ColumnConfig<LayerDef, ImageResource>(
			props.icon(), 32, "");
	iconColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
	iconColumn.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
	iconColumn.setCell(new ImageResourceCell() {
		@Override
		public void render(Context context, ImageResource value, SafeHtmlBuilder sb) {
			super.render(context, value, sb);
		}
	});
			
	List<ColumnConfig<LayerDef, ?>> columns = new ArrayList<ColumnConfig<LayerDef, ?>>();
	columns.add(rowExpander);
	columns.add(iconColumn);		
	columns.add(nameColumn);
	columns.add(typeColumn);		
	
	return new ColumnModel<LayerDef>(columns);
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:36,代码来源:LayerCatalogDialog.java

示例2: 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>");
			
		}
	});
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:20,代码来源:VehicleDialog.java

示例3: init

import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入依赖的package包/类
protected void init() {
    buttonContent = new Span();
    buttonImage = new Span();
    buttonText = new Span();
    solveButton.getElement().setAttribute("class", "btn btn-success");
    buttonImage.getElement().setAttribute("class", "glyphicon glyphicon-play");
    buttonImage.getElement().setAttribute("aria-hidden", "true");
    buttonText.setHTML(new SafeHtmlBuilder()
            .appendEscaped(CONSTANTS.format("AbstractRosterViewPanel.solve"))
            .toSafeHtml().asString());
    buttonContent.add(buttonImage);
    buttonContent.add(buttonText);
    solveButton.add(buttonContent);
    solverObservable.addObserver(this);
}
 
开发者ID:kiegroup,项目名称:optashift-employee-rostering,代码行数:16,代码来源:AbstractRosterViewPanel.java

示例4: initWidget

import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入依赖的package包/类
@PostConstruct
protected void initWidget() {
    employeeName.setValue(employee.getName());
    employeeSkills.removeAll();
    CollectionDataset<Skill> data = new CollectionDataset<Skill>(skills) {

        @Override
        public String getValue(Skill skill) {
            return (skill == null) ? "" : skill.getName();
        }
    };
    employeeSkills.setDatasets((Dataset<Skill>) data);
    employeeSkills.setItemValue(Skill::getName);
    employeeSkills.setItemText(Skill::getName);
    employeeSkills.reconfigure();
    employeeSkills.add(employee.getSkillProficiencyList().stream()
            .map((p) -> p.getSkill())
            .collect(Collectors.toList()));
    employee.getSkillProficiencyList().stream().map((p) -> p.getSkill())
            .forEach((s) -> employeeSkills.add(s));

    title.setInnerSafeHtml(new SafeHtmlBuilder().appendEscaped(employee.getName())
            .toSafeHtml());
    popup = FormPopup.getFormPopup(this);
    popup.center();
}
 
开发者ID:kiegroup,项目名称:optashift-employee-rostering,代码行数:27,代码来源:EmployeeEditForm.java

示例5: 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>");
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:27,代码来源:TemplateUploadWizard.java

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

示例7: onViewLoaded

import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入依赖的package包/类
@Override
public void onViewLoaded() {
  personRowAdapter = new TableRowAdapter<Person>(view.getTable(), 4) {
    @Override
    protected Object getCellContent(int column, Person item) {
      switch (column) {
        case 0:
          return new SafeHtmlBuilder().appendHtmlConstant("<a href=\"#person/").append(item.id).appendHtmlConstant("\">")
              .appendEscaped(item.name).appendHtmlConstant("</a>").toSafeHtml();
        case 1:
          return item.email;
        case 2:
          return item.phone;
        case 3:
          return item.city;
      }
      return null;
    }
  };
}
 
开发者ID:turnsk,项目名称:gwtmvp,代码行数:21,代码来源:PeoplePresenter.java

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

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

示例10: DataPreviewGrid

import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入依赖的package包/类
public DataPreviewGrid(TablePreviewModel result) {
	List<ColumnConfig<Tuple<Integer, List<String>>, ?>> list = new ArrayList<ColumnConfig<Tuple<Integer, List<String>>, ?>>();
	int count = 0;
	for (String col : result.getHeaders()) {
		ColumnConfig<Tuple<Integer, List<String>>, String> cc = new ColumnConfig<Tuple<Integer, List<String>>, String>(
				new MyValueProvider(count), 80, col);
		cc.setToolTip(new SafeHtmlBuilder().appendHtmlConstant(col)
				.toSafeHtml());
		cc.setCell(new TitledCell());
		list.add(cc);
		count++;
	}
	getListStore().addAll(result.getData());
	ColumnModel<Tuple<Integer, List<String>>> colModel = new ColumnModel<Tuple<Integer, List<String>>>(
			list);
	grid = new Grid<Tuple<Integer, List<String>>>(getListStore(), colModel);

	grid.setHeight(175);

	grid.setAllowTextSelection(true);

	grid.getView().setAdjustForHScroll(false);
	grid.getView().setEmptyText("没有数据!");
}
 
开发者ID:ctripcorp,项目名称:dataworks-zeus,代码行数:25,代码来源:DataPreviewGrid.java

示例11: 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);
	}
 
开发者ID:ilyes4j,项目名称:gwt-modular-webapp-archetype,代码行数:18,代码来源:GreetingView.java

示例12: UIEnabledActionCell

import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入依赖的package包/类
public UIEnabledActionCell(SafeHtml text, UIVisiblePredicate<T> isVisiblePredicate,
    UIEnabledPredicate<T> isEnabledPredicate,
    UIEnabledActionCell.Delegate<T> delegate) {
  super("click", "keydown");
  this.isEnabledPredicate = isEnabledPredicate;
  this.isVisiblePredicate = isVisiblePredicate;
  this.delegate = delegate;
  htmlEnabled = new SafeHtmlBuilder()
      .appendHtmlConstant(
          "<button class=\"gwt-Button\" type=\"button\" tabindex=\"-1\">").append(text)
      .appendHtmlConstant("</button>").toSafeHtml();
  htmlDisabled = new SafeHtmlBuilder()
      .appendHtmlConstant(
          "<button class=\"gwt-Button\" type=\"button\" tabindex=\"-1\" disabled>").append(text)
      .appendHtmlConstant("</button>").toSafeHtml();
}
 
开发者ID:opendatakit,项目名称:aggregate,代码行数:17,代码来源:UIEnabledActionCell.java

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

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

示例15: getDisplayString

import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入依赖的package包/类
@Override
public String getDisplayString() {
  SafeHtmlBuilder builder = new SafeHtmlBuilder();

  String label = macro.getName();
  int pos = 0;
  for (Match highlight : matches) {
    if (highlight.getStart() == highlight.getEnd()) {
      continue;
    }

    if (pos < highlight.getStart()) {
      appendPlain(builder, label.substring(pos, highlight.getStart()));
    }

    appendHighlighted(builder, label.substring(highlight.getStart(), highlight.getEnd()));
    pos = highlight.getEnd();
  }

  if (pos < label.length()) {
    appendPlain(builder, label.substring(pos));
  }

  return builder.toSafeHtml().asString();
}
 
开发者ID:eclipse,项目名称:che,代码行数:26,代码来源:MacroCompletionProposal.java


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