/** * Replaces the button icon <b>but</b> does not save icon reference into parent {@code icon} * attribute. * * @param icon The button icon to display. */ private void replaceIcon(final AbstractImagePrototype icon) { if (rendered) { El oldIcon = buttonEl.selectNode("." + baseStyle + "-image"); if (oldIcon != null) { oldIcon.remove(); el().removeStyleName(baseStyle + "-text-icon", baseStyle + "-icon", baseStyle + "-noicon"); } el().addStyleName( (icon != null ? (!Util.isEmptyString(html) ? " " + baseStyle + "-text-icon" : " " + baseStyle + "-icon") : " " + baseStyle + "-noicon")); Element e = null; if (icon != null) { e = (Element) icon.createElement().cast(); Accessibility.setRole(e, "presentation"); fly(e).addStyleName(baseStyle + "-image"); buttonEl.insertFirst(e); El.fly(e).makePositionable(true); } autoWidth(); alignIcon(e); } }
/** * Sets the header's text. * * @param text the text */ public void setText(String text) { this.text = text; if (rendered) { el().child(".x-tab-strip-text") .dom .setInnerHTML(Util.isEmptyString(text) ? " " : text); tabPanel.onItemTextChange(TabItem.this, this.text, text); } }
@SuppressWarnings({"unchecked", "rawtypes"}) protected void onLoad(LoadEvent le) { this.config = (ListLoadConfig) le.getConfig(); Object data = le.getData(); removeAll(); if (data == null) { all = new ArrayList(); } else if (data instanceof List) { List<M> list = (List) data; all = new ArrayList(list); } else if (data instanceof ListLoadResult) { all = new ArrayList(((ListLoadResult) data).getData()); } for (M m : all) { registerModel(m); } if (config != null && config.getSortInfo() != null && !Util.isEmptyString(config.getSortInfo().getSortField())) { sortInfo = config.getSortInfo(); } else { sortInfo = new SortInfo(); } if (filtersEnabled) { filtersEnabled = false; applyFilters(filterProperty); } if (storeSorter != null) { applySort(true); } fireEvent(DataChanged, createStoreEvent()); }