6. s.createNextButton(e -> createNumber().show()));
return s;
}
public static SignupForm createNumber() {
return createMobileOrEmail("Mobile Number",
"What's Your Mobile Number?",
"Sign Up With Email Address",
TextArea.PHONENUMBER,
e -> createEmail().show());
}
private static SignupForm createMobileOrEmail(String formTitle,
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
SignupForm
7. e -> createEmail().show());
}
private static SignupForm createMobileOrEmail(String formTitle,
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(textEntry);
Button mobile = new Button(signUpWith, "BoldBlueLink");
mobile.addActionListener(goToOther);
s.south.addComponent(0, mobile);
s.content.addAll(title, textContainer,
SignupForm
8. e -> createEmail().show());
}
private static SignupForm createMobileOrEmail(String formTitle,
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(textEntry);
Button mobile = new Button(signUpWith, "BoldBlueLink");
mobile.addActionListener(goToOther);
s.south.addComponent(0, mobile);
s.content.addAll(title, textContainer,
SignupForm
9. e -> createEmail().show());
}
private static SignupForm createMobileOrEmail(String formTitle,
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(textEntry);
Button mobile = new Button(signUpWith, "BoldBlueLink");
mobile.addActionListener(goToOther);
s.south.addComponent(0, mobile);
s.content.addAll(title, textContainer,
SignupForm
10. String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(textEntry);
Button mobile = new Button(signUpWith, "BoldBlueLink");
mobile.addActionListener(goToOther);
s.south.addComponent(0, mobile);
s.content.addAll(title, textContainer,
s.createNextButton(e ->
createPassword(TextArea.PHONENUMBER == constraint,
textEntry.getText()).show()));
return s;
SignupForm
11. String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(textEntry);
Button mobile = new Button(signUpWith, "BoldBlueLink");
mobile.addActionListener(goToOther);
s.south.addComponent(0, mobile);
s.content.addAll(title, textContainer,
s.createNextButton(e ->
createPassword(TextArea.PHONENUMBER == constraint,
textEntry.getText()).show()));
return s;
SignupForm
12. String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(textEntry);
Button mobile = new Button(signUpWith, "BoldBlueLink");
mobile.addActionListener(goToOther);
s.south.addComponent(0, mobile);
s.content.addAll(title, textContainer,
s.createNextButton(e ->
createPassword(TextArea.PHONENUMBER == constraint,
textEntry.getText()).show()));
return s;
SignupForm
13. s.createNextButton(e -> createNumber().show()));
return s;
}
public static SignupForm createNumber() {
return createMobileOrEmail("Mobile Number",
"What's Your Mobile Number?",
"Sign Up With Email Address",
TextArea.PHONENUMBER,
e -> createEmail().show());
}
private static SignupForm createMobileOrEmail(String formTitle,
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
SignupForm
14. s.createNextButton(e -> createNumber().show()));
return s;
}
public static SignupForm createNumber() {
return createMobileOrEmail("Mobile Number",
"What's Your Mobile Number?",
"Sign Up With Email Address",
TextArea.PHONENUMBER,
e -> createEmail().show());
}
private static SignupForm createMobileOrEmail(String formTitle,
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
SignupForm
15. s.createNextButton(e -> createNumber().show()));
return s;
}
public static SignupForm createNumber() {
return createMobileOrEmail("Mobile Number",
"What's Your Mobile Number?",
"Sign Up With Email Address",
TextArea.PHONENUMBER,
e -> createEmail().show());
}
private static SignupForm createMobileOrEmail(String formTitle,
String subtitle, String signUpWith, int constraint,
ActionListener goToOther) {
SignupForm s = new SignupForm(formTitle, getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label(subtitle, "SignupSubHeader");
TextComponent textEntry = new TextComponent().
label(formTitle).
columns(20).
constraint(constraint);
SignupForm
16. s.south.addComponent(0, mobile);
s.content.addAll(title, textContainer,
s.createNextButton(e ->
createPassword(TextArea.PHONENUMBER == constraint,
textEntry.getText()).show()));
return s;
}
public static SignupForm createEmail() {
return createMobileOrEmail("Email Address",
"What's Your Email Address?",
"Sign Up With Mobile Number",
TextArea.EMAILADDR,
e -> createNumber().show());
}
public static SignupForm createPassword(boolean phone, String value) {
SignupForm s = new SignupForm("Password",
getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label("Choose a Password", "SignupSubHeader");
TextComponent password = new TextComponent().
SignupForm
19. "Sign Up With Mobile Number",
TextArea.EMAILADDR,
e -> createNumber().show());
}
public static SignupForm createPassword(boolean phone, String value) {
SignupForm s = new SignupForm("Password",
getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label("Choose a Password", "SignupSubHeader");
TextComponent password = new TextComponent().
label("Password").
columns(20);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(password);
s.content.addAll(title, textContainer,
s.createNextButton(e -> createConfirmation(phone, value).show()));
return s;
}
SignupForm
20. "Sign Up With Mobile Number",
TextArea.EMAILADDR,
e -> createNumber().show());
}
public static SignupForm createPassword(boolean phone, String value) {
SignupForm s = new SignupForm("Password",
getCurrentForm().getTitle(),
getCurrentForm());
Label title = new Label("Choose a Password", "SignupSubHeader");
TextComponent password = new TextComponent().
label("Password").
columns(20);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(password);
s.content.addAll(title, textContainer,
s.createNextButton(e -> createConfirmation(phone, value).show()));
return s;
}
SignupForm
21. s.createNextButton(e -> createConfirmation(phone, value).show()));
return s;
}
public static SignupForm createConfirmation(
boolean phone, String value) {
SignupForm s = new SignupForm("Account Confirmation", "Password",
getCurrentForm());
SpanLabel title;
if(phone) {
title = new SpanLabel("Enter the code from your mobile phone",
"SignupSubHeader");
} else {
title = new SpanLabel("Enter the code from your email",
"SignupSubHeader");
}
SpanLabel line;
if(phone) {
line = new SpanLabel("Let us know this phone belongs to you. "
+ "Enter the code in the SMS sent to " + value, "CenterLabel");
} else {
line = new SpanLabel("Let us know this email belongs to you. "
+ "Enter the code in the message sent to " + value,
SignupForm
23. s.createNextButton(e -> createConfirmation(phone, value).show()));
return s;
}
public static SignupForm createConfirmation(
boolean phone, String value) {
SignupForm s = new SignupForm("Account Confirmation", "Password",
getCurrentForm());
SpanLabel title;
if(phone) {
title = new SpanLabel("Enter the code from your mobile phone",
"SignupSubHeader");
} else {
title = new SpanLabel("Enter the code from your email",
"SignupSubHeader");
}
SpanLabel line;
if(phone) {
line = new SpanLabel("Let us know this phone belongs to you. "
+ "Enter the code in the SMS sent to " + value, "CenterLabel");
} else {
line = new SpanLabel("Let us know this email belongs to you. "
+ "Enter the code in the message sent to " + value,
SignupForm
24. "SignupSubHeader");
} else {
title = new SpanLabel("Enter the code from your email",
"SignupSubHeader");
}
SpanLabel line;
if(phone) {
line = new SpanLabel("Let us know this phone belongs to you. "
+ "Enter the code in the SMS sent to " + value, "CenterLabel");
} else {
line = new SpanLabel("Let us know this email belongs to you. "
+ "Enter the code in the message sent to " + value,
"CenterLabel");
}
TextComponent confirm = new TextComponent().
label("Confirmation Code").
columns(20).
constraint(TextArea.NUMERIC);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(confirm);
SignupForm
25. SpanLabel line;
if(phone) {
line = new SpanLabel("Let us know this phone belongs to you. "
+ "Enter the code in the SMS sent to " + value, "CenterLabel");
} else {
line = new SpanLabel("Let us know this email belongs to you. "
+ "Enter the code in the message sent to " + value,
"CenterLabel");
}
TextComponent confirm = new TextComponent().
label("Confirmation Code").
columns(20).
constraint(TextArea.NUMERIC);
Container textContainer = new Container(new TextModeLayout(1, 1),
"PaddedContainer");
textContainer.add(confirm);
Button done = s.createNextButton(e -> UIController.showMainUI());
done.setText("Confirm");
s.content.addAll(title, line, textContainer, done);
return s;
}
SignupForm