@Override public WizardStep onNext(final StartupWizardModel model) { final WizardStep next = super.onNext(model); if (next instanceof SelectPluginsStep) { final SelectPluginsStep selectPluginsStep = (SelectPluginsStep)next; final String id = selectPluginsStep.getRequirePlugin(); if (id != null && model.getDisabledPluginIds().contains(id) && !model.isLast(next)) { for (IdeaPluginDescriptor descriptor: selectPluginsStep.getPlugins()) { model.getDisabledPluginIds().add(descriptor.getPluginId().getIdString()); } return model.getNextFor(next); } } return next; }
@Override public WizardStep onPrevious(final StartupWizardModel model) { final WizardStep prev = super.onPrevious(model); if (prev instanceof SelectPluginsStep) { final SelectPluginsStep selectPluginsStep = (SelectPluginsStep)prev; final String id = selectPluginsStep.getRequirePlugin(); if (id != null && model.getDisabledPluginIds().contains(id) && !model.isFirst(prev)) { return model.getPreviousFor(prev); } } return prev; }
@Override public WizardStep onNext(final AddLibraryWizardModel model) { if (doValidate() == null) { model.setSelectedLibrary((AzureLibrary) libraryList.getSelectedValue()); // ((LibraryPropertiesStep) model.getNextFor(this)).setAzureLibrary((AzureLibrary) libraryList.getSelectedValue()); return super.onNext(model); } else { return this; } }
@Override public WizardStep onNext(final AzureWizardModel model) { if (doValidate() == null) { return super.onNext(model); } else { return this; } }
@Override public WizardStep onNext(final AzureWizardModel model) { int currentTab = jdkServerPanel.getSelectedIndex(); if (currentTab == 2) { return super.onNext(model); } else { jdkServerPanel.setSelectedIndex(++currentTab); return this; } }
@Override public WizardStep onPrevious(final AzureWizardModel model) { int currentTab = jdkServerPanel.getSelectedIndex(); if (currentTab == 0) { return super.onPrevious(model); } else { jdkServerPanel.setSelectedIndex(--currentTab); return this; } }
private WizardStep<ForgeWizardModel> navigate(boolean forward) { // If it's not a wizard, we don't care if (!(navigationState.isWizardController())) { return null; } try { CommandController nextController; if (forward) { nextController = navigationState.getWizardCommandController().next(); } else { nextController = navigationState.getWizardCommandController().previous(); } return new ForgeWizardStep(this.model, nextController); } catch (Exception e) { model.getDialog().setErrorMessage(e.getMessage()); e.printStackTrace(); return this; } }
@Override public WizardStep<ForgeWizardModel> onNext(ForgeWizardModel model) { return navigate(true); }
@Override public WizardStep<ForgeWizardModel> onPrevious(ForgeWizardModel model) { return navigate(false); }