diff --git a/addon-manager/impl/src/main/java/org/jboss/forge/addon/manager/impl/commands/AddonCommand.java b/addon-manager/impl/src/main/java/org/jboss/forge/addon/manager/impl/commands/AddonCommand.java
index b1ba77b716..15663c3e62 100644
--- a/addon-manager/impl/src/main/java/org/jboss/forge/addon/manager/impl/commands/AddonCommand.java
+++ b/addon-manager/impl/src/main/java/org/jboss/forge/addon/manager/impl/commands/AddonCommand.java
@@ -3,6 +3,7 @@
import javax.enterprise.inject.Vetoed;
import javax.inject.Inject;
+import org.jboss.forge.ui.UIBuilder;
import org.jboss.forge.ui.UICommand;
import org.jboss.forge.ui.UICommandMetadata;
import org.jboss.forge.ui.UIContext;
@@ -45,32 +46,32 @@ public UICommandMetadata getMetadata()
}
@Override
- public void initializeUI(UIContext context) throws Exception
+ public void initializeUI(UIBuilder builder) throws Exception
{
- initializeGroupIdInput(context);
- initializeNameInput(context);
- initializeVersionInput(context);
+ initializeGroupIdInput(builder);
+ initializeNameInput(builder);
+ initializeVersionInput(builder);
}
- private void initializeGroupIdInput(UIContext context)
+ private void initializeGroupIdInput(UIBuilder builder)
{
groupId.setLabel("Group Id:");
groupId.setRequired(true);
- context.getUIBuilder().add(groupId);
+ builder.add(groupId);
}
- private void initializeNameInput(UIContext context)
+ private void initializeNameInput(UIBuilder builder)
{
name.setLabel("Name:");
name.setRequired(true);
- context.getUIBuilder().add(name);
+ builder.add(name);
}
- private void initializeVersionInput(UIContext context)
+ private void initializeVersionInput(UIBuilder builder)
{
version.setLabel("Version:");
version.setRequired(true);
- context.getUIBuilder().add(version);
+ builder.add(version);
}
@Override
diff --git a/addon-manager/impl/src/main/java/org/jboss/forge/addon/manager/impl/commands/AddonRemoveCommandNew.java b/addon-manager/impl/src/main/java/org/jboss/forge/addon/manager/impl/commands/AddonRemoveCommandNew.java
index fd337a641d..5a742dfb29 100644
--- a/addon-manager/impl/src/main/java/org/jboss/forge/addon/manager/impl/commands/AddonRemoveCommandNew.java
+++ b/addon-manager/impl/src/main/java/org/jboss/forge/addon/manager/impl/commands/AddonRemoveCommandNew.java
@@ -9,6 +9,7 @@
import org.jboss.forge.container.Forge;
import org.jboss.forge.ui.Result;
import org.jboss.forge.ui.Results;
+import org.jboss.forge.ui.UIBuilder;
import org.jboss.forge.ui.UICommand;
import org.jboss.forge.ui.UICommandMetadata;
import org.jboss.forge.ui.UIContext;
@@ -36,16 +37,16 @@ public boolean isEnabled(UIContext context)
public UICommandMetadata getMetadata()
{
return new UICommandMetadataBase(
- ADDON_REMOVE_COMMAND_NAME,
+ ADDON_REMOVE_COMMAND_NAME,
ADDON_REMOVE_COMMAND_DESCRIPTION);
}
@Override
- public void initializeUI(UIContext context) throws Exception
+ public void initializeUI(UIBuilder builder) throws Exception
{
addons.setLabel("Installed addons");
addons.setValueChoices(forge.getRepository().listEnabled());
- context.getUIBuilder().add(addons);
+ builder.add(addons);
}
@Override
diff --git a/aesh/src/main/java/org/jboss/forge/aesh/ShellContext.java b/aesh/src/main/java/org/jboss/forge/aesh/ShellContext.java
index 3d34fd01ce..935a4d01f7 100644
--- a/aesh/src/main/java/org/jboss/forge/aesh/ShellContext.java
+++ b/aesh/src/main/java/org/jboss/forge/aesh/ShellContext.java
@@ -6,17 +6,16 @@
*/
package org.jboss.forge.aesh;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
import org.jboss.forge.ui.UIBuilder;
import org.jboss.forge.ui.UIContext;
-import org.jboss.forge.ui.UIInput;
import org.jboss.forge.ui.UIInputComponent;
import org.jboss.forge.ui.UISelection;
import org.jboss.forge.ui.UIValidationContext;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
/**
* @author Ståle W. Pedersen
*/
@@ -77,7 +76,7 @@ public void addValidationError(UIInputComponent, ?> input, String errorMessage
}
@Override
- public UIBuilder getUIBuilder()
+ public UIContext getUIContext()
{
return this;
}
diff --git a/aesh/src/main/java/org/jboss/forge/aesh/commands/BaseExitCommand.java b/aesh/src/main/java/org/jboss/forge/aesh/commands/BaseExitCommand.java
index 3bd2add365..6cb30f280b 100644
--- a/aesh/src/main/java/org/jboss/forge/aesh/commands/BaseExitCommand.java
+++ b/aesh/src/main/java/org/jboss/forge/aesh/commands/BaseExitCommand.java
@@ -12,6 +12,7 @@
import org.jboss.forge.aesh.ShellContext;
import org.jboss.forge.ui.Result;
import org.jboss.forge.ui.Results;
+import org.jboss.forge.ui.UIBuilder;
import org.jboss.forge.ui.UICommand;
import org.jboss.forge.ui.UICommandMetadata;
import org.jboss.forge.ui.UIContext;
@@ -40,7 +41,7 @@ public boolean isEnabled(UIContext context)
}
@Override
- public void initializeUI(UIContext context) throws Exception
+ public void initializeUI(UIBuilder context) throws Exception
{
}
diff --git a/aesh/src/main/java/org/jboss/forge/aesh/commands/ClearCommand.java b/aesh/src/main/java/org/jboss/forge/aesh/commands/ClearCommand.java
index 148db21162..51758b6afe 100644
--- a/aesh/src/main/java/org/jboss/forge/aesh/commands/ClearCommand.java
+++ b/aesh/src/main/java/org/jboss/forge/aesh/commands/ClearCommand.java
@@ -12,6 +12,7 @@
import org.jboss.forge.aesh.ShellContext;
import org.jboss.forge.ui.Result;
import org.jboss.forge.ui.Results;
+import org.jboss.forge.ui.UIBuilder;
import org.jboss.forge.ui.UICommand;
import org.jboss.forge.ui.UICommandMetadata;
import org.jboss.forge.ui.UIContext;
@@ -48,11 +49,11 @@ public boolean isEnabled(UIContext context)
}
@Override
- public void initializeUI(UIContext context) throws Exception
+ public void initializeUI(UIBuilder builder) throws Exception
{
clear.setLabel("clear");
clear.setRequired(true);
- context.getUIBuilder().add(clear);
+ builder.add(clear);
}
@Override
diff --git a/aesh/src/main/java/org/jboss/forge/aesh/commands/ListServicesCommand.java b/aesh/src/main/java/org/jboss/forge/aesh/commands/ListServicesCommand.java
index 1b181d9f24..e1f7fb4b84 100644
--- a/aesh/src/main/java/org/jboss/forge/aesh/commands/ListServicesCommand.java
+++ b/aesh/src/main/java/org/jboss/forge/aesh/commands/ListServicesCommand.java
@@ -19,6 +19,7 @@
import org.jboss.forge.container.AddonRegistry;
import org.jboss.forge.ui.Result;
import org.jboss.forge.ui.Results;
+import org.jboss.forge.ui.UIBuilder;
import org.jboss.forge.ui.UICommand;
import org.jboss.forge.ui.UICommandMetadata;
import org.jboss.forge.ui.UIContext;
@@ -51,7 +52,7 @@ public boolean isEnabled(UIContext context)
}
@Override
- public void initializeUI(UIContext context) throws Exception
+ public void initializeUI(UIBuilder builder) throws Exception
{
}
diff --git a/aesh/src/main/java/org/jboss/forge/aesh/commands/LsCommand.java b/aesh/src/main/java/org/jboss/forge/aesh/commands/LsCommand.java
index 57cb29bc95..13e69325c7 100644
--- a/aesh/src/main/java/org/jboss/forge/aesh/commands/LsCommand.java
+++ b/aesh/src/main/java/org/jboss/forge/aesh/commands/LsCommand.java
@@ -1,17 +1,27 @@
package org.jboss.forge.aesh.commands;
-import org.jboss.aesh.console.Config;
-import org.jboss.aesh.util.Parser;
-import org.jboss.forge.aesh.ShellContext;
-import org.jboss.forge.ui.*;
-import org.jboss.forge.ui.base.UICommandMetadataBase;
-
-import javax.inject.Inject;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import javax.inject.Inject;
+
+import org.jboss.aesh.util.Parser;
+import org.jboss.forge.aesh.ShellContext;
+import org.jboss.forge.ui.Result;
+import org.jboss.forge.ui.Results;
+import org.jboss.forge.ui.UIBuilder;
+import org.jboss.forge.ui.UICommand;
+import org.jboss.forge.ui.UICommandMetadata;
+import org.jboss.forge.ui.UICompleter;
+import org.jboss.forge.ui.UIContext;
+import org.jboss.forge.ui.UIInput;
+import org.jboss.forge.ui.UIInputComponent;
+import org.jboss.forge.ui.UIInputMany;
+import org.jboss.forge.ui.UIValidationContext;
+import org.jboss.forge.ui.base.UICommandMetadataBase;
+
/**
* @author Ståle W. Pedersen
*/
@@ -36,7 +46,7 @@ public boolean isEnabled(UIContext context)
}
@Override
- public void initializeUI(UIContext context) throws Exception
+ public void initializeUI(UIBuilder builder) throws Exception
{
about.setLabel("about");
about.setRequired(false);
@@ -50,7 +60,7 @@ public Iterable getCompletionProposals(UIInputComponent,String> input,
return out;
}
});
- context.getUIBuilder().add(about);
+ builder.add(about);
arguments.setLabel("");
arguments.setRequired(false);
@@ -65,7 +75,7 @@ public Iterable getCompletionProposals(UIInputComponent,String> input,
}
}); */
- context.getUIBuilder().add(arguments);
+ builder.add(arguments);
}
@Override
diff --git a/aesh/src/test/java/org/jboss/forge/aesh/FooCommand.java b/aesh/src/test/java/org/jboss/forge/aesh/FooCommand.java
index 9862ec365d..ad274df7f1 100644
--- a/aesh/src/test/java/org/jboss/forge/aesh/FooCommand.java
+++ b/aesh/src/test/java/org/jboss/forge/aesh/FooCommand.java
@@ -6,15 +6,24 @@
*/
package org.jboss.forge.aesh;
-import org.jboss.forge.container.services.Exported;
-import org.jboss.forge.ui.*;
-import org.jboss.forge.ui.base.UICommandMetadataBase;
-
-import javax.inject.Inject;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
+import javax.inject.Inject;
+
+import org.jboss.forge.container.services.Exported;
+import org.jboss.forge.ui.Result;
+import org.jboss.forge.ui.Results;
+import org.jboss.forge.ui.UIBuilder;
+import org.jboss.forge.ui.UICommand;
+import org.jboss.forge.ui.UICommandMetadata;
+import org.jboss.forge.ui.UICompleter;
+import org.jboss.forge.ui.UIContext;
+import org.jboss.forge.ui.UIInput;
+import org.jboss.forge.ui.UIInputComponent;
+import org.jboss.forge.ui.UIValidationContext;
+import org.jboss.forge.ui.base.UICommandMetadataBase;
+
/**
* @author Ståle W. Pedersen
*/
@@ -27,11 +36,11 @@ public class FooCommand implements UICommand
@Inject
private UIInput foo;
- @Inject
- private UIInput bool;
+ @Inject
+ private UIInput bool;
- @Inject
- private UIInput bar;
+ @Inject
+ private UIInput bar;
@Override
public UICommandMetadata getMetadata()
@@ -46,24 +55,23 @@ public boolean isEnabled(UIContext context)
}
@Override
- public void initializeUI(UIContext context) throws Exception
+ public void initializeUI(UIBuilder builder) throws Exception
{
name.setLabel("foo");
name.setRequired(true);
- foo.setCompleter(new UICompleter() {
- @Override
- public Iterable getCompletionProposals(UIInputComponent,String> input, String value) {
- List out = new ArrayList();
- out.add("foo1");
- return out;
- }
- });
+ foo.setCompleter(new UICompleter()
+ {
+ @Override
+ public Iterable getCompletionProposals(UIInputComponent, String> input, String value)
+ {
+ List out = new ArrayList();
+ out.add("foo1");
+ return out;
+ }
+ });
- context.getUIBuilder().add(name);
- context.getUIBuilder().add(foo);
- context.getUIBuilder().add(bool);
- context.getUIBuilder().add(bar);
+ builder.add(name).add(foo).add(bool).add(bar);
}
@Override
diff --git a/aesh/src/test/java/org/jboss/forge/aesh/util/CommandLineUtilTest.java b/aesh/src/test/java/org/jboss/forge/aesh/util/CommandLineUtilTest.java
index 3ca3cecd73..37a29b3d02 100644
--- a/aesh/src/test/java/org/jboss/forge/aesh/util/CommandLineUtilTest.java
+++ b/aesh/src/test/java/org/jboss/forge/aesh/util/CommandLineUtilTest.java
@@ -6,12 +6,16 @@
*/
package org.jboss.forge.aesh.util;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
import org.jboss.aesh.cl.CommandLine;
import org.jboss.aesh.cl.CommandLineParser;
import org.jboss.aesh.cl.OptionBuilder;
import org.jboss.aesh.cl.internal.ParameterInt;
import org.jboss.forge.aesh.ShellContext;
import org.jboss.forge.ui.Result;
+import org.jboss.forge.ui.UIBuilder;
import org.jboss.forge.ui.UICommand;
import org.jboss.forge.ui.UICommandMetadata;
import org.jboss.forge.ui.UIContext;
@@ -22,8 +26,6 @@
import org.junit.Ignore;
import org.junit.Test;
-import static org.junit.Assert.*;
-
/**
* @author Ståle W. Pedersen
*/
@@ -35,7 +37,7 @@ public CommandLineUtilTest(String name)
{
}
- @Test
+ @Test
public void testGenerateParser() throws Exception
{
ShellContext context = new ShellContext(null);
@@ -56,7 +58,7 @@ public void testGenerateParser() throws Exception
}
- @Test
+ @Test
public void testPopulateUIInputs()
{
UIInput input1 = new UIInputImpl("str", String.class);
@@ -94,7 +96,7 @@ public void testPopulateUIInputs()
assertNull(input2.getValue());
}
- @Test
+ @Test
public void testGenerateAndPopulate() throws Exception
{
ShellContext context = new ShellContext(null);
@@ -123,7 +125,7 @@ public boolean isEnabled(UIContext context)
}
@Override
- public void initializeUI(UIContext context) throws Exception
+ public void initializeUI(UIBuilder builder) throws Exception
{
}
@@ -151,13 +153,12 @@ public UICommandMetadata getMetadata()
}
@Override
- public void initializeUI(UIContext context) throws Exception
+ public void initializeUI(UIBuilder builder) throws Exception
{
str = new UIInputImpl("str", String.class);
bool = new UIInputImpl("bool", Boolean.class);
- context.getUIBuilder().add(str);
- context.getUIBuilder().add(bool);
+ builder.add(str).add(bool);
}
}
diff --git a/projects/impl/src/main/java/org/jboss/forge/projects/impl/NewProjectCommand.java b/projects/impl/src/main/java/org/jboss/forge/projects/impl/NewProjectCommand.java
index 07eac019a7..0d0738e07f 100644
--- a/projects/impl/src/main/java/org/jboss/forge/projects/impl/NewProjectCommand.java
+++ b/projects/impl/src/main/java/org/jboss/forge/projects/impl/NewProjectCommand.java
@@ -12,6 +12,7 @@
import org.jboss.forge.resource.ResourceFactory;
import org.jboss.forge.ui.Result;
import org.jboss.forge.ui.Results;
+import org.jboss.forge.ui.UIBuilder;
import org.jboss.forge.ui.UICommand;
import org.jboss.forge.ui.UICommandMetadata;
import org.jboss.forge.ui.UIContext;
@@ -52,7 +53,7 @@ public boolean isEnabled(UIContext context)
}
@Override
- public void initializeUI(final UIContext context) throws Exception
+ public void initializeUI(final UIBuilder builder) throws Exception
{
named.setLabel("Project name");
@@ -60,7 +61,7 @@ public void initializeUI(final UIContext context) throws Exception
targetLocation.setLabel("Project location");
- UISelection> currentSelection = context.getInitialSelection();
+ UISelection> currentSelection = builder.getUIContext().getInitialSelection();
if (currentSelection != null)
{
Resource> resource = currentSelection.get();
@@ -87,7 +88,7 @@ public Boolean call() throws Exception
type.setRequired(false);
- context.getUIBuilder().add(named).add(targetLocation).add(overwrite).add(type);
+ builder.add(named).add(targetLocation).add(overwrite).add(type);
}
@Override
diff --git a/projects/tests/src/test/java/org/jboss/forge/projects/impl/NewProjectCommandTest.java b/projects/tests/src/test/java/org/jboss/forge/projects/impl/NewProjectCommandTest.java
index c346bbc9f0..4725efc4c8 100644
--- a/projects/tests/src/test/java/org/jboss/forge/projects/impl/NewProjectCommandTest.java
+++ b/projects/tests/src/test/java/org/jboss/forge/projects/impl/NewProjectCommandTest.java
@@ -67,52 +67,45 @@ public void testInvokeCommand() throws Exception
{
final List> inputs = new ArrayList>();
- final UIBuilder builder = new UIBuilder()
+ final UIContext context = new UIContext()
{
@Override
- public UIBuilder add(UIInputComponent, ?> input)
+ public UISelection getInitialSelection()
{
- inputs.add(input);
- return this;
+ return null;
}
};
-
- UIContext context = new UIContext()
+ final UIBuilder builder = new UIBuilder()
{
@Override
- public UIBuilder getUIBuilder()
+ public UIBuilder add(UIInputComponent, ?> input)
{
- return builder;
+ inputs.add(input);
+ return this;
}
@Override
- public UISelection getInitialSelection()
+ public UIContext getUIContext()
{
- return null;
+ return context;
}
};
- command.initializeUI(context);
+ command.initializeUI(builder);
command.getNamed().setValue("test");
command.validate(new UIValidationContext()
{
@Override
- public UIBuilder getUIBuilder()
+ public UIContext getUIContext()
{
- return builder;
+ return context;
}
@Override
public void addValidationError(UIInputComponent, ?> input, String errorMessage)
{
}
-
- @Override
- public UISelection getInitialSelection()
- {
- return null;
- }
});
DirectoryResource targetDirectory = command.getTargetLocation().getValue().getChildDirectory("test");
diff --git a/ui/api/src/main/java/org/jboss/forge/ui/UIBuilder.java b/ui/api/src/main/java/org/jboss/forge/ui/UIBuilder.java
index 46c65e8d1d..fa74905a38 100644
--- a/ui/api/src/main/java/org/jboss/forge/ui/UIBuilder.java
+++ b/ui/api/src/main/java/org/jboss/forge/ui/UIBuilder.java
@@ -7,7 +7,15 @@
package org.jboss.forge.ui;
-public interface UIBuilder
+/**
+ * Allows {@link UICommand} objects to specify the order of the displayed fields
+ *
+ * Each wizard page receives an unique instance of {@link UIBuilder}
+ *
+ * @author George Gastaldi
+ *
+ */
+public interface UIBuilder extends UIContextProvider
{
UIBuilder add(UIInputComponent, ?> input);
}
diff --git a/ui/api/src/main/java/org/jboss/forge/ui/UICommand.java b/ui/api/src/main/java/org/jboss/forge/ui/UICommand.java
index 391cf796bb..48a9cd4ebe 100644
--- a/ui/api/src/main/java/org/jboss/forge/ui/UICommand.java
+++ b/ui/api/src/main/java/org/jboss/forge/ui/UICommand.java
@@ -16,9 +16,9 @@ public interface UICommand
public boolean isEnabled(UIContext context);
- public void initializeUI(UIContext context) throws Exception;
+ public void initializeUI(UIBuilder builder) throws Exception;
- public void validate(UIValidationContext context);
+ public void validate(UIValidationContext validator);
public Result execute(UIContext context) throws Exception;
}
diff --git a/ui/api/src/main/java/org/jboss/forge/ui/UIContext.java b/ui/api/src/main/java/org/jboss/forge/ui/UIContext.java
index 1f7f4c5b31..845e6f447b 100644
--- a/ui/api/src/main/java/org/jboss/forge/ui/UIContext.java
+++ b/ui/api/src/main/java/org/jboss/forge/ui/UIContext.java
@@ -9,7 +9,5 @@
public interface UIContext
{
- UIBuilder getUIBuilder();
-
UISelection getInitialSelection();
}
diff --git a/ui/api/src/main/java/org/jboss/forge/ui/UIContextProvider.java b/ui/api/src/main/java/org/jboss/forge/ui/UIContextProvider.java
new file mode 100644
index 0000000000..2fa27e6705
--- /dev/null
+++ b/ui/api/src/main/java/org/jboss/forge/ui/UIContextProvider.java
@@ -0,0 +1,26 @@
+/*
+ * 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
+ */
+
+package org.jboss.forge.ui;
+
+/**
+ * Provides a {@link UIContext} object
+ *
+ * @author George Gastaldi
+ *
+ */
+public interface UIContextProvider
+{
+
+ /**
+ * Returns the {@link UIContext} that is shared through all the wizard screens
+ *
+ * @return
+ */
+ public abstract UIContext getUIContext();
+
+}
\ No newline at end of file
diff --git a/ui/api/src/main/java/org/jboss/forge/ui/UIValidationContext.java b/ui/api/src/main/java/org/jboss/forge/ui/UIValidationContext.java
index 9468d79f72..3d164c3672 100644
--- a/ui/api/src/main/java/org/jboss/forge/ui/UIValidationContext.java
+++ b/ui/api/src/main/java/org/jboss/forge/ui/UIValidationContext.java
@@ -7,7 +7,7 @@
package org.jboss.forge.ui;
-public interface UIValidationContext extends UIContext
+public interface UIValidationContext extends UIContextProvider
{
public void addValidationError(UIInputComponent, ?> input, String errorMessage);
}
diff --git a/ui/api/src/main/java/org/jboss/forge/ui/wizard/UIWizardContext.java b/ui/api/src/main/java/org/jboss/forge/ui/wizard/UIWizardContext.java
deleted file mode 100644
index de58800da7..0000000000
--- a/ui/api/src/main/java/org/jboss/forge/ui/wizard/UIWizardContext.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright 2012 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
- */
-
-package org.jboss.forge.ui.wizard;
-
-import org.jboss.forge.ui.UIContext;
-
-public interface UIWizardContext extends UIContext
-{
-
-}
diff --git a/ui/example/src/main/java/org/jboss/forge/ui/example/wizards/ExampleStepOne.java b/ui/example/src/main/java/org/jboss/forge/ui/example/wizards/ExampleStepOne.java
index 593e604c14..edbd6e18ef 100644
--- a/ui/example/src/main/java/org/jboss/forge/ui/example/wizards/ExampleStepOne.java
+++ b/ui/example/src/main/java/org/jboss/forge/ui/example/wizards/ExampleStepOne.java
@@ -4,6 +4,7 @@
import org.jboss.forge.ui.Result;
import org.jboss.forge.ui.Results;
+import org.jboss.forge.ui.UIBuilder;
import org.jboss.forge.ui.UICommandMetadata;
import org.jboss.forge.ui.UIContext;
import org.jboss.forge.ui.UIInput;
@@ -33,10 +34,10 @@ public UICommandMetadata getMetadata()
}
@Override
- public void initializeUI(UIContext context) throws Exception
+ public void initializeUI(UIBuilder builder) throws Exception
{
address.setLabel("Address:");
- context.getUIBuilder().add(address);
+ builder.add(address);
}
@Override
diff --git a/ui/example/src/main/java/org/jboss/forge/ui/example/wizards/ExampleStepTwo.java b/ui/example/src/main/java/org/jboss/forge/ui/example/wizards/ExampleStepTwo.java
index bed33a9143..364fa16e15 100644
--- a/ui/example/src/main/java/org/jboss/forge/ui/example/wizards/ExampleStepTwo.java
+++ b/ui/example/src/main/java/org/jboss/forge/ui/example/wizards/ExampleStepTwo.java
@@ -5,6 +5,7 @@
import org.jboss.forge.resource.DirectoryResource;
import org.jboss.forge.ui.Result;
import org.jboss.forge.ui.Results;
+import org.jboss.forge.ui.UIBuilder;
import org.jboss.forge.ui.UICommandMetadata;
import org.jboss.forge.ui.UIContext;
import org.jboss.forge.ui.UIInput;
@@ -34,10 +35,10 @@ public UICommandMetadata getMetadata()
}
@Override
- public void initializeUI(UIContext context) throws Exception
+ public void initializeUI(UIBuilder builder) throws Exception
{
location.setLabel("Location:");
- context.getUIBuilder().add(location);
+ builder.add(location);
}
@Override
diff --git a/ui/example/src/main/java/org/jboss/forge/ui/example/wizards/ExampleWizard.java b/ui/example/src/main/java/org/jboss/forge/ui/example/wizards/ExampleWizard.java
index 7b85fc3c50..255da73603 100644
--- a/ui/example/src/main/java/org/jboss/forge/ui/example/wizards/ExampleWizard.java
+++ b/ui/example/src/main/java/org/jboss/forge/ui/example/wizards/ExampleWizard.java
@@ -10,6 +10,7 @@
import org.jboss.forge.ui.Result;
import org.jboss.forge.ui.Results;
+import org.jboss.forge.ui.UIBuilder;
import org.jboss.forge.ui.UICommandMetadata;
import org.jboss.forge.ui.UIContext;
import org.jboss.forge.ui.UIInput;
@@ -31,9 +32,9 @@ public UICommandMetadata getMetadata()
}
@Override
- public void initializeUI(UIContext context) throws Exception
+ public void initializeUI(UIBuilder builder) throws Exception
{
- context.getUIBuilder().add(firstName);
+ builder.add(firstName);
}
@Override
diff --git a/ui/tests/src/test/java/org/jboss/forge/ui/MyFirstWizard.java b/ui/tests/src/test/java/org/jboss/forge/ui/MyFirstWizard.java
index 617efc370e..117055ac68 100644
--- a/ui/tests/src/test/java/org/jboss/forge/ui/MyFirstWizard.java
+++ b/ui/tests/src/test/java/org/jboss/forge/ui/MyFirstWizard.java
@@ -18,9 +18,9 @@ public class MyFirstWizard implements UIWizard
private UIInput firstName;
@Override
- public void initializeUI(UIContext context) throws Exception
+ public void initializeUI(UIBuilder builder) throws Exception
{
- context.getUIBuilder().add(firstName);
+ builder.add(firstName);
}
@Override
diff --git a/ui/tests/src/test/java/org/jboss/forge/ui/impl/MockChooseFrameworkStep.java b/ui/tests/src/test/java/org/jboss/forge/ui/impl/MockChooseFrameworkStep.java
index 6e9512969a..28ccf4c378 100644
--- a/ui/tests/src/test/java/org/jboss/forge/ui/impl/MockChooseFrameworkStep.java
+++ b/ui/tests/src/test/java/org/jboss/forge/ui/impl/MockChooseFrameworkStep.java
@@ -1,6 +1,7 @@
package org.jboss.forge.ui.impl;
import org.jboss.forge.ui.Result;
+import org.jboss.forge.ui.UIBuilder;
import org.jboss.forge.ui.UICommandMetadata;
import org.jboss.forge.ui.UIContext;
import org.jboss.forge.ui.UIValidationContext;
@@ -24,7 +25,7 @@ public UICommandMetadata getMetadata()
}
@Override
- public void initializeUI(UIContext context) throws Exception
+ public void initializeUI(UIBuilder builder) throws Exception
{
}
diff --git a/ui/tests/src/test/java/org/jboss/forge/ui/impl/MockNewProjectCommand.java b/ui/tests/src/test/java/org/jboss/forge/ui/impl/MockNewProjectCommand.java
index 0c31dcd028..3de5b8710c 100644
--- a/ui/tests/src/test/java/org/jboss/forge/ui/impl/MockNewProjectCommand.java
+++ b/ui/tests/src/test/java/org/jboss/forge/ui/impl/MockNewProjectCommand.java
@@ -8,6 +8,7 @@
import org.jboss.forge.container.services.Exported;
import org.jboss.forge.ui.Result;
import org.jboss.forge.ui.Results;
+import org.jboss.forge.ui.UIBuilder;
import org.jboss.forge.ui.UICommand;
import org.jboss.forge.ui.UICommandMetadata;
import org.jboss.forge.ui.UIContext;
@@ -37,7 +38,7 @@ public boolean isEnabled(UIContext context)
private UIInput useFramework;
@Override
- public void initializeUI(UIContext context) throws Exception
+ public void initializeUI(UIBuilder builder) throws Exception
{
projectDir.setRequired(false);
@@ -60,7 +61,7 @@ public File call()
// Define the order in builder
- context.getUIBuilder().add(projectName).add(projectDir);
+ builder.add(projectName).add(projectDir);
}
@Override