/** * Parses the current date box's value and shows that date. */ public void showDatePicker() { Date current = parseDate(false); if (current == null) { current = new Date(); } picker.setCurrentMonth(current); popup.showRelativeTo(this); }
@Override public void onClick(ClickEvent event) { popup.showRelativeTo(button); } });
suggestionPopup.showRelativeTo(positionRelativeTo != null ? positionRelativeTo : suggestBox);
/** * Parses the current date box's value and shows that date. */ public void showDatePicker() { Date current = parseDate(false); if (current == null) { current = new Date(); } picker.setCurrentMonth(current); popup.showRelativeTo(this); }
/** * Parses the current date box's value and shows that date. */ public void showDatePicker() { Date current = parseDate(false); if (current == null) { current = new Date(); } picker.setCurrentMonth(current); popup.showRelativeTo(this); }
@Override public void execute() { final int h = tree.getOffsetHeight(); final int maxHeight = computeMaxHeight(); if ( h > maxHeight ) { scroll.setHeight( maxHeight + "px" ); } else { scroll.getElement().getStyle().clearHeight(); } popup.showRelativeTo( p ); } } );
@Override public void execute() { final int h = tree.getOffsetHeight(); final int maxHeight = computeMaxHeight(); if ( h > maxHeight ) { scroll.setHeight( maxHeight + "px" ); } else { scroll.getElement().getStyle().clearHeight(); } popup.showRelativeTo( p ); } } );
@Override public void execute() { final int h = tree.getOffsetHeight(); final int maxHeight = computeMaxHeight(); if ( h > maxHeight ) { scroll.setHeight( maxHeight + "px" ); } else { scroll.getElement().getStyle().clearHeight(); } popup.showRelativeTo( p ); } } );
@Override public void execute() { final int h = tree.getOffsetHeight(); final int maxHeight = computeMaxHeight(); if ( h > maxHeight ) { scroll.setHeight( maxHeight + "px" ); } else { scroll.getElement().getStyle().clearHeight(); } popup.showRelativeTo( p ); if ( rootClass == null ) { popup.hide(); } } } );
@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); } } });
@Override protected void showSuggestions(SuggestBox suggestBox, Collection<? extends SuggestOracle.Suggestion> suggestions, boolean isDisplayStringHTML, boolean isAutoSelectEnabled, final SuggestBox.SuggestionCallback callback) { boolean anySuggestions = (suggestions != null && suggestions.size() > 0); boolean hideWhenEmpty = true; if (!anySuggestions && hideWhenEmpty) { hideSuggestions(); return; } if (m_suggestionPopup.isAttached()) { m_suggestionPopup.hide(); } m_suggestionMenu.clearItems(); for(final SuggestOracle.Suggestion curSuggestion : suggestions) { Scheduler.ScheduledCommand command = new Scheduler.ScheduledCommand() { @Override public void execute() { callback.onSuggestionSelected(curSuggestion); } }; final SuggestionMenuItem menuitem = new SuggestionMenuItem(curSuggestion, isDisplayStringHTML, command); m_suggestionMenu.addItem(menuitem); } m_suggestionPopup.addAutoHidePartner(suggestBox.getElement()); // Show the popup under the TextBox. m_suggestionPopup.showRelativeTo(suggestBox); }
@Override protected void showSuggestions(SuggestBox suggestBox, Collection<? extends SuggestOracle.Suggestion> suggestions, boolean isDisplayStringHTML, boolean isAutoSelectEnabled, final SuggestBox.SuggestionCallback callback) { boolean anySuggestions = (suggestions != null && suggestions.size() > 0); boolean hideWhenEmpty = true; if (!anySuggestions && hideWhenEmpty) { hideSuggestions(); return; } if (m_suggestionPopup.isAttached()) { m_suggestionPopup.hide(); } m_suggestionMenu.clearItems(); for(final SuggestOracle.Suggestion curSuggestion : suggestions) { Scheduler.ScheduledCommand command = new Scheduler.ScheduledCommand() { @Override public void execute() { callback.onSuggestionSelected(curSuggestion); } }; final SuggestionMenuItem menuitem = new SuggestionMenuItem(curSuggestion, isDisplayStringHTML, command); m_suggestionMenu.addItem(menuitem); } m_suggestionPopup.addAutoHidePartner(suggestBox.getElement()); // Show the popup under the TextBox. m_suggestionPopup.showRelativeTo(suggestBox); }
suggestionPopup.showRelativeTo(positionRelativeTo != null ? positionRelativeTo : suggestBox);
suggestionPopup.showRelativeTo(positionRelativeTo != null ? positionRelativeTo : suggestBox);