public void onClick(ClickEvent event) { if (!actionsPopup.isShowing()) { // Instantiate the popup and show it. final Element parent = ActionsLabel.this.getElement(); actionsPopup .setPopupPositionAndShow(new PopupPanel.PositionCallback() { public void setPosition(int offsetWidth, int offsetHeight) { int left = parent.getAbsoluteLeft(); int top = parent.getAbsoluteTop() + parent.getOffsetHeight() + 2; if (left + actionsPopup.getOffsetWidth() > Window .getClientWidth()) { left = parent.getAbsoluteRight() - actionsPopup.getOffsetWidth(); } actionsPopup.setPopupPosition(left, top); } }); } else { actionsPopup.hide(); } } });
/** * Returns true if date picker is currently showing, false if not. */ public boolean isDatePickerShowing() { return popup.isShowing(); }
@Override public boolean isSuggestionListShowing() { return suggestionPopup.isShowing(); }
@Override protected void onUnload() { super.onUnload(); // Just to be sure, we perform cleanup when the popup is unloaded (i.e. // removed from the DOM). This is normally taken care of in hide(), but it // can be missed if someone removes the popup directly from the RootPanel. if (isShowing()) { resizeAnimation.setState(false, true); } }
/** * Hides the popup and detaches it from the page. This has no effect if it is * not currently showing. * * @param autoClosed the value that will be passed to * {@link CloseHandler#onClose(CloseEvent)} when the popup is closed */ public void hide(boolean autoClosed) { if (!isShowing()) { return; } resizeAnimation.setState(false, false); CloseEvent.fire(this, this, autoClosed); }
/** * Returns true if date picker is currently showing, false if not. */ public boolean isDatePickerShowing() { return popup.isShowing(); }
/** * Check whether or not the list of suggestions is being shown. * * @return true if the suggestions are visible, false if not */ public boolean isSuggestionListShowing() { return suggestionPopup.isShowing(); }
/** * Returns true if date picker is currently showing, false if not. */ public boolean isDatePickerShowing() { return popup.isShowing(); }
@Override public void showPopup() { if (!m_popupPanel.isShowing()) { m_popupPanel.setPopupPositionAndShow(m_repositionPopupPanel); } }
/** * Verifies that the actual {@link PopupPanel} is currently showing. * * @return this assertion object. * @throws AssertionError if the actual {@link PopupPanel} is not showing. * @see PopupPanel#isShowing() */ public S isShowing() { if (!actual.isShowing()) failWithMessage("should be showing"); return myself; }
/** * Verifies that the actual {@link PopupPanel} is not currently showing. * * @return this assertion object. * @throws AssertionError if the actual {@link PopupPanel} is showing. * @see PopupPanel#isShowing() */ public S isNotShowing() { if (actual.isShowing()) failWithMessage("should not be showing"); return myself; }
/** * Verifies that the actual {@link PopupPanel} is not currently showing. * * @return this assertion object. * @throws AssertionError if the actual {@link PopupPanel} is showing. * @see PopupPanel#isShowing() */ public S isNotShowing() { if (actual.isShowing()) failWithMessage("should not be showing"); return myself; }
@Override public void onResize(final ResizeEvent event) { if (m_popupPanel.isShowing()) { m_popupPanel.setPopupPositionAndShow(m_repositionPopupPanel); } } });
/** * Verifies that the actual {@link PopupPanel} is currently showing. * * @return this assertion object. * @throws AssertionError if the actual {@link PopupPanel} is not showing. * @see PopupPanel#isShowing() */ public S isShowing() { if (!actual.isShowing()) failWithMessage("should be showing"); return myself; }
@Override protected void onUnload() { super.onUnload(); // Just to be sure, we perform cleanup when the popup is unloaded (i.e. // removed from the DOM). This is normally taken care of in hide(), but it // can be missed if someone removes the popup directly from the RootPanel. if (isShowing()) { resizeAnimation.setState(false, true); } }
public static Boolean isShowingItems(SuggestBox suggestBox) { SuggestBox.DefaultSuggestionDisplay display = GwtReflectionUtils.getPrivateFieldValue(suggestBox, "display"); PopupPanel suggestionPopup = GwtReflectionUtils.getPrivateFieldValue(display, "suggestionPopup"); return suggestionPopup.isShowing(); }
@Override public void onClick(ClickEvent event) { if(enabled){ if(!menuPanel.isShowing()){ StylishDropDown.this.showMenu(); } else{ StylishDropDown.this.hideMenu(); } } }
@Override protected void onUnload() { super.onUnload(); // Just to be sure, we perform cleanup when the popup is unloaded (i.e. // removed from the DOM). This is normally taken care of in hide(), but it // can be missed if someone removes the popup directly from the RootPanel. if (isShowing()) { resizeAnimation.setState(false, true); } }
@Override public HandlerRegistration getRepositionOnWindowResizeHandler() { return Window.addResizeHandler(event -> { if (asPopupPanel().isShowing()) { showAndReposition(); } }); }
@Override public void onClick(final ClickEvent event) { GWT.log("clicked (showing = " + m_mainPopup.isShowing() + ", visible = " + m_mainPopup.isVisible() + ")"); if (m_mainPopup.isShowing()) { m_mainPopup.hide(); m_mainPopup.getElement().getStyle().setDisplay(Display.NONE); } else { m_mainPopup.getElement().getStyle().setDisplay(Display.BLOCK); m_mainPopup.showRelativeTo(m_addImage); } } });