List of usage examples for com.google.gwt.dev.resource ResourceOracle getResources
Set<Resource> getResources();
From source file:fr.putnami.pwt.core.widget.rebind.UiBinderLocalizedCreator.java
License:Open Source License
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); }/*w ww .j ava 2s . co m*/ 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; }