@Override
public void run() {
ui = new WizardSectionsUi(sections);
BorderLayoutBuilder layout = new BorderLayoutBuilder(0, 20).north(ui).center("Wizard goes here");
setIndex(0);
QuickFrame frame = new QuickFrame(layout, "Wizard Sections");
frame.addKeyBinding("next", KeyUtils.RIGHT, new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
int nextIndex = index + 1;
setIndex(Math.min(nextIndex, sections.length - 1));
}
});
frame.addKeyBinding("previous", KeyUtils.LEFT, new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
int nextIndex = index - 1;
setIndex(Math.max(0, nextIndex));
}
});
frame.publish();
}