Package org.jboss.forge.addon.scaffold.spi

Examples of org.jboss.forge.addon.scaffold.spi.ResourceCollection


   @Override
   public NavigationResult next(UINavigationContext context) throws Exception
   {
      UIContext uiContext = context.getUIContext();
      Map<Object, Object> attributeMap = uiContext.getAttributeMap();
      ResourceCollection resourceCollection = new ResourceCollection();
      if (targets.getValue() != null)
      {
         for (JavaClassSource klass : targets.getValue())
         {
            Project project = getSelectedProject(uiContext);
            JavaSourceFacet javaSource = project.getFacet(JavaSourceFacet.class);
            Resource<?> resource = javaSource.getJavaResource(klass);
            if (resource != null)
            {
               resourceCollection.addToCollection(resource);
            }
         }
      }

      attributeMap.put(ResourceCollection.class, resourceCollection);
View Full Code Here


   @Override
   public NavigationResult next(UINavigationContext context) throws Exception
   {
      UIContext uiContext = context.getUIContext();
      Map<Object, Object> attributeMap = uiContext.getAttributeMap();
      ResourceCollection resourceCollection = new ResourceCollection();
      if (targets.getValue() != null)
      {
         for (JavaClassSource klass : targets.getValue())
         {
            Project project = getSelectedProject(uiContext);
            JavaSourceFacet javaSource = project.getFacet(JavaSourceFacet.class);
            Resource<?> resource = javaSource.getJavaResource(klass);
            if (resource != null)
            {
               resourceCollection.addToCollection(resource);
            }
         }
      }

      attributeMap.put(ResourceCollection.class, resourceCollection);
View Full Code Here

   @Override
   public Result execute(final UIExecutionContext context) throws Exception
   {
      UIContext uiContext = context.getUIContext();
      ResourceCollection resourceCollection = (ResourceCollection) uiContext.getAttributeMap().get(
               ResourceCollection.class);

      targets = new ArrayList<>();
      for (Resource<?> resource : resourceCollection.getResources())
      {
         JavaResource javaResource = (JavaResource) resource;
         JavaClassSource javaClass = javaResource.getJavaType();
         targets.add(javaClass);
      }
View Full Code Here

   @Override
   public NavigationResult next(UINavigationContext context) throws Exception
   {
      UIContext uiContext = context.getUIContext();
      Map<Object, Object> attributeMap = uiContext.getAttributeMap();
      ResourceCollection resourceCollection = new ResourceCollection();
      if (targets.getValue() != null)
      {
         for (JavaClassSource klass : targets.getValue())
         {
            Project project = getSelectedProject(uiContext);
            JavaSourceFacet javaSource = project.getFacet(JavaSourceFacet.class);
            Resource<?> resource = javaSource.getJavaResource(klass);
            if (resource != null)
            {
               resourceCollection.addToCollection(resource);
            }
         }
      }

      attributeMap.put(ResourceCollection.class, resourceCollection);
View Full Code Here

   private UISelectMany<JavaClass> targets;

   @Override
   public NavigationResult next(UINavigationContext context) throws Exception
   {
      ResourceCollection resourceCollection = new ResourceCollection();
      if (targets.getValue() != null)
      {
         for (JavaClass klass : targets.getValue())
         {
            resourceCollection.addToCollection(klass);
         }
      }
      Map<Object, Object> attributeMap = context.getUIContext().getAttributeMap();

      attributeMap.put(ResourceCollection.class, resourceCollection);
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      Map<Object, Object> attributeMap = context.getUIContext().getAttributeMap();
      ScaffoldProvider selectedProvider = (ScaffoldProvider) attributeMap.get(ScaffoldProvider.class);
      ResourceCollection resourceCollection = (ResourceCollection) attributeMap.get(ResourceCollection.class);
      selectedProvider.generateFrom(getSelectedProject(context),
               populateGenerationContext(context.getUIContext(), resourceCollection.getResources()));
      return Results.success("Scaffold was generated successfully.");
   }
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      Map<Object, Object> attributeMap = context.getUIContext().getAttributeMap();
      ScaffoldProvider selectedProvider = (ScaffoldProvider) attributeMap.get(ScaffoldProvider.class);
      ResourceCollection resourceCollection = (ResourceCollection) attributeMap.get(ResourceCollection.class);
      selectedProvider.generateFrom(getSelectedProject(context),
               populateGenerationContext(context.getUIContext(), resourceCollection.getResources()));
      return Results.success("Scaffold was generated successfully.");
   }
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      Map<Object, Object> attributeMap = context.getUIContext().getAttributeMap();
      ScaffoldProvider selectedProvider = (ScaffoldProvider) attributeMap.get(ScaffoldProvider.class);
      ResourceCollection resourceCollection = (ResourceCollection) attributeMap.get(ResourceCollection.class);
      selectedProvider.generateFrom(getSelectedProject(context),
               populateGenerationContext(context.getUIContext(), resourceCollection.getResources()));
      return Results.success("Scaffold was generated successfully.");
   }
View Full Code Here

      if(requiresScaffoldSetup != null && (boolean) requiresScaffoldSetup == true)
      {
          ScaffoldSetupContext setupContext = (ScaffoldSetupContext) attributeMap.get(ScaffoldSetupContext.class);
          selectedProvider.setup(setupContext);
      }
      ResourceCollection resourceCollection = (ResourceCollection) attributeMap.get(ResourceCollection.class);
      // Ensure that the resource collection is instantiated. Prevents a null check in the scaffold provider.
      Collection<Resource<?>> resources = resourceCollection != null ? resourceCollection.getResources()
               : Collections.EMPTY_SET;
      selectedProvider.generateFrom(populateGenerationContext(context.getUIContext(), resources));
      return Results.success("Scaffold was generated successfully.");
   }
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      ScaffoldProvider selectedProvider = (ScaffoldProvider) context.getUIContext().getAttribute(ScaffoldProvider.class);
      ResourceCollection resourceCollection = (ResourceCollection) context.getUIContext().getAttribute(ResourceCollection.class);
      selectedProvider.generateFrom(getSelectedProject(context), populateGenerationContext(context.getUIContext(), resourceCollection.getResources()));
      return Results.success("Scaffold was generated successfully.");
   }
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.scaffold.spi.ResourceCollection

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.