From ed965a01d8392b63a57ff52b5e707bba253c32d2 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Tue, 03 Nov 2009 16:58:43 +0000
Subject: [PATCH] Fix for issue 4335 (Scroll wheel in Control Panel is waaay too slow) Increase the value of the unit increment in the scroll panes used by the control panel.

---
 opends/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/opends/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java b/opends/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java
index ce49ef8..de1c88c 100644
--- a/opends/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java
+++ b/opends/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java
@@ -402,6 +402,7 @@
     scroll.getViewport().setOpaque(false);
     scroll.getViewport().setBackground(ColorAndFontConstants.background);
     scroll.setBackground(ColorAndFontConstants.background);
+    setScrollIncrementUnit(scroll);
     return scroll;
   }
 
@@ -417,10 +418,24 @@
     scroll.setOpaque(false);
     scroll.getViewport().setBackground(ColorAndFontConstants.background);
     scroll.setBackground(ColorAndFontConstants.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();
+      scroll.getVerticalScrollBar().setUnitIncrement(increment * 3);
+    }
+  }
+
+  /**
    * Creates a button.
    * @param text the message to be displayed by the button.
    * @return the created button.

--
Gitblit v1.10.0