Esempio n. 1
0
  @Override
  public NavigationResult getSetupFlow(ScaffoldSetupContext setupContext) {
    Project project = setupContext.getProject();
    setProject(setupContext.getProject());
    NavigationResultBuilder builder = NavigationResultBuilder.create();
    List<Class<? extends UICommand>> setupCommands = new ArrayList<>();
    if (!project.hasFacet(JPAFacet.class)) {
      builder.add(JPASetupWizard.class);
    }
    if (!project.hasFacet(CDIFacet.class)) {
      setupCommands.add(CDISetupCommand.class);
    }
    if (!project.hasFacet(EJBFacet.class)) {
      setupCommands.add(EJBSetupWizard.class);
    }
    if (!project.hasFacet(ServletFacet.class)) {
      // TODO: FORGE-1296. Ensure that this wizard only sets up Servlet 3.0+
      setupCommands.add(ServletSetupWizard.class);
    }
    if (!project.hasFacet(FacesFacet.class)) {
      setupCommands.add(FacesSetupWizard.class);
    }

    Metadata compositeSetupMetadata =
        Metadata.forCommand(ScaffoldSetupWizard.class)
            .name("Setup Facets")
            .description("Setup all dependent facets for the Faces scaffold.");
    builder.add(compositeSetupMetadata, setupCommands);
    return builder.build();
  }
Esempio n. 2
0
 @Override
 public NavigationResult getPrerequisiteCommands(UIContext context) {
   NavigationResultBuilder builder = NavigationResultBuilder.create();
   Project project = getSelectedProject(context);
   if (project != null) {
     if (!project.hasFacet(RestFacet.class)) {
       builder.add(RestSetupWizard.class);
     }
   }
   return builder.build();
 }
Esempio n. 3
0
 @Override
 public NavigationResult getGenerationFlow(ScaffoldGenerationContext generationContext) {
   NavigationResultBuilder builder = NavigationResultBuilder.create();
   builder.add(ScaffoldableEntitySelectionWizard.class);
   return builder.build();
 }