-
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.
- Loading branch information
Showing
11 changed files
with
249 additions
and
52 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
13 changes: 0 additions & 13 deletions
13
ui/api/src/main/java/org/jboss/forge/ui/wizard/UIWizardBegin.java
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
ui/api/src/main/java/org/jboss/forge/ui/wizard/UIWizardEnd.java
This file was deleted.
Oops, something went wrong.
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
67 changes: 67 additions & 0 deletions
67
ui/example/src/main/java/org/jboss/forge/ui/example/wizards/ExampleStepOne.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,67 @@ | ||
package org.jboss.forge.ui.example.wizards; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.jboss.forge.ui.Result; | ||
import org.jboss.forge.ui.Results; | ||
import org.jboss.forge.ui.UICommand; | ||
import org.jboss.forge.ui.UICommandMetadata; | ||
import org.jboss.forge.ui.UIContext; | ||
import org.jboss.forge.ui.UIInput; | ||
import org.jboss.forge.ui.UISelection; | ||
import org.jboss.forge.ui.UIValidationContext; | ||
import org.jboss.forge.ui.base.UICommandMetadataBase; | ||
import org.jboss.forge.ui.wizard.UIWizard; | ||
import org.jboss.forge.ui.wizard.UIWizardStep; | ||
|
||
/* | ||
* Copyright 2013 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
public class ExampleStepOne implements UIWizardStep | ||
{ | ||
|
||
@Inject | ||
private UIInput<String> address; | ||
|
||
@Override | ||
public UICommandMetadata getMetadata() | ||
{ | ||
return new UICommandMetadataBase("Step 1", "Enter your Address"); | ||
} | ||
|
||
@Override | ||
public void initializeUI(UIContext context) throws Exception | ||
{ | ||
context.getUIBuilder().add(address); | ||
} | ||
|
||
@Override | ||
public void validate(UIValidationContext context) | ||
{ | ||
System.out.println("Validate"); | ||
} | ||
|
||
@Override | ||
public Result execute(UIContext context) throws Exception | ||
{ | ||
System.out.println("Step 1 Address: " + address.getValue()); | ||
return Results.success(); | ||
} | ||
|
||
@Override | ||
public boolean isEnabled(UIContext context) | ||
{ | ||
UISelection<?> selection = context.getInitialSelection(); | ||
return selection != null; | ||
} | ||
|
||
@Override | ||
public Class<? extends UIWizard> getSuccessor() | ||
{ | ||
return ExampleStepTwo.class; | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
ui/example/src/main/java/org/jboss/forge/ui/example/wizards/ExampleStepTwo.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,67 @@ | ||
package org.jboss.forge.ui.example.wizards; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.jboss.forge.resource.DirectoryResource; | ||
import org.jboss.forge.ui.Result; | ||
import org.jboss.forge.ui.Results; | ||
import org.jboss.forge.ui.UICommandMetadata; | ||
import org.jboss.forge.ui.UIContext; | ||
import org.jboss.forge.ui.UIInput; | ||
import org.jboss.forge.ui.UISelection; | ||
import org.jboss.forge.ui.UIValidationContext; | ||
import org.jboss.forge.ui.base.UICommandMetadataBase; | ||
import org.jboss.forge.ui.wizard.UIWizard; | ||
import org.jboss.forge.ui.wizard.UIWizardStep; | ||
|
||
/* | ||
* Copyright 2013 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
public class ExampleStepTwo implements UIWizardStep | ||
{ | ||
|
||
@Inject | ||
private UIInput<DirectoryResource> location; | ||
|
||
@Override | ||
public UICommandMetadata getMetadata() | ||
{ | ||
return new UICommandMetadataBase("Step 2", "Select a folder"); | ||
} | ||
|
||
@Override | ||
public void initializeUI(UIContext context) throws Exception | ||
{ | ||
context.getUIBuilder().add(location); | ||
} | ||
|
||
@Override | ||
public void validate(UIValidationContext context) | ||
{ | ||
System.out.println("Validate Step Two"); | ||
} | ||
|
||
@Override | ||
public Result execute(UIContext context) throws Exception | ||
{ | ||
System.out.println("Step Two Location: " + location.getValue()); | ||
return Results.success(); | ||
} | ||
|
||
@Override | ||
public boolean isEnabled(UIContext context) | ||
{ | ||
UISelection<?> selection = context.getInitialSelection(); | ||
return selection != null; | ||
} | ||
|
||
@Override | ||
public Class<? extends UIWizard> getSuccessor() | ||
{ | ||
return null; | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
ui/example/src/main/java/org/jboss/forge/ui/example/wizards/ExampleWizard.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,66 @@ | ||
package org.jboss.forge.ui.example.wizards; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.jboss.forge.ui.Result; | ||
import org.jboss.forge.ui.Results; | ||
import org.jboss.forge.ui.UICommand; | ||
import org.jboss.forge.ui.UICommandMetadata; | ||
import org.jboss.forge.ui.UIContext; | ||
import org.jboss.forge.ui.UIInput; | ||
import org.jboss.forge.ui.UISelection; | ||
import org.jboss.forge.ui.UIValidationContext; | ||
import org.jboss.forge.ui.base.UICommandMetadataBase; | ||
import org.jboss.forge.ui.wizard.UIWizard; | ||
|
||
/* | ||
* Copyright 2013 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
public class ExampleWizard implements UIWizard | ||
{ | ||
|
||
@Inject | ||
private UIInput<String> firstName; | ||
|
||
@Override | ||
public UICommandMetadata getMetadata() | ||
{ | ||
return new UICommandMetadataBase("Wizard", "Exit the shell"); | ||
} | ||
|
||
@Override | ||
public void initializeUI(UIContext context) throws Exception | ||
{ | ||
context.getUIBuilder().add(firstName); | ||
} | ||
|
||
@Override | ||
public void validate(UIValidationContext context) | ||
{ | ||
System.out.println("Validate"); | ||
} | ||
|
||
@Override | ||
public Result execute(UIContext context) throws Exception | ||
{ | ||
return Results.success(); | ||
} | ||
|
||
@Override | ||
public boolean isEnabled(UIContext context) | ||
{ | ||
UISelection<?> selection = context.getInitialSelection(); | ||
return selection != null; | ||
} | ||
|
||
@Override | ||
public Class<? extends UIWizard> getSuccessor() | ||
{ | ||
return ExampleStepOne.class; | ||
} | ||
|
||
} |
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