/** * Create a panel with the specified child widget. * * @param child the child to add to the panel */ public SimplePanel(Widget child) { this(); setWidget(child); }
/** * Set the widget to display when the list has no rows. * * @param widget the empty data widget */ public void setEmptyListWidget(Widget widget) { emptyListWidgetContainer.setWidget(widget); }
/** * Set the widget to display when the data is loading. * * @param widget the loading indicator */ public void setLoadingIndicator(Widget widget) { loadingIndicatorContainer.setWidget(widget); }
@Override public void setWidget(Widget w) { replacingWidget = true; super.setWidget(w); replacingWidget = false; }
/** * Sets or replaces the content widget within the CaptionPanel. * * @param w the content widget to be set */ public void setContentWidget(Widget w) { ((SimplePanel) getWidget()).setWidget(w); } }
@Override public void setEmptyTableWidget(Widget widget) { emptyTableWidgetContainer.setWidget(widget); super.setEmptyTableWidget(widget); }
@Override public void setLoadingIndicator(Widget widget) { loadingIndicatorContainer.setWidget(widget); super.setLoadingIndicator(widget); }
@Override public void setWidget(Widget w) { super.setWidget(w); maybeUpdateSize(); }
/** * 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); }
public void setWidget(IsWidget w) { setWidget(asWidgetOrNull(w)); }
/** * Sets the content widget which can be opened and closed by this panel. If * there is a preexisting content widget, it will be detached. * * @param content the widget to be used as the content panel */ public void setContent(Widget content) { final Widget currentContent = getContent(); // Remove existing content widget. if (currentContent != null) { contentWrapper.setWidget(null); currentContent.removeStyleName(STYLENAME_CONTENT); } // Add new content widget if != null. if (content != null) { contentWrapper.setWidget(content); content.addStyleName(STYLENAME_CONTENT); setContentDisplay(false); } }
ClickDelegatePanel(Widget child) { focusablePanel = new SimplePanel(FocusPanel.impl.createFocusable()); focusablePanel.setWidget(child); SimplePanel wrapperWidget = createTabTextWrapper(); if (wrapperWidget == null) { initWidget(focusablePanel); } else { wrapperWidget.setWidget(focusablePanel); initWidget(wrapperWidget); } sinkEvents(Event.ONCLICK | Event.ONKEYDOWN); }
/** * Sets a tab's text contents. * * @param index the index of the tab whose text is to be set * @param text the object's new text */ public void setTabText(int index, String text) { assert (index >= 0) && (index < getTabCount()) : "Tab index out of bounds"; ClickDelegatePanel delPanel = (ClickDelegatePanel) panel.getWidget(index + 1); SimplePanel focusablePanel = delPanel.getFocusablePanel(); // It is not safe to check if the current widget is an instanceof Label and // reuse it here because HTML is an instanceof Label. Leaving an HTML would // throw off the results of getTabHTML(int). focusablePanel.setWidget(new Label(text, false)); }
/** * Sets a tab's contents via HTML. * * Use care when setting an object's HTML; it is an easy way to expose * script-based security problems. Consider using * {@link #setTabText(int, String)} or {@link #setTabHTML(int, SafeHtml)} * whenever possible. * * @param index the index of the tab whose HTML is to be set * @param html the tab new HTML */ public void setTabHTML(int index, @IsSafeHtml String html) { assert (index >= 0) && (index < getTabCount()) : "Tab index out of bounds"; ClickDelegatePanel delPanel = (ClickDelegatePanel) panel.getWidget(index + 1); SimplePanel focusablePanel = delPanel.getFocusablePanel(); focusablePanel.setWidget(new HTML(html, false)); }
/** * Set the widget to display when the list has no rows. * * @param widget the empty data widget */ public void setEmptyListWidget(Widget widget) { emptyListWidgetContainer.setWidget(widget); }
@Override public void setLoadingIndicator(Widget widget) { loadingIndicatorContainer.setWidget(widget); super.setLoadingIndicator(widget); }
@Override public void setEmptyTableWidget(Widget widget) { emptyTableWidgetContainer.setWidget(widget); super.setEmptyTableWidget(widget); }
@Override public void initialise() { view.init(this); final List<String> chosenImports = getChosenImports(); final List<String> availableImports = Arrays.asList(oracle.getExternalFactTypes()); view.setChosenImports(chosenImports); view.setAvailableImports(availableImports); validator = getValidator(); content.setWidget(view); }
private void init() { initWidget(panel); addStyleName("uf-help-icon"); icon.setType(IconType.INFO_CIRCLE); popover.setWidget(icon); popover.setContainer("body"); popover.setIsHtml(true); popover.setPlacement(Placement.AUTO); panel.setWidget(popover); }