/** * Gets the popup's top position relative to the browser's client area. * * @return the popup's top position */ public int getPopupTop() { return getElement().getAbsoluteTop(); }
/** * Gets the popup's left position relative to the browser's client area. * * @return the popup's left position */ public int getPopupLeft() { return getElement().getAbsoluteLeft(); }
/** * Determines whether or not this popup is visible. Note that this just checks * the <code>visibility</code> style attribute, which is set in the * {@link #setVisible(boolean)} method. If you want to know if the popup is * attached to the page, use {@link #isShowing()} instead. * * @return <code>true</code> if the object is visible * @see #setVisible(boolean) */ @Override public boolean isVisible() { return !"hidden".equals(getElement().getStyle().getProperty("visibility")); }
@Override protected void onComplete() { if (!showing) { maybeShowGlass(); if (!isUnloading) { RootPanel.get().remove(curPanel); } } impl.setClip(curPanel.getElement(), "rect(auto, auto, auto, auto)"); curPanel.getElement().getStyle().setProperty("overflow", "visible"); }
@Override protected void onStart() { offsetHeight = curPanel.getOffsetHeight(); offsetWidth = curPanel.getOffsetWidth(); curPanel.getElement().getStyle().setProperty("overflow", "hidden"); super.onStart(); }
/** * Sets whether this object is visible. This method just sets the * <code>visibility</code> style attribute. You need to call {@link #show()} * to actually attached/detach the {@link PopupPanel} to the page. * * @param visible <code>true</code> to show the object, <code>false</code> to * hide it * @see #show() * @see #hide() */ @Override public void setVisible(boolean visible) { // We use visibility here instead of UIObject's default of display // Because the panel is absolutely positioned, this will not create // "holes" in displayed contents and it allows normal layout passes // to occur so the size of the PopupPanel can be reliably determined. getElement().getStyle().setProperty("visibility", visible ? "visible" : "hidden"); // If the PopupImpl creates an iframe shim, it's also necessary to hide it // as well. if (glass != null) { glass.getStyle().setProperty("visibility", visible ? "visible" : "hidden"); } }
private void onInstantaneousRun() { maybeShowGlass(); if (showing) { // Set the position attribute, and then attach to the DOM. Otherwise, // the PopupPanel will appear to 'jump' from its static/relative // position to its absolute position (issue #1231). curPanel.getElement().getStyle().setProperty("position", "absolute"); if (curPanel.topPosition != -1) { curPanel.setPopupPosition(curPanel.leftPosition, curPanel.topPosition); } RootPanel.get().add(curPanel); } else { if (!isUnloading) { RootPanel.get().remove(curPanel); } } curPanel.getElement().getStyle().setProperty("overflow", "visible"); } }
/** * Does the event target this popup? * * @param event the native event * @return true if the event targets the popup */ private boolean eventTargetsPopup(NativeEvent event) { EventTarget target = event.getEventTarget(); if (Element.is(target)) { return getElement().isOrHasChild(Element.as(target)); } return false; }
impl.setClip(curPanel.getElement(), getRectString(top, right, bottom, left));
Element elem = getElement(); elem.getStyle().setPropertyPx("left", 0); elem.getStyle().setPropertyPx("top", 0); impl.setClip(getElement(), "rect(0px, 0px, 0px, 0px)"); setVisible(true); resizeAnimation.run(ANIMATION_DURATION);
/** * Sets the popup's position relative to the browser's client area. The * popup's position may be set before calling {@link #show()}. * * @param left the left position, in pixels * @param top the top position, in pixels */ public void setPopupPosition(int left, int top) { // Save the position of the popup leftPosition = left; topPosition = top; // Account for the difference between absolute position and the // body's positioning context. left -= Document.get().getBodyOffsetLeft(); top -= Document.get().getBodyOffsetTop(); // Set the popup's position manually, allowing setPopupPosition() to be // called before show() is called (so a popup can be positioned without it // 'jumping' on the screen). Element elem = getElement(); elem.getStyle().setPropertyPx("left", left); elem.getStyle().setPropertyPx("top", top); }
curPanel.getElement().getStyle().setProperty("position", "absolute"); if (curPanel.topPosition != -1) { curPanel.setPopupPosition(curPanel.leftPosition, curPanel.topPosition); impl.setClip(curPanel.getElement(), getRectString(0, 0, 0, 0)); RootPanel.get().add(curPanel);
/** * Gets the popup's left position relative to the browser's client area. * * @return the popup's left position */ public int getPopupLeft() { return getElement().getAbsoluteLeft(); }
/** * Gets the popup's top position relative to the browser's client area. * * @return the popup's top position */ public int getPopupTop() { return getElement().getAbsoluteTop(); }
/** * Gets the popup's left position relative to the browser's client area. * * @return the popup's left position */ public int getPopupLeft() { return getElement().getAbsoluteLeft(); }
public void onMouseMove(MouseMoveEvent event) { if (_resizing) { setStyleAttribute(resizeLine.getElement(), "left", (event.getClientX()) + "px"); } } });
@Override protected void onComplete() { if (!showing) { maybeShowGlass(); if (!isUnloading) { RootPanel.get().remove(curPanel); } } impl.setClip(curPanel.getElement(), "rect(auto, auto, auto, auto)"); curPanel.getElement().getStyle().setProperty("overflow", "visible"); }
@Override protected void onComplete() { if (!showing) { maybeShowGlass(); if (!isUnloading) { RootPanel.get().remove(curPanel); } } impl.setClip(curPanel.getElement(), "rect(auto, auto, auto, auto)"); curPanel.getElement().getStyle().setProperty("overflow", "visible"); }
public CustomSuggestionDisplay() { super(); final PopupPanel popup = getPopupPanel(); popup.setStyleName(Styles.DROPDOWN_MENU); popup.getElement().getStyle().setDisplay(Display.BLOCK); }
public static void adjustPopupLocationToFitScreenAndShow(final PopupPanel popup, int left, int top, MenuBar parentMenu, int itemHeight) { Style style = popup.getElement().getStyle(); style.setLeft(0, Unit.PX); style.setTop(0, Unit.PX); style.setProperty("height", "auto"); //$NON-NLS-1$ //$NON-NLS-2$ style.setProperty("width", "auto"); //$NON-NLS-1$ //$NON-NLS-2$ popup.show(); adjustPopupLocationToFitScreenAndShow(popup, left, top, -parentMenu.getOffsetWidth(), 0, itemHeight); }