Package com.google.gwt.safecss.shared

Examples of com.google.gwt.safecss.shared.SafeStyles


    if (width == -1) {
      width = 150;
    }

    SafeStyles inputStyles = null;
    String wrapStyles = "";

    if (width != -1) {
      wrapStyles += "width:" + width + "px;";
View Full Code Here


   
    int offset = (int) (fractionalValue * (width - 21)) - 7;
   
    offset = Math.max(-7, offset);
   
    SafeStyles offsetStyles = SafeStylesUtils.fromTrustedString("left:" + offset + "px;");
    SafeStyles widthStyle = SafeStylesUtils.fromTrustedString("");

    widthStyle = SafeStylesUtils.fromTrustedString("width: " + width + "px;");
    sb.append(template.template(resources.style(), widthStyle, offsetStyles));
  }
View Full Code Here

    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;");
      builder.append(templates.iconWithStyles(style.iconWrap(), heightStyle, iconHtml));
    }
  }
View Full Code Here

    int pad = options.getLabelPad();
    if (pad == 0) pad = 5;

    String fieldLabelWidth = align == LabelAlign.TOP ? "auto" : (labelWidth + "px");
    SafeStyles fieldLabelStyles = SafeStylesUtils.fromTrustedString("width:" + fieldLabelWidth + ";");

    String fieldElementPadding = align == LabelAlign.TOP ? "0" : (labelWidth + pad + "px");
    SafeStyles fieldElementStyles = SafeStylesUtils.fromTrustedString("padding-left:" + fieldElementPadding + ";");

    sb.append(template.render(id, style, fieldLabelStyles, fieldElementStyles));
  }
View Full Code Here

      // 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 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

          image = LEAF_IMAGE;
        } else {
          image = closedImageHtml;
        }

        SafeStyles padding =
            SafeStylesUtils.fromTrustedString("padding-right: " + imageWidth + "px;");
        if (i == keyboardSelectedRow) {
          // This is the focused item.
          if (isFocused) {
            classesBuilder.append(keyboardSelectedItem);
View Full Code Here

          }
          // Render cell contents
          SafeHtmlBuilder cellBuilder = new SafeHtmlBuilder();
          Context context = new Context(i, 0, key);
          cell.render(context, value, cellBuilder);
          SafeStyles innerPadding =
              SafeStylesUtils.fromTrustedString("padding-" + paddingDirection + ": " + imageWidth
                  + "px;");
          SafeHtml innerDiv =
              template.innerDiv(innerPadding, innerClasses.toString(), image, itemValueStyle,
                  cellBuilder.toSafeHtml());
          SafeStyles outerPadding =
              SafeStylesUtils.fromTrustedString("padding-" + paddingDirection + ": "
                  + paddingAmount + "px;");
          sb.append(template.outerDiv(outerPadding, outerClasses.toString(), innerDiv,
              ariaSelected));
        }
View Full Code Here

    {
      builder.append(templates.icon(style.iconWrap(), iconHtml));
    }
    else
    {
      final SafeStyles heightStyle = SafeStylesUtils.fromTrustedString("height:" + height + "px;");
      builder.append(templates.iconWithStyles(style.iconWrap(), heightStyle, iconHtml));
    }
  }
View Full Code Here

          image = LEAF_IMAGE;
        } else {
          image = closedImageHtml;
        }

        SafeStyles padding =
            SafeStylesUtils.fromTrustedString("padding-right: " + imageWidth + "px;");
        if (i == keyboardSelectedRow) {
          // This is the focused item.
          if (isFocused) {
            classesBuilder.append(keyboardSelectedItem);
View Full Code Here

TOP

Related Classes of com.google.gwt.safecss.shared.SafeStyles

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.