From c9d828643471890c2812f7d959a98ea8cb135fb8 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Mon, 02 Apr 2007 15:07:10 +0000
Subject: [PATCH] further refactorings to delegate application logic to Application classes in addition to basic upgrade tool implementation classes and scripts
---
opends/src/quicksetup/org/opends/quicksetup/ui/StepsPanel.java | 39 +++++++++++++++------------------------
1 files changed, 15 insertions(+), 24 deletions(-)
diff --git a/opends/src/quicksetup/org/opends/quicksetup/ui/StepsPanel.java b/opends/src/quicksetup/org/opends/quicksetup/ui/StepsPanel.java
index 40e274f..93e5226 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/ui/StepsPanel.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/ui/StepsPanel.java
@@ -38,6 +38,7 @@
import javax.swing.JPanel;
import org.opends.quicksetup.Step;
+import org.opends.quicksetup.Application;
/**
* This class displays the different steps of the wizard. It appears on the
@@ -47,7 +48,7 @@
* The current displayed step can be changed calling the method setCurrentStep.
*
*/
-class StepsPanel extends QuickSetupPanel
+public class StepsPanel extends QuickSetupPanel
{
private static final long serialVersionUID = -2003945907121690657L;
@@ -57,11 +58,11 @@
/**
* Creates a StepsPanel.
- * @param isUninstall tells whether we are installing or uninstalling.
+ * @param app Application whose steps this class represents
*/
- public StepsPanel(boolean isUninstall)
+ public StepsPanel(Application app)
{
- createLayout(isUninstall);
+ createLayout(app);
}
/**
@@ -95,9 +96,9 @@
/**
* Creates the layout of the panel.
- * @param isUninstall tells whether we are installing or uninstalling.
+ * @param app Application whose steps this class represents
*/
- private void createLayout(boolean isUninstall)
+ private void createLayout(Application app)
{
setLayout(new GridBagLayout());
@@ -112,25 +113,15 @@
HashMap<Step, String> hmText = new HashMap<Step, String>();
ArrayList<Step> orderedSteps = new ArrayList<Step>();
- if (isUninstall)
- {
- hmText.put(Step.CONFIRM_UNINSTALL, getMsg("confirm-uninstall-step"));
- hmText.put(Step.PROGRESS, getMsg("progress-step"));
- orderedSteps.add(Step.CONFIRM_UNINSTALL);
- orderedSteps.add(Step.PROGRESS);
- } else
- {
- hmText.put(Step.WELCOME, getMsg("welcome-step"));
- hmText.put(Step.SERVER_SETTINGS, getMsg("server-settings-step"));
- hmText.put(Step.DATA_OPTIONS, getMsg("data-options-step"));
- hmText.put(Step.REVIEW, getMsg("review-step"));
- hmText.put(Step.PROGRESS, getMsg("progress-step"));
- orderedSteps.add(Step.WELCOME);
- orderedSteps.add(Step.SERVER_SETTINGS);
- orderedSteps.add(Step.DATA_OPTIONS);
- orderedSteps.add(Step.REVIEW);
- orderedSteps.add(Step.PROGRESS);
+
+ Step step = app.getFirstWizardStep();
+ hmText.put(step, getMsg(step.getMessageKey()));
+ orderedSteps.add(step);
+ while (null != (step = app.getNextWizardStep(step))) {
+ hmText.put(step, getMsg(step.getMessageKey()));
+ orderedSteps.add(step);
}
+
for (Step s : orderedSteps)
{
if (s != orderedSteps.get(0))
--
Gitblit v1.10.0