-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FORGE-808 Initial implementation of the F2 scaffold wizard
- Loading branch information
1 parent
3282502
commit bc5b692
Showing
6 changed files
with
193 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,74 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>scaffold-parent</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>scaffold</artifactId> | ||
<name>Forge - Scaffold Addon</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>scaffold-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>scaffold-impl</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>scaffold-spi</artifactId> | ||
<classifier>forge-addon</classifier> | ||
</dependency> | ||
|
||
<!-- Addon Dependencies --> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>scaffold-parent</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>scaffold</artifactId> | ||
<name>Forge - Scaffold Addon</name> | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>ui</artifactId> | ||
<classifier>forge-addon</classifier> | ||
<groupId>org.jboss.forge.furnace</groupId> | ||
<artifactId>container-cdi</artifactId> | ||
<version>2.0.0.Alpha7</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>projects</artifactId> | ||
<classifier>forge-addon</classifier> | ||
</dependency> | ||
|
||
<!-- Furnace Container --> | ||
<dependency> | ||
<groupId>org.jboss.forge.furnace</groupId> | ||
<artifactId>container-cdi</artifactId> | ||
<classifier>forge-addon</classifier> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>create-forge-addon</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
<configuration> | ||
<classifier>forge-addon</classifier> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</dependencies> | ||
</dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>scaffold-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>scaffold-impl</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>ui</artifactId> | ||
<classifier>forge-addon</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.addon</groupId> | ||
<artifactId>projects</artifactId> | ||
<classifier>forge-addon</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.furnace</groupId> | ||
<artifactId>container-cdi</artifactId> | ||
<classifier>forge-addon</classifier> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.forge.furnace</groupId> | ||
<artifactId>container-cdi</artifactId> | ||
<version>2.0.0.Alpha7</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>create-forge-addon</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
<configuration> | ||
<classifier>forge-addon</classifier> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
scaffold/impl/src/main/java/org/jboss/forge/scaffoldx/ScaffoldFromXWizard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package org.jboss.forge.scaffoldx; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.jboss.forge.addon.ui.context.UIBuilder; | ||
import org.jboss.forge.addon.ui.context.UIContext; | ||
import org.jboss.forge.addon.ui.context.UIValidationContext; | ||
import org.jboss.forge.addon.ui.input.UIInput; | ||
import org.jboss.forge.addon.ui.metadata.UICommandMetadata; | ||
import org.jboss.forge.addon.ui.metadata.WithAttributes; | ||
import org.jboss.forge.addon.ui.result.NavigationResult; | ||
import org.jboss.forge.addon.ui.result.Result; | ||
import org.jboss.forge.addon.ui.result.Results; | ||
import org.jboss.forge.addon.ui.util.Categories; | ||
import org.jboss.forge.addon.ui.util.Metadata; | ||
import org.jboss.forge.addon.ui.wizard.UIWizard; | ||
|
||
public class ScaffoldFromXWizard implements UIWizard { | ||
|
||
@Inject | ||
@WithAttributes(label = "type", required = true) | ||
UIInput<String> provider; | ||
|
||
@Override | ||
public UICommandMetadata getMetadata() { | ||
return Metadata.forCommand(getClass()).name("Scaffold from") | ||
.description("Scaffold UI using") | ||
.category(Categories.create("Project", "Generation")); | ||
} | ||
|
||
@Override | ||
public boolean isEnabled(UIContext context) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void initializeUI(UIBuilder builder) throws Exception { | ||
builder.add(provider); | ||
} | ||
|
||
@Override | ||
public void validate(UIValidationContext validator) { | ||
|
||
} | ||
|
||
@Override | ||
public Result execute(UIContext context) throws Exception { | ||
return Results.success(); | ||
} | ||
|
||
@Override | ||
public NavigationResult next(UIContext context) throws Exception { | ||
return null; | ||
/* if (provider.getValue().isInstalled()) { | ||
return Results | ||
.navigateTo(provider.getValue().selectResourcesStep()); | ||
} | ||
return Results.navigateTo(provider.getValue().setupStep());*/ | ||
} | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
scaffold/impl/src/main/java/org/jboss/forge/scaffoldx/ScaffoldSetupStep.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package org.jboss.forge.scaffoldx; | ||
|
||
import org.jboss.forge.addon.ui.context.UIBuilder; | ||
import org.jboss.forge.addon.ui.context.UIContext; | ||
import org.jboss.forge.addon.ui.context.UIValidationContext; | ||
import org.jboss.forge.addon.ui.metadata.UICommandMetadata; | ||
import org.jboss.forge.addon.ui.result.NavigationResult; | ||
import org.jboss.forge.addon.ui.result.Result; | ||
import org.jboss.forge.addon.ui.util.Metadata; | ||
import org.jboss.forge.addon.ui.wizard.UIWizardStep; | ||
|
||
public class ScaffoldSetupStep implements UIWizardStep { | ||
|
||
@Override | ||
public NavigationResult next(UIContext context) throws Exception { | ||
return null; | ||
} | ||
|
||
@Override | ||
public UICommandMetadata getMetadata() { | ||
return Metadata.forCommand(getClass()).name("Setup") | ||
.description("Setup scaffold provider"); | ||
} | ||
|
||
@Override | ||
public boolean isEnabled(UIContext context) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void initializeUI(UIBuilder builder) throws Exception { | ||
|
||
} | ||
|
||
@Override | ||
public void validate(UIValidationContext validator) { | ||
|
||
} | ||
|
||
@Override | ||
public Result execute(UIContext context) throws Exception { | ||
return null; | ||
} | ||
|
||
} |