public Object showWizard() { HashMap map = new HashMap(); map.put(DWizardDisplayerImpl.KEY_NAME, this.wizardPanelProvider.getClass().getSimpleName()); Wizard wizard = this.wizardPanelProvider.createWizard(); wizard.addWizardObserver(this.wizardObserver); // todo одно место для всех permissions if ((Application.getInstance() instanceof CuttingApp ? ((CuttingApp) Application.getInstance()) .getPermissionManager() .checkPermission(wizardPanelProvider) : true)) { return WizardDisplayer.showWizard(wizard, null, null, map); } return null; }
// for testing only public static void main(String[] args) { Wizard wiz = WizardPage.createWizard( new WizardPage[] {new CreateRecordsWizardPage()}, new WizardResultProducer() { public Object finish(Map settings) throws WizardException { System.out.println(settings); return settings; } public boolean cancel(Map settings) { return true; } }); WizardDisplayer.showWizard(wiz); }