From 8729a061e4138420ec8a33a5ab5f4378eec2097b Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 21 Dec 2009 16:23:41 +0000
Subject: [PATCH] Fix for issue 4413 (setup should use scroll panes in its panels)

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

diff --git a/opends/src/quicksetup/org/opends/quicksetup/ui/UIFactory.java b/opends/src/quicksetup/org/opends/quicksetup/ui/UIFactory.java
index 235d28d..5110237 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/ui/UIFactory.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/ui/UIFactory.java
@@ -1226,6 +1226,42 @@
   }
 
   /**
+   * Returns a JScrollPane that contains the provided component.  The scroll
+   * pane will not contain any border.
+   * @param comp the component contained in the scroll pane.
+   * @return a JScrollPane that contains the provided component.  The scroll
+   * pane will not contain any border.
+   */
+  public static JScrollPane createBorderLessScrollBar(Component comp)
+  {
+    JScrollPane scroll = new JScrollPane(comp);
+    scroll.setBorder(new EmptyBorder(0, 0, 0, 0));
+    scroll.setViewportBorder(new EmptyBorder(0, 0, 0, 0));
+    scroll.setOpaque(false);
+    scroll.getViewport().setOpaque(false);
+    scroll.getViewport().setBackground(DEFAULT_BACKGROUND);
+    scroll.setBackground(DEFAULT_BACKGROUND);
+    setScrollIncrementUnit(scroll);
+    return scroll;
+  }
+
+  /**
+   * Sets the scroll increment unit for the scroll.
+   * @param scroll the scroll to be updated.
+   */
+  public static void setScrollIncrementUnit(JScrollPane scroll)
+  {
+    if (scroll.getVerticalScrollBar() != null)
+    {
+      int increment = scroll.getVerticalScrollBar().getUnitIncrement();
+      if (increment < 16)
+      {
+        scroll.getVerticalScrollBar().setUnitIncrement(16);
+      }
+    }
+  }
+
+  /**
    * Return empty insets.
    * @return empty insets.
    */

--
Gitblit v1.10.0