From 01bf9b6a5d324d45355659581e9ebbd1280834fe Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 25 Apr 2016 14:41:26 +0000
Subject: [PATCH] Improvements suggested by UCDetector: remove dead code, add final keywords, change visibilities

---
 opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/QuickSetupDialog.java |   58 ++++++++++++++--------------------------------------------
 1 files changed, 14 insertions(+), 44 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/QuickSetupDialog.java b/opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/QuickSetupDialog.java
index 4acac22..ba62918 100644
--- a/opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/QuickSetupDialog.java
+++ b/opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/QuickSetupDialog.java
@@ -20,9 +20,7 @@
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
 import java.util.HashSet;
-import org.forgerock.i18n.LocalizableMessage;
-import org.forgerock.i18n.slf4j.LocalizedLogger;
-
+import java.util.Set;
 
 import javax.swing.JButton;
 import javax.swing.JFrame;
@@ -30,11 +28,16 @@
 import javax.swing.SwingUtilities;
 import javax.swing.WindowConstants;
 
-import org.opends.quicksetup.*;
+import org.forgerock.i18n.LocalizableMessage;
+import org.forgerock.i18n.slf4j.LocalizedLogger;
+import org.opends.quicksetup.ButtonName;
+import org.opends.quicksetup.CurrentInstallStatus;
+import org.opends.quicksetup.ProgressDescriptor;
+import org.opends.quicksetup.ProgressStep;
+import org.opends.quicksetup.UserData;
+import org.opends.quicksetup.WizardStep;
 import org.opends.quicksetup.event.ButtonActionListener;
 import org.opends.quicksetup.event.ButtonEvent;
-import org.opends.quicksetup.event.MinimumSizeComponentListener;
-import org.opends.quicksetup.ProgressDescriptor;
 /**
  * This class represents the dialog used by quicksetup applications.
  *
@@ -49,23 +52,18 @@
 {
   private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
 
-  private JFrame frame;
+  private final JFrame frame;
   private QuickSetupErrorPanel installedPanel;
   private JPanel framePanel;
   private StepsPanel stepsPanel;
   private CurrentStepPanel currentStepPanel;
   private ButtonsPanel buttonsPanel;
-
   private WizardStep displayedStep;
 
-  private CurrentInstallStatus installStatus;
-
-  private HashSet<ButtonActionListener> buttonListeners = new HashSet<>();
-
-  private GuiApplication application;
-
-  private QuickSetup quickSetup;
-
+  private final CurrentInstallStatus installStatus;
+  private final Set<ButtonActionListener> buttonListeners = new HashSet<>();
+  private final GuiApplication application;
+  private final QuickSetup quickSetup;
   private boolean forceToDisplay;
 
   /**
@@ -96,20 +94,6 @@
     Utilities.setFrameIcon(frame);
   }
 
-  /** Packs and displays this dialog. */
-  public void packAndShow()
-  {
-    frame.pack();
-    int minWidth = (int) frame.getPreferredSize().getWidth();
-    int minHeight = (int) frame.getPreferredSize().getHeight();
-    Utilities.centerOnScreen(frame);
-    setFocusOnButton(application.getInitialFocusButtonName());
-    frame.addComponentListener(new MinimumSizeComponentListener(frame,
-        minWidth, minHeight));
-
-    frame.setVisible(true);
-  }
-
   /**
    * This method is called when we detected that there is something installed
    * we inform of this to the user and the user wants to proceed with the
@@ -281,20 +265,6 @@
   }
 
   /**
-   * Notification telling that the installation/uninstallation is finished.
-   * @param successful a boolean telling whether the setup was successful or
-   * not.
-   */
-  public void finished(boolean successful)
-  {
-    setButtonEnabled(ButtonName.CLOSE, true);
-    if (!successful)
-    {
-      // Do nothing... all the error messages
-    }
-  }
-
-  /**
    * Returns the frame containing the dialog.
    * @return the frame containing the dialog.
    */

--
Gitblit v1.10.0