| | |
| | | package org.opends.quicksetup.uninstaller; |
| | | |
| | | import org.opends.quicksetup.*; |
| | | |
| | | import static org.opends.quicksetup.Step.FINISHED; |
| | | import static org.opends.quicksetup.Step.PROGRESS; |
| | | import static org.opends.quicksetup.Step.REVIEW; |
| | | import org.opends.quicksetup.ui.*; |
| | |
| | | if (step != null && step.equals(Step.CONFIRM_UNINSTALL)) { |
| | | nextStep = Step.PROGRESS; |
| | | } |
| | | else if (Step.PROGRESS.equals(step)) |
| | | { |
| | | nextStep = Step.FINISHED; |
| | | } |
| | | return nextStep; |
| | | } |
| | | |
| | |
| | | if (step != null && step.equals(Step.PROGRESS)) { |
| | | prevStep = Step.CONFIRM_UNINSTALL; |
| | | } |
| | | else if (Step.FINISHED.equals(step)) |
| | | { |
| | | prevStep = Step.PROGRESS; |
| | | } |
| | | return prevStep; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public WizardStep getFinishedStep() { |
| | | return Step.FINISHED; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean finishOnLeft() |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean canGoBack(WizardStep step) { |
| | | return false; |
| | | } |
| | |
| | | "Cannot click on next from progress step"); |
| | | } else if (cStep == REVIEW) { |
| | | throw new IllegalStateException("Cannot click on next from review step"); |
| | | } else if (cStep == FINISHED) { |
| | | throw new IllegalStateException( |
| | | "Cannot click on next from finished step"); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | qs.quit(); |
| | | } |
| | | } |
| | | else if (cStep == FINISHED) |
| | | { |
| | | qs.quit(); |
| | | } else { |
| | | throw new IllegalStateException( |
| | | "Close only can be clicked on PROGRESS step"); |
| | |
| | | throw new IllegalStateException( |
| | | "Cannot click on quit from progress step"); |
| | | } |
| | | else if (step == Step.FINISHED) { |
| | | throw new IllegalStateException( |
| | | "Cannot click on quit from finished step"); |
| | | } |
| | | qs.quit(); |
| | | } |
| | | |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | public void previousClicked(WizardStep cStep, QuickSetup qs) { |
| | | if (cStep == Step.PROGRESS) { |
| | | if (cStep == PROGRESS) { |
| | | throw new IllegalStateException( |
| | | "Cannot click on previous from progress step"); |
| | | } |
| | | else if (cStep == FINISHED) { |
| | | throw new IllegalStateException( |
| | | "Cannot click on previous from finished step"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | protected void setWizardDialogState(QuickSetupDialog dlg, |
| | | public void setWizardDialogState(QuickSetupDialog dlg, |
| | | UserData userData, |
| | | WizardStep step) { |
| | | if (step == Step.CONFIRM_UNINSTALL) { |
| | | dlg.setDefaultButton(ButtonName.FINISH); |
| | | dlg.setFocusOnButton(ButtonName.FINISH); |
| | | } else if (step == Step.PROGRESS) { |
| | | } else if ((step == PROGRESS) || (step == FINISHED)) { |
| | | dlg.setDefaultButton(ButtonName.CLOSE); |
| | | dlg.setFocusOnButton(ButtonName.CLOSE); |
| | | dlg.setButtonEnabled(ButtonName.CLOSE, false); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | protected String getInstallationPath() { |
| | | public String getInstallationPath() { |
| | | return Utils.getInstallPathFromClasspath(); |
| | | } |
| | | |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | public void windowClosing(QuickSetupDialog dlg, WindowEvent evt) { |
| | | if (dlg.getDisplayedStep() == Step.PROGRESS) { |
| | | if ((dlg.getDisplayedStep() == PROGRESS) || |
| | | (dlg.getDisplayedStep() == FINISHED)) { |
| | | // Simulate a close button event |
| | | dlg.notifyButtonEvent(ButtonName.CLOSE); |
| | | } else { |
| | |
| | | Set<WizardStep> setSteps = new HashSet<WizardStep>(); |
| | | setSteps.add(Step.CONFIRM_UNINSTALL); |
| | | setSteps.add(Step.PROGRESS); |
| | | setSteps.add(Step.FINISHED); |
| | | return Collections.unmodifiableSet(setSteps); |
| | | } |
| | | |
| | |
| | | p = new ConfirmUninstallPanel(this, installStatus); |
| | | } else if (step == Step.PROGRESS) { |
| | | p = new ProgressPanel(this); |
| | | } else if (step == Step.FINISHED) { |
| | | p = new FinishedPanel(this); |
| | | } |
| | | return p; |
| | | } |