@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();
}