org.jboss.forge.addon.resource.ResourceFactory Java Examples

The following examples show how to use org.jboss.forge.addon.resource.ResourceFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProjectGenerator.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
public ProjectGenerator(Furnace furnace, File projectsOutputFolder, File localMavenRepo) throws Exception {
    this.furnace = furnace;
    this.projectsOutputFolder = projectsOutputFolder;
    this.localMavenRepo = localMavenRepo;
    addonRegistry = furnace.getAddonRegistry();

    resourceFactory = addonRegistry.getServices(ResourceFactory.class).get();
    commandControllerFactory = addonRegistry.getServices(CommandControllerFactory.class).get();
    commandFactory = addonRegistry.getServices(CommandFactory.class).get();

}
 
Example #2
Source File: CommandsResource.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
protected ResourceFactory getResourceFactory() {
    AddonRegistry addonRegistry = furnace.getAddonRegistry();
    Imported<ResourceFactory> resourceFactoryImport = addonRegistry.getServices(ResourceFactory.class);
    ResourceFactory resourceFactory = null;
    try {
        resourceFactory = resourceFactoryImport.get();
    } catch (Exception e) {
        LOG.warn("Failed to get ResourceFactory injected: " + e, e);
    }
    if (resourceFactory == null) {
        // lets try one more time - might work this time?
        resourceFactory = resourceFactoryImport.get();
    }
    return resourceFactory;
}
 
Example #3
Source File: DetailTemplateStrategy.java    From angularjs-addon with Eclipse Public License 1.0 5 votes vote down vote up
public DetailTemplateStrategy(WebResourcesFacet web, ResourceFactory resourceFactory, Project project,
         TemplateFactory templateFactory, Map<String, Object> dataModel)
{
   this.web = web;
   this.resourceFactory = resourceFactory;
   this.project = project;
   this.templateFactory = templateFactory;
   this.dataModel = dataModel;
}
 
Example #4
Source File: SearchTemplateStrategy.java    From angularjs-addon with Eclipse Public License 1.0 5 votes vote down vote up
public SearchTemplateStrategy(WebResourcesFacet web, ResourceFactory resourceFactory, Project project,
         TemplateFactory templateFactory, Map<String, Object> dataModel)
{
   this.web = web;
   this.resourceFactory = resourceFactory;
   this.project = project;
   this.templateFactory = templateFactory;
   this.dataModel = dataModel;
}
 
Example #5
Source File: ProcessTemplateStrategy.java    From angularjs-addon with Eclipse Public License 1.0 5 votes vote down vote up
public ProcessTemplateStrategy(WebResourcesFacet web, ResourceFactory resourceFactory, Project project,
         TemplateFactory templateFactory, Map<String, Object> dataModel)
{
   this.web = web;
   this.resourceFactory = resourceFactory;
   this.project = project;
   this.templateFactory = templateFactory;
   this.dataModel = dataModel;
}
 
Example #6
Source File: CommandsResource.java    From fabric8-forge with Apache License 2.0 4 votes vote down vote up
public RestUIContext createUIContext(File file) {
    ResourceFactory resourceFactory = getResourceFactory();
    Resource<File> selection = resourceFactory.create(file);
    return new RestUIContext(selection);
}