Package com.google.gwt.libideas.resources.client.ImmutableResourceBundle

Examples of com.google.gwt.libideas.resources.client.ImmutableResourceBundle.Resource


    logger = logger.branch(TreeLogger.DEBUG, "Finding resources", null);

    String[] resources;
    // Check for Resource annotations first:
    if (method.getAnnotation(Resource.class) != null) {
      Resource resource = method.getAnnotation(Resource.class);
      resources = resource.value();
    } else {
      String[][] md = method.getMetaData(METADATA_TAG);

      if (md.length == 0) {
        logger.log(TreeLogger.ERROR,
            "Method " + method.getName() + " does not have a @"
                + Resource.class.getName() + " annotations.", null);
        throw new UnableToCompleteException();
      }

      // Emit a deprecation warning about metadata:
      logger.log(TreeLogger.WARN, "Method " + method.getName() + " uses a "
          + "deprecated @gwt.resources metadata annotation.  Convert to @"
          + Resource.class.getName(), null);

      resources = new String[md.length];
      for (int tagIndex = 0; tagIndex < md.length; tagIndex++) {
        int lastIndex = md[tagIndex].length - 1;
        resources[tagIndex] = md[tagIndex][lastIndex];
      }
    }

    String locale;
    try {
      PropertyOracle oracle = context.getGeneratorContext().getPropertyOracle();
      locale = oracle.getPropertyValue(logger, "locale");
    } catch (BadPropertyValueException e) {
      locale = null;
    }

    URL[] toReturn = new URL[resources.length];

    boolean error = false;
    int tagIndex = 0;
    for (String resource : resources) {

      // Make sure the name is either absolute or package-relative.
      if (resource.indexOf("/") == -1) {
        String pkgName = method.getEnclosingType().getPackage().getName();

        // This construction handles the default package correctly, too.
        resource = pkgName.replace('.', '/') + "/" + resource;
      }
View Full Code Here


    logger = logger.branch(TreeLogger.DEBUG, "Finding resources");

    String[] resources;
    // Check for Resource annotations first:
    if (method.getAnnotation(Resource.class) != null) {
      Resource resource = method.getAnnotation(Resource.class);
      resources = resource.value();
    } else {
      String[][] md = method.getMetaData(METADATA_TAG);

      if (md.length == 0) {
        logger.log(TreeLogger.ERROR, "Method " + method.getName()
View Full Code Here

TOP

Related Classes of com.google.gwt.libideas.resources.client.ImmutableResourceBundle.Resource

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.