From ae171bffab3d4c19c00de9a0c78e42a8f4bb9627 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Mon, 02 Apr 2007 22:25:59 +0000
Subject: [PATCH] - Succeeded in removing the Utils.isUninstall() method. All the logic that was being controlled by if statements using this method has been moved to the applications themselves (except for a few hacks that I've documented in the code)
---
opends/src/quicksetup/org/opends/quicksetup/ui/StepsPanel.java | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/opends/src/quicksetup/org/opends/quicksetup/ui/StepsPanel.java b/opends/src/quicksetup/org/opends/quicksetup/ui/StepsPanel.java
index 93e5226..b26d655 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/ui/StepsPanel.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/ui/StepsPanel.java
@@ -37,8 +37,8 @@
import javax.swing.JLabel;
import javax.swing.JPanel;
-import org.opends.quicksetup.Step;
import org.opends.quicksetup.Application;
+import org.opends.quicksetup.WizardStep;
/**
* This class displays the different steps of the wizard. It appears on the
@@ -52,9 +52,11 @@
{
private static final long serialVersionUID = -2003945907121690657L;
- HashMap<Step, JLabel> hmLabels = new HashMap<Step, JLabel>();
+ HashMap<WizardStep, JLabel> hmLabels = new HashMap<WizardStep, JLabel>();
- HashMap<Step, JLabel> hmIcons = new HashMap<Step, JLabel>();
+ HashMap<WizardStep, JLabel> hmIcons = new HashMap<WizardStep, JLabel>();
+
+ Application application = null;
/**
* Creates a StepsPanel.
@@ -62,6 +64,7 @@
*/
public StepsPanel(Application app)
{
+ this.application = app;
createLayout(app);
}
@@ -71,11 +74,11 @@
*
* @param step the step in the wizard.
*/
- public void setDisplayedStep(Step step)
+ public void setDisplayedStep(WizardStep step)
{
- for (Step s : Step.values())
+ for (WizardStep s : application.getWizardSteps())
{
- if (s == step)
+ if (s.equals(step))
{
getIcon(s).setVisible(true);
UIFactory.setTextStyle(getLabel(s), UIFactory.TextStyle.CURRENT_STEP);
@@ -111,10 +114,10 @@
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.anchor = GridBagConstraints.WEST;
- HashMap<Step, String> hmText = new HashMap<Step, String>();
- ArrayList<Step> orderedSteps = new ArrayList<Step>();
+ HashMap<WizardStep, String> hmText = new HashMap<WizardStep, String>();
+ ArrayList<WizardStep> orderedSteps = new ArrayList<WizardStep>();
- Step step = app.getFirstWizardStep();
+ WizardStep step = app.getFirstWizardStep();
hmText.put(step, getMsg(step.getMessageKey()));
orderedSteps.add(step);
while (null != (step = app.getNextWizardStep(step))) {
@@ -122,7 +125,7 @@
orderedSteps.add(step);
}
- for (Step s : orderedSteps)
+ for (WizardStep s : orderedSteps)
{
if (s != orderedSteps.get(0))
{
@@ -187,7 +190,7 @@
* @param step the step for which we want to retrieve the JLabel.
* @return the label associated with the given step.
*/
- private JLabel getLabel(Step step)
+ private JLabel getLabel(WizardStep step)
{
return hmLabels.get(step);
}
@@ -197,7 +200,7 @@
* @param step the step for which we want to retrieve the Icon.
* @return the icon associated with the given step.
*/
- private JLabel getIcon(Step step)
+ private JLabel getIcon(WizardStep step)
{
return hmIcons.get(step);
}
--
Gitblit v1.10.0