Package com.google.gwt.safecss.shared

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


        cssClasses += " " +  selectElement.getClassName();

        GQuery containerTemp =
                $(ChozenTemplate.templates.container(containerId, cssClasses).asString()).width(fWidth);

        final SafeStylesBuilder ssb = new SafeStylesBuilder();
        if (isRTL) {
            ssb.right(HORIZONTAL_OFFSET, Style.Unit.PX);
        } else {
            ssb.left(HORIZONTAL_OFFSET, Style.Unit.PX);
        }
        ssb.top(VERTICAL_OFFSET, Style.Unit.PX);

        if (isMultiple) {
            containerTemp.html(ChozenTemplate.templates.contentMultiple(css.chznChoices(),
                    css.searchField(), defaultText, css.defaultClass(), css.chznDrop(), css.chznResults(),
                    ssb.toSafeStyles())
                    .asString());
        } else {
            containerTemp.html(ChozenTemplate.templates.contentSingle(css.chznSingle(),
                    css.chznDefault(), defaultText, css.chznDrop(), css.chznSearch(), css.chznResults(),
                    ssb.toSafeStyles())
                    .asString());
        }

        // insert container after the select elements
        $selectElement.hide().after(containerTemp);
View Full Code Here


        cssClasses += " " +  selectElement.getClassName();

        GQuery containerTemp =
                $(ChozenTemplate.templates.container(containerId, cssClasses).asString()).width(fWidth);

        final SafeStylesBuilder ssb = new SafeStylesBuilder();
        if (isRTL) {
            ssb.right(HORIZONTAL_OFFSET, Style.Unit.PX);
        } else {
            ssb.left(HORIZONTAL_OFFSET, Style.Unit.PX);
        }
        ssb.top(VERTICAL_OFFSET, Style.Unit.PX);

        if (isMultiple) {
            containerTemp.html(ChozenTemplate.templates.contentMultiple(css.chznChoices(),
                    css.searchField(), defaultText, css.defaultClass(), css.chznDrop(), css.chznResults(),
                    ssb.toSafeStyles())
                    .asString());
        } else {
            containerTemp.html(ChozenTemplate.templates.contentSingle(css.chznSingle(),
                    css.chznDefault(), defaultText, css.chznDrop(), css.chznSearch(), css.chznResults(),
                    ssb.toSafeStyles())
                    .asString());
        }

        // insert container after the select elements
        $selectElement.hide().after(containerTemp);
View Full Code Here

  private SafeHtml getImageHtml(ImageResource res) {
    // Right-justify image if LTR, left-justify if RTL
    AbstractImagePrototype proto = AbstractImagePrototype.create(res);
    SafeHtml image = SafeHtmlUtils.fromTrustedString(proto.getHTML());

    SafeStylesBuilder cssBuilder = new SafeStylesBuilder();
    if (LocaleInfo.getCurrentLocale().isRTL()) {
      cssBuilder.appendTrustedString("left:0px;");
    } else {
      cssBuilder.appendTrustedString("right:0px;");
    }
    cssBuilder.appendTrustedString("width: " + res.getWidth() + "px;");
    cssBuilder.appendTrustedString("height: " + res.getHeight() + "px;");
    return template.imageWrapper(cssBuilder.toSafeStyles(), image);
  }
View Full Code Here

    if (isTop) {
      classesBuilder.append(" ").append(style.cellTreeTopItemImage());
    }

    // Build the css.
    SafeStylesBuilder cssBuilder = new SafeStylesBuilder();
    if (LocaleInfo.getCurrentLocale().isRTL()) {
      cssBuilder.appendTrustedString("right: 0px;");
    } else {
      cssBuilder.appendTrustedString("left: 0px;");
    }
    cssBuilder.appendTrustedString("width: " + res.getWidth() + "px;");
    cssBuilder.appendTrustedString("height: " + res.getHeight() + "px;");

    AbstractImagePrototype proto = AbstractImagePrototype.create(res);
    SafeHtml image = SafeHtmlUtils.fromTrustedString(proto.getHTML());
    return template
        .imageWrapper(classesBuilder.toString(), cssBuilder.toSafeStyles(), image);
  }
View Full Code Here

TOP

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

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.