private Resource getTemplateResource(GeneratorContext context) { String packageResourcePath = this.targetType.getPackage().getName().replace('.', '/') + "/"; ResourceOracle resourceOracle = context.getResourcesOracle(); Map<String, Resource> reourceMap = new HashMap<>(); for (Resource resource : resourceOracle.getResources()) { reourceMap.put(resource.getPath(), resource); } String templatePath = packageResourcePath + this.templateName + "_" + this.locale + UiBinderLocalizedCreator.TEMPLATE_SUFFIX; Resource templateResource = reourceMap.get(templatePath); if (templateResource == null) { this.locale = null; templatePath = packageResourcePath + this.templateName + UiBinderLocalizedCreator.TEMPLATE_SUFFIX; templateResource = reourceMap.get(templatePath); } if (templateResource != null) { this.templateName = templatePath.replace(packageResourcePath, ""); } return templateResource; }
private Resource getTemplateResource(GeneratorContext context) { String packageResourcePath = this.targetType.getPackage().getName().replace('.', '/') + "/"; ResourceOracle resourceOracle = context.getResourcesOracle(); Map<String, Resource> reourceMap = new HashMap<>(); for (Resource resource : resourceOracle.getResources()) { reourceMap.put(resource.getPath(), resource); } String templatePath = packageResourcePath + this.templateName + "_" + this.locale + UiBinderLocalizedCreator.TEMPLATE_SUFFIX; Resource templateResource = reourceMap.get(templatePath); if (templateResource == null) { this.locale = null; templatePath = packageResourcePath + this.templateName + UiBinderLocalizedCreator.TEMPLATE_SUFFIX; templateResource = reourceMap.get(templatePath); } if (templateResource != null) { this.templateName = templatePath.replace(packageResourcePath, ""); } return templateResource; }