Package com.google.gwt.safehtml.shared

Examples of com.google.gwt.safehtml.shared.SafeHtml


    for (int i = 0; i < rows; i++) {
      result.appendHtmlConstant("<tr>");
      for (int j = 0; j < columnCount && mark < colors.length; j++) {
        String c = colors[mark];
        String label = labels[mark];
        SafeHtml cellTemplate = template.cellTemplate(style, label, XDOM.getUniqueId(), i, j, c,
            SafeStylesUtils.fromTrustedString("background-color: #" + SafeHtmlUtils.htmlEscape(c) + ";"),
            c.equals(value) ? style.selected() : "");
        result.append(cellTemplate);
        mark++;
      }
View Full Code Here


    sb.appendHtmlConstant("</div>");

  }

  private void writeIcon(SafeHtmlBuilder builder, ImageResource icon, int height) {
    SafeHtml iconHtml = AbstractImagePrototype.create(icon).getSafeHtml();
    if (height == -1) {
      builder.append(templates.icon(style.iconWrap(), iconHtml));
    } else {
      int adjustedHeight = height - heightOffset;
      SafeStyles heightStyle = SafeStylesUtils.fromTrustedString("height:" + adjustedHeight + "px;");
View Full Code Here

            }

            String s = (viewData != null) ? viewData.getCurrentValue() : value;
            if (s != null && s.trim().length() > 0) {
                // If the value comes from the user, escape it to avoid XSS attacks.
                SafeHtml safeValue = SafeHtmlUtils.fromString(value);

                // Use the template to create the Cell's html.
                SafeHtml rendered = textAreaTemplate.textarea(safeValue, "", Integer.toString(rows), Integer.toString(cols));
                sb.append(rendered);
            } else {

                // Add the placeholder helper text.
                String placeholderText = GuidedDecisionTableConstants.INSTANCE.InsertYourCommentsHere();
                String placeholderHtml = SafeHtmlUtils.htmlEscape(placeholderText);

                // Create an empty text area.
                SafeHtml rendered = textAreaTemplate.textareaEmpty("", Integer.toString(rows), Integer.toString(cols), placeholderHtml);
                sb.append(rendered);
            }
        }
View Full Code Here

   * @param isPlaceholder if true, do not include the background image
   * @return the rendered HTML
   */
  SafeHtml getImageHtml(ImageResource res, VerticalAlignmentConstant valign, boolean isPlaceholder) {
    // Get the HTML for the image.
    SafeHtml image;
    if (isPlaceholder) {
      image = SafeHtmlUtils.fromSafeConstant("<div></div>");
    } else {
      AbstractImagePrototype proto = AbstractImagePrototype.create(res);
      image = SafeHtmlUtils.fromTrustedString(proto.getHTML());
View Full Code Here

        if (value != null) {
          column.render(context, value, cellBuilder);
        }

        // Build the contents.
        SafeHtml contents = SafeHtmlUtils.EMPTY_SAFE_HTML;
        contents = template.div(cellBuilder.toSafeHtml());

        // Build the cell.
        HorizontalAlignmentConstant hAlign = column.getHorizontalAlignment();
        VerticalAlignmentConstant vAlign = column.getVerticalAlignment();
View Full Code Here

      if (value == null) {
        return;
      }

      // If the value comes from the user, we escape it to avoid XSS attacks.
      SafeHtml safeValue = SafeHtmlUtils.fromString(value);

      // Use the template to create the Cell's html.
      SafeStyles styles = SafeStylesUtils.forTrustedColor(safeValue.asString());
      SafeHtml rendered = templates.cell(styles, safeValue);
      sb.append(rendered);
    }
View Full Code Here

      if (value == null) {
        return;
      }

      // If the value comes from the user, we escape it to avoid XSS attacks.
      SafeHtml safeValue = SafeHtmlUtils.fromString(value);

      // Use the template to create the Cell's html.
      SafeStyles styles = SafeStylesUtils.forTrustedColor(safeValue.asString());
      SafeHtml rendered = templates.cell(styles, safeValue);
      sb.append(rendered);
    }
View Full Code Here

   * @param row
   * @param col
   */
  @SuppressWarnings( "serial" )
  protected void addHr( int row, int col, int colspan ) {
    setHTML( row, col, new SafeHtml() {
      @Override
      public String asString() {
        return "<hr/>";
      }
    } );
View Full Code Here

    all.removeAll();

    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    bufferRender(models, sb);

    SafeHtml markup = sb.toSafeHtml();
    getElement().setInnerHTML(markup.asString());

    SafeHtmlBuilder esb = new SafeHtmlBuilder();
    appearance.renderEnd(esb);
    DomHelper.insertHtml("beforeend", getElement(), esb.toSafeHtml().asString());
View Full Code Here

    NodeList<Element> groups = getGroups();
    List<GroupingData<M>> groupData = getGroupData();
    for (int i = 0; i < groupData.size(); i++) {
      Element g = groups.getItem(i);
      if (g == null) continue;
      SafeHtml s = renderGroupSummary(groupData.get(i));
      XElement existing = getSummaryNode(g);
      if (existing != null) {
        existing.removeFromParent();
      }
      g.appendChild(XDOM.create(s));
View Full Code Here

TOP

Related Classes of com.google.gwt.safehtml.shared.SafeHtml

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.