-
Notifications
You must be signed in to change notification settings - Fork 35
/
ForgeMockWizard.java
54 lines (44 loc) · 1.4 KB
/
ForgeMockWizard.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* 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.tools.forge.ui.wizards.mock;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
import org.jboss.forge.ui.UIInput;
import org.jboss.tools.forge.ui.wizards.ForgeWizard;
public class ForgeMockWizard extends ForgeWizard implements INewWizard {
private List<UIInput<?>> inputs = new ArrayList<UIInput<?>>();
public ForgeMockWizard() {
setNeedsProgressMonitor(true);
}
@Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
inputs.add(new UIInputImpl<String>("First Name", String.class));
inputs.add(new UIInputImpl<String>("Last Name", String.class));
inputs.add(new UIInputImpl<GenderKind>("Gender", GenderKind.class));
inputs.add(new UIInputImpl<Boolean>("Accepts E-mail Notifications ?",
Boolean.class));
}
@Override
public void addPages() {
addPage(new ForgeMockWizardPage(inputs));
}
@Override
public boolean performFinish() {
for (UIInput<?> input : inputs) {
System.out.println("Input " + input.getName() + " - "
+ input.getValue());
}
return false;
}
@Override
public boolean needsPreviousAndNextButtons() {
return false;
}
}