Example usage for com.google.gwt.resources.ext ResourceContext getClientBundleType

List of usage examples for com.google.gwt.resources.ext ResourceContext getClientBundleType

Introduction

In this page you can find the example usage for com.google.gwt.resources.ext ResourceContext getClientBundleType.

Prototype

JClassType getClientBundleType();

Source Link

Document

Return the interface type of the resource bundle being generated.

Usage

From source file:org.vectomatic.dev.svg.impl.gen.ExternalSVGResourceGenerator.java

License:Apache License

@Override
public void createFields(TreeLogger logger, ResourceContext context, ClientBundleFields fields)
        throws UnableToCompleteException {
    data.append(']');

    urlExpression = context.deploy(/*from   w ww .  j  av a 2  s.com*/
            context.getClientBundleType().getQualifiedSourceName().replace('.', '_') + "_jsonbundle.txt",
            "text/plain", data.toString().getBytes(), true);

    TypeOracle typeOracle = context.getGeneratorContext().getTypeOracle();
    JClassType stringType = typeOracle.findType(String.class.getName());
    assert stringType != null;

    externalSVGUrlIdent = fields.define(stringType, "externalSVGUrl", urlExpression, true, true);

    JClassType textResourceType = typeOracle.findType(SVGResource.class.getName());
    assert textResourceType != null;
    JType textResourceArrayType = typeOracle.getArrayType(textResourceType);

    externalSVGCacheIdent = fields.define(textResourceArrayType, "externalSVGCache",
            "new " + SVGResource.class.getName() + "[" + currentIndex + "]", true, true);
}