http://gwt-code-reviews.appspot.com/143801


git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@7552 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/ui/StackLayoutPanel.java b/user/src/com/google/gwt/user/client/ui/StackLayoutPanel.java
index a959a75..2ed52a0 100644
--- a/user/src/com/google/gwt/user/client/ui/StackLayoutPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/StackLayoutPanel.java
@@ -19,6 +19,10 @@
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseOutHandler;
+import com.google.gwt.event.dom.client.MouseOverEvent;
+import com.google.gwt.event.dom.client.MouseOverHandler;
 import com.google.gwt.event.logical.shared.BeforeSelectionEvent;
 import com.google.gwt.event.logical.shared.BeforeSelectionHandler;
 import com.google.gwt.event.logical.shared.HasBeforeSelectionHandlers;
@@ -46,6 +50,8 @@
  * <dt>.gwt-StackLayoutPanel <dd> the panel itself 
  * <dt>.gwt-StackLayoutPanel .gwt-StackLayoutPanelHeader <dd> applied to each
  * header widget
+ * <dt>.gwt-StackLayoutPanel .gwt-StackLayoutPanelHeader-hovering <dd> applied to each
+ * header widget on mouse hover
  * <dt>.gwt-StackLayoutPanel .gwt-StackLayoutPanelContent <dd> applied to each
  * child widget
  * </dl>
@@ -99,6 +105,14 @@
     public HandlerRegistration addClickHandler(ClickHandler handler) {
       return this.addDomHandler(handler, ClickEvent.getType());
     }
+
+    public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
+      return this.addDomHandler(handler, MouseOutEvent.getType());
+    }
+
+    public HandlerRegistration addMouseOverHandler(MouseOverHandler handler) {
+      return this.addDomHandler(handler, MouseOverEvent.getType());
+    }
   }
 
   private static class LayoutData {
@@ -116,6 +130,7 @@
   private static final String WIDGET_STYLE = "gwt-StackLayoutPanel";
   private static final String CONTENT_STYLE = "gwt-StackLayoutPanelContent";
   private static final String HEADER_STYLE = "gwt-StackLayoutPanelHeader";
+  private static final String HEADER_STYLE_HOVERING = "gwt-StackLayoutPanelHeader-hovering";
 
   private static final int ANIMATION_TIME = 250;
 
@@ -468,7 +483,7 @@
     assert (index >= 0) && (index < getWidgetCount()) : "Index out of bounds";
   }
 
-  private void insert(final Widget child, Header header, double headerSize,
+  private void insert(final Widget child, final Header header, double headerSize,
       int beforeIndex) {
     assert (beforeIndex >= 0) && (beforeIndex <= getWidgetCount()) : "beforeIndex out of bounds";
 
@@ -501,6 +516,18 @@
       }
     });
 
+    header.addMouseOutHandler(new MouseOutHandler() {
+      public void onMouseOut(MouseOutEvent event) {
+        header.removeStyleName(HEADER_STYLE_HOVERING);
+      }
+    });
+
+    header.addMouseOverHandler(new MouseOverHandler() {
+      public void onMouseOver(MouseOverEvent event) {
+        header.addStyleName(HEADER_STYLE_HOVERING);
+      }
+    });
+
     if (selectedIndex == -1) {
       // If there's no visible widget, display the first one. The layout will
       // be updated onLoad().
diff --git a/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome.css b/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome.css
index 6a3b559..61a35b0 100644
--- a/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome.css
+++ b/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome.css
@@ -1095,6 +1095,9 @@
   padding: 3px;
   text-align: center;
 }
+.gwt-StackLayoutPanel .gwt-StackLayoutPanelHeader-hovering {
+  background: #d3def6 url(images/hborder.png) repeat-x 0px -1464px;
+}
 .gwt-StackLayoutPanel .gwt-StackLayoutPanelContent {
   border: 1px solid #bbbbbb;
   border-bottom: 0px;
diff --git a/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome_rtl.css b/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome_rtl.css
index ccfb999..5d39099 100644
--- a/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome_rtl.css
+++ b/user/src/com/google/gwt/user/theme/chrome/public/gwt/chrome/chrome_rtl.css
@@ -1096,6 +1096,9 @@
   padding: 3px;
   text-align: center;
 }
+.gwt-StackLayoutPanel .gwt-StackLayoutPanelHeader-hovering {
+  background: #d3def6 url(images/hborder.png) repeat-x 0px -1464px;
+}
 .gwt-StackLayoutPanel .gwt-StackLayoutPanelContent {
   border: 1px solid #bbbbbb;
   border-bottom: 0px;
diff --git a/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark.css b/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark.css
index bd13a2d..50e116c 100644
--- a/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark.css
+++ b/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark.css
@@ -1045,6 +1045,9 @@
   border-bottom: 0px;
   background: #222;
 }
+.gwt-StackLayoutPanel .gwt-StackLayoutPanelHeader-hovering {
+  background: #444;
+}
 .gwt-StackLayoutPanel .gwt-StackLayoutPanelContent {
   border: 1px solid #00CCFF;
   border-bottom: 0px;
diff --git a/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark_rtl.css b/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark_rtl.css
index c980788..c43a70d 100644
--- a/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark_rtl.css
+++ b/user/src/com/google/gwt/user/theme/dark/public/gwt/dark/dark_rtl.css
@@ -1046,6 +1046,9 @@
   border-bottom: 0px;
   background: #222;
 }
+.gwt-StackLayoutPanel .gwt-StackLayoutPanelHeader-hovering {
+  background: #444;
+}
 .gwt-StackLayoutPanel .gwt-StackLayoutPanelContent {
   border: 1px solid #00CCFF;
   border-bottom: 0px;
diff --git a/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard.css b/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard.css
index d09ff36..77b1e58 100644
--- a/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard.css
+++ b/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard.css
@@ -1094,6 +1094,9 @@
   border-bottom: 0px;
   background: #d3def6 url(images/hborder.png) repeat-x 0px -989px;
 }
+.gwt-StackLayoutPanel .gwt-StackLayoutPanelHeader-hovering {
+  background: #d3def6 url(images/hborder.png) repeat-x 0px -1464px;
+}
 .gwt-StackLayoutPanel .gwt-StackLayoutPanelContent {
   border: 1px solid #bbbbbb;
   border-bottom: 0px;
diff --git a/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard_rtl.css b/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard_rtl.css
index 5f29934..d996b7c 100644
--- a/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard_rtl.css
+++ b/user/src/com/google/gwt/user/theme/standard/public/gwt/standard/standard_rtl.css
@@ -1095,6 +1095,9 @@
   border-bottom: 0px;
   background: #d3def6 url(images/hborder.png) repeat-x 0px -989px;
 }
+.gwt-StackLayoutPanel .gwt-StackLayoutPanelHeader-hovering {
+  background: #d3def6 url(images/hborder.png) repeat-x 0px -1464px;
+}
 .gwt-StackLayoutPanel .gwt-StackLayoutPanelContent {
   border: 1px solid #bbbbbb;
   border-bottom: 0px;