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


Java SafeHtmlBuilder.appendHtmlConstant方法代码示例

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


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

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

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

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

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

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

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

示例7: getDisplayString

import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
public String getDisplayString() {
  int start = 0;
  int keyLen = keyword.length();
  SafeHtmlBuilder builder = new SafeHtmlBuilder();
  for (; ; ) {
    int index = value.indexOf(keyword, start);
    if (index == -1) {
      builder.appendEscaped(value.substring(start));
      break;
    }
    builder.appendEscaped(value.substring(start, index));
    builder.appendHtmlConstant("<strong>");
    start = index + keyLen;
    builder.appendEscaped(value.substring(index, start));
    builder.appendHtmlConstant("</strong>");
  }
  return builder.toSafeHtml().asString();
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:20,代码来源:HighlightSuggestion.java

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

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

示例10: createRowExpander

import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
private RowExpander<LayerDef> createRowExpander() {
	return new RowExpander<LayerDef>(new AbstractCell<LayerDef>() {
		@Override
		public void render(Context context, LayerDef value,
				SafeHtmlBuilder sb) {
			sb.appendHtmlConstant("<p style='margin: 5px 5px 10px'><b>"
					+ UICatalogMessages.INSTANCE.description() + ":</b> "
					+ value.getDescription() + "</p>");
		}
	});
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:12,代码来源:LayerCatalogDialog.java

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

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

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

示例14: render

import com.google.gwt.safehtml.shared.SafeHtmlBuilder; //导入方法依赖的package包/类
@Override
public void render(Context context, Term term, SafeHtmlBuilder sb) {
	if(term != null) {
		sb.appendHtmlConstant("<span class=\"codelist-term\">");
		sb.appendEscaped(term.getName());		
		sb.appendHtmlConstant("</span>");
	}
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:9,代码来源:TermCell.java

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


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