]> source.dussan.org Git - vaadin-framework.git/commitdiff
Add SubPartAware interface to VSlider (#13760)
authorDmitrii Rogozin <dmitrii@vaadin.com>
Thu, 11 Sep 2014 11:45:49 +0000 (14:45 +0300)
committerVaadin Code Review <review@vaadin.com>
Sun, 14 Sep 2014 15:09:58 +0000 (15:09 +0000)
Change-Id: I19cc7e60a43a618f2b443f4b9d049b77d740b567

client/src/com/vaadin/client/ui/VSlider.java

index 3b82fd1525fed0086ed96b48e1485c57437d821e..27c8522f377dfddee331d9992e850c4a978fbbab 100644 (file)
@@ -38,7 +38,7 @@ import com.vaadin.client.Util;
 import com.vaadin.shared.ui.slider.SliderOrientation;
 
 public class VSlider extends SimpleFocusablePanel implements Field,
-        HasValue<Double> {
+        HasValue<Double>, SubPartAware {
 
     public static final String CLASSNAME = "v-slider";
 
@@ -650,4 +650,21 @@ public class VSlider extends SimpleFocusablePanel implements Field,
             fireValueChanged();
         }
     }
+
+    @Override
+    public com.google.gwt.user.client.Element getSubPartElement(String subPart) {
+        if (subPart.equals("popup")) {
+            feedbackPopup.show();
+            return feedbackPopup.getElement();
+        }
+        return null;
+    }
+
+    @Override
+    public String getSubPartName(com.google.gwt.user.client.Element subElement) {
+        if (feedbackPopup.getElement().isOrHasChild(subElement)) {
+            return "popup";
+        }
+        return null;
+    }
 }