From e8943d1aa33c558fb006c76a5f831b8998702fbc Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Wed, 27 Jun 2007 01:10:13 +0000
Subject: [PATCH] moved common code to utility method

---
 opends/src/quicksetup/org/opends/quicksetup/ui/Utilities.java |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/opends/src/quicksetup/org/opends/quicksetup/ui/Utilities.java b/opends/src/quicksetup/org/opends/quicksetup/ui/Utilities.java
index 73295f1..c3aa9af 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/ui/Utilities.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/ui/Utilities.java
@@ -27,6 +27,8 @@
 
 package org.opends.quicksetup.ui;
 
+import org.opends.quicksetup.util.Utils;
+
 import javax.swing.*;
 import javax.swing.text.JTextComponent;
 import java.awt.*;
@@ -74,4 +76,20 @@
     return panel;
   }
 
+  /**
+   * Sets a frames image icon to the standard OpenDS icon appropriate
+   * for the running platform.
+   *
+   * @param frame for which the icon will be set
+   */
+  static public void setFrameIcon(JFrame frame) {
+    UIFactory.IconType ic;
+    if (Utils.isMacOS()) {
+      ic = UIFactory.IconType.MINIMIZED_MAC;
+    } else {
+      ic = UIFactory.IconType.MINIMIZED;
+    }
+    frame.setIconImage(UIFactory.getImageIcon(ic).getImage());
+  }
+
 }

--
Gitblit v1.10.0