Skip to content

Commit

Permalink
FORGE-2247: Added example
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Feb 18, 2015
1 parent 6a90202 commit 49b410a
Showing 1 changed file with 15 additions and 3 deletions.
Expand Up @@ -7,6 +7,7 @@
package org.jboss.forge.addon.ui.example.wizards;

import java.util.Arrays;
import java.util.concurrent.Callable;

import javax.inject.Inject;

Expand Down Expand Up @@ -73,9 +74,20 @@ public Metadata getMetadata(UIContext context)
@Override
public void initializeUI(UIBuilder builder) throws Exception
{
firstName.setRequired(true).setRequiredMessage("First Name must be informed !");
valueWithSpaces.setValueChoices(Arrays.asList("Value 1", "Value 2", "Value 10", "Value 100"));
selectManyValues.setValueChoices(Arrays.asList("A", "B", "C", "AA", "BB"));
firstName.setRequired(true).setRequiredMessage("First Name must be informed !").setNote("This is a UIInput");
valueWithSpaces.setValueChoices(Arrays.asList("Value 1", "Value 2", "Value 10", "Value 100")).setNote(
"This is a UISelectOne");
selectManyValues.setValueChoices(Arrays.asList("A", "B", "C", "AA", "BB")).setNote("This is a UISelectMany");
manyValues.setNote("This is a UIInputMany");
directory.setNote(new Callable<String>()
{
@Override
public String call() throws Exception
{
DirectoryResource value = directory.getValue();
return value == null ? null : "Path: " + value.getFullyQualifiedName();
}
});
builder.add(firstName).add(showSelectComponents).add(goToLastStep).add(directory).add(valueWithSpaces)
.add(career).add(manyCareer).add(manyValues).add(selectManyValues);
}
Expand Down

0 comments on commit 49b410a

Please sign in to comment.