/** * Gets the widget that was previously set in {@link #setContent(Widget)}. * * @return the panel's current content widget */ public Widget getContent() { return contentWrapper.getWidget(); }
/** * Get the widget displayed when the data is loading. * * @return the loading indicator */ public Widget getLoadingIndicator() { return loadingIndicatorContainer.getWidget(); }
/** * Get the widget displayed when the list has no rows. * * @return the empty list widget */ public Widget getEmptyListWidget() { return emptyListWidgetContainer.getWidget(); }
@Override public boolean hasWordWrap() { return focusablePanel.getWidget() instanceof HasWordWrap; }
/** * Accesses the content widget, if present. * * @return the content widget specified previously in * {@link #setContentWidget(Widget)} */ public Widget getContentWidget() { return ((SimplePanel) getWidget()).getWidget(); }
/** * Adds a widget to this panel. * * @param w the child widget to be added */ @Override public void add(Widget w) { // Can't add() more than one widget to a SimplePanel. if (getWidget() != null) { throw new IllegalStateException("SimplePanel can only contain one child widget"); } setWidget(w); }
@Override public void setWordWrap(boolean wrap) { if (hasWordWrap()) { ((HasWordWrap) focusablePanel.getWidget()).setWordWrap(wrap); } else { throw new UnsupportedOperationException( "Widget does not implement HasWordWrap"); } } }
@Override public boolean getWordWrap() { if (hasWordWrap()) { return ((HasWordWrap) focusablePanel.getWidget()).getWordWrap(); } throw new UnsupportedOperationException( "Widget does not implement HasWordWrap"); }
/** * We control size by setting our child widget's size. However, if we don't * currently have a child, we record the size the user wanted so that when we * do get a child, we can set it correctly. Until size is explicitly cleared, * any child put into the popup will be given that size. */ void maybeUpdateSize() { // For subclasses of PopupPanel, we want the default behavior of setWidth // and setHeight to change the dimensions of PopupPanel's child widget. // We do this because PopupPanel's child widget is the first widget in // the hierarchy which provides structure to the panel. DialogBox is // an example of this. We want to set the dimensions on DialogBox's // FlexTable, which is PopupPanel's child widget. However, it is not // DialogBox's child widget. To make sure that we are actually getting // PopupPanel's child widget, we have to use super.getWidget(). Widget w = super.getWidget(); if (w != null) { if (desiredHeight != null) { w.setHeight(desiredHeight); } if (desiredWidth != null) { w.setWidth(desiredWidth); } } }
/** * Get the widget displayed when the list has no rows. * * @return the empty list widget */ public Widget getEmptyListWidget() { return emptyListWidgetContainer.getWidget(); }
/** * Get the widget displayed when the data is loading. * * @return the loading indicator */ public Widget getLoadingIndicator() { return loadingIndicatorContainer.getWidget(); }
/** * Gets the specified tab's HTML. * * @param index the index of the tab whose HTML is to be retrieved * @return the tab's HTML */ public String getTabHTML(int index) { if (index >= getTabCount()) { return null; } ClickDelegatePanel delPanel = (ClickDelegatePanel) panel.getWidget(index + 1); SimplePanel focusablePanel = delPanel.getFocusablePanel(); Widget widget = focusablePanel.getWidget(); if (widget instanceof HTML) { return ((HTML) widget).getHTML(); } else if (widget instanceof Label) { return ((Label) widget).getText(); } else { // This will be a focusable panel holding a user-supplied widget. return focusablePanel.getElement().getParentElement().getInnerHTML(); } }
/** * Accesses the content widget, if present. * * @return the content widget specified previously in * {@link #setContentWidget(Widget)} */ public Widget getContentWidget() { return ((SimplePanel) getWidget()).getWidget(); }
@Override public boolean getWordWrap() { if (hasWordWrap()) { return ((HasWordWrap) focusablePanel.getWidget()).getWordWrap(); } throw new UnsupportedOperationException( "Widget does not implement HasWordWrap"); }
/** * clear errors. */ public void clearErrors() { errorLabel.setText(StringUtils.EMPTY); errorLabel.getElement().getStyle().setDisplay(Display.NONE); if (contents.getWidget() != null) { contents.getWidget().removeStyleName(decoratorStyle.errorInputStyle()); contents.getWidget().removeStyleName(decoratorStyle.validInputStyle()); } }
private void doAnimation(boolean isExpanding) { if (contentPanel.getWidget() != null) { ContentAnimation contentAnimation = new ContentAnimation(contentPanel); contentAnimation.setExpanding(isExpanding); contentAnimation.run(ANIMATION_DURATION); } }
private void doAnimation(boolean isExpanding) { if (contentPanel.getWidget() != null) { ContentAnimation contentAnimation = new ContentAnimation(contentPanel); contentAnimation.setExpanding(isExpanding); contentAnimation.run(ANIMATION_DURATION); } }