From 4cd4ffb2771ea2d133b30273b1ffea0fef6b4552 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Tue, 17 Apr 2007 20:23:12 +0000
Subject: [PATCH] This commit introduces preliminary versions of the upgrader tool's GUI wizard panels.  Effort has been made to make the panels conform to the design at

---
 opends/src/quicksetup/org/opends/quicksetup/ui/QuickSetupStepPanel.java |   61 ++++++++----------------------
 1 files changed, 17 insertions(+), 44 deletions(-)

diff --git a/opends/src/quicksetup/org/opends/quicksetup/ui/QuickSetupStepPanel.java b/opends/src/quicksetup/org/opends/quicksetup/ui/QuickSetupStepPanel.java
index ef04467..4ff3603 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/ui/QuickSetupStepPanel.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/ui/QuickSetupStepPanel.java
@@ -40,11 +40,9 @@
 import javax.swing.JPanel;
 import javax.swing.event.HyperlinkEvent;
 import javax.swing.event.HyperlinkListener;
-import javax.swing.text.JTextComponent;
 
 import org.opends.quicksetup.event.ButtonActionListener;
 import org.opends.quicksetup.event.ButtonEvent;
-import org.opends.quicksetup.installer.FieldName;
 import org.opends.quicksetup.ProgressDescriptor;
 import org.opends.quicksetup.UserData;
 import org.opends.quicksetup.util.HtmlProgressMessageFormatter;
@@ -76,6 +74,22 @@
       new HashMap<String, URLWorker>();
 
   /**
+   * Creates a default instance.
+   * @param application Application this panel represents
+   */
+  public QuickSetupStepPanel(GuiApplication application) {
+    super(application);
+  }
+
+  /**
+   * Initializes this panel.  Called soon after creation.  In general this
+   * is where maps should be populated etc.
+   */
+  public void initialize() {
+    createLayout();
+  }
+
+  /**
    * Called just before the panel is shown: used to update the contents of the
    * panel with new UserData (used in particular in the review panel).
    *
@@ -219,7 +233,7 @@
    * Creates the layout of the panel.
    *
    */
-  protected void createLayout()
+  private void createLayout()
   {
     setLayout(new GridBagLayout());
 
@@ -289,47 +303,6 @@
   }
 
   /**
-   * Commodity method that returns a JTextComponent based on a
-   * LabelFieldDescriptor.
-   * @param desc the LabelFieldDescriptor describing the JTextField.
-   * @param defaultValue the default value used to initialize the
-   * JTextComponent.
-   * @return a JTextComponent based on a
-   * LabelFieldDescriptor.
-   */
-  protected JTextComponent makeJTextComponent(LabelFieldDescriptor desc,
-      String defaultValue)
-  {
-    JTextComponent field;
-    switch (desc.getType())
-    {
-    case TEXTFIELD:
-
-      field =
-          UIFactory.makeJTextField(defaultValue, desc.getTooltip(), desc
-              .getSize(), UIFactory.TextStyle.TEXTFIELD);
-      break;
-
-    case PASSWORD:
-
-      field =
-          UIFactory.makeJPasswordField(defaultValue, desc.getTooltip(), desc
-              .getSize(), UIFactory.TextStyle.PASSWORD_FIELD);
-      break;
-
-    case READ_ONLY:
-
-      field =
-          UIFactory.makeTextPane(defaultValue, UIFactory.TextStyle.READ_ONLY);
-      break;
-
-    default:
-      throw new IllegalArgumentException("Unknown type: " + desc.getType());
-    }
-    return field;
-  }
-
-  /**
    * Commodity method that returns a JLabel based on a LabelFieldDescriptor.
    * @param desc the LabelFieldDescriptor describing the JLabel.
    * @return a JLabel based on a LabelFieldDescriptor.

--
Gitblit v1.10.0