Daniel Kurka has uploaded a new change for review.

  https://gwt-review.googlesource.com/3340


Change subject: Add show relative to Element in PopupPanel
......................................................................

Add show relative to Element in PopupPanel

fixes issue 6006

Change-Id: I8991b1cb1c3ec4ecabd299ee4c5bf4e5992e4b5e
---
M user/src/com/google/gwt/user/client/ui/PopupPanel.java
1 file changed, 17 insertions(+), 3 deletions(-)



diff --git a/user/src/com/google/gwt/user/client/ui/PopupPanel.java b/user/src/com/google/gwt/user/client/ui/PopupPanel.java
index ddcad33..a4a9d36 100644
--- a/user/src/com/google/gwt/user/client/ui/PopupPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/PopupPanel.java
@@ -36,12 +36,12 @@
 import com.google.gwt.i18n.client.LocaleInfo;
 import com.google.gwt.user.client.DOM;
 import com.google.gwt.user.client.Event;
+import com.google.gwt.user.client.Event.NativePreviewEvent;
+import com.google.gwt.user.client.Event.NativePreviewHandler;
 import com.google.gwt.user.client.EventPreview;
 import com.google.gwt.user.client.History;
 import com.google.gwt.user.client.Timer;
 import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.Event.NativePreviewEvent;
-import com.google.gwt.user.client.Event.NativePreviewHandler;
 import com.google.gwt.user.client.ui.impl.PopupImpl;

 import java.util.ArrayList;
@@ -1029,6 +1029,20 @@
    * @param target the target to show the popup below
    */
   public final void showRelativeTo(final UIObject target) {
+    showRelativeTo(target.getElement());
+  }
+
+  /**
+ * Normally, the popup is positioned directly below the relative target, with + * its left edge aligned with the left edge of the target. Depending on the
+   * width and height of the popup and the distance from the target to the
+ * bottom and right edges of the window, the popup may be displayed directly + * above the target, and/or its right edge may be aligned with the right edge
+   * of the target.
+   *
+   * @param target the target to show the popup below
+   */
+  public final void showRelativeTo(final Element target) {
     // Set the position of the popup right before it is shown.
     setPopupPositionAndShow(new PositionCallback() {
       public void setPosition(int offsetWidth, int offsetHeight) {
@@ -1191,7 +1205,7 @@
    * @param offsetWidth the drop down's offset width
    * @param offsetHeight the drop down's offset height
    */
-  private void position(final UIObject relativeObject, int offsetWidth,
+  private void position(final Element relativeObject, int offsetWidth,
       int offsetHeight) {
     // Calculate left position for the popup. The computation for
     // the left position is bidi-sensitive.

--
To view, visit https://gwt-review.googlesource.com/3340
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8991b1cb1c3ec4ecabd299ee4c5bf4e5992e4b5e
Gerrit-PatchSet: 1
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Daniel Kurka <[email protected]>

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to