tab.setDescription(DesignAttributeHandler .readAttribute("description", attr, String.class));
private void disableCompositesTabIfNecessary(Mbean newModel) { boolean alreadyDisabled = !getTab(compositesLayout).isEnabled(); boolean shouldDisable = newModel == null || newModel.getCompAttrib().isEmpty(); boolean disabled = shouldDisable || alreadyDisabled; //so we do not overwrite enable/disable while already disabled due to another component //disable composites tab, if there are no composites getTab(compositesLayout).setEnabled(!disabled); getTab(compositesLayout).setDescription(disabled ? "no composites available" : null); }
public void moveTab(Component c, int position) { Tab oldTab = getTab(c); String tabId = tabIds.inverse().get(oldTab); String tabCubaId = getCubaId(oldTab); // do not detach close handler // call super super.removeComponent(oldTab.getComponent()); Tab newTab = addTab(c, position); newTab.setCaption(oldTab.getCaption()); newTab.setDescription(oldTab.getDescription()); newTab.setClosable(oldTab.isClosable()); newTab.setEnabled(oldTab.isEnabled()); newTab.setVisible(oldTab.isVisible()); newTab.setIcon(oldTab.getIcon()); newTab.setStyleName(oldTab.getStyleName()); setCubaId(newTab, tabCubaId); if (tabId != null) { tabIds.remove(tabId); tabIds.put(tabId, newTab); } }
@Override public void setTabDescription(String tabId, String description) { getTabNN(tabId).setDescription(description); }
@Override public TabBuilder<C> description(Localizable description) { ObjectUtils.argumentNotNull(description, "Localizable must be not null"); tab.setDescription(LocalizationContext.translate(description, true)); return this; }
@Override public void setTabDescription(String tabId, String description) { Tab tab = getTabNN(tabId); ((TabImpl) tab).getTabbarTab() .setDescription(description); }
@Override public void setDescription(String description) { getVaadinTab().setDescription(description); }
/** * Copies properties from one Tab to another. * * @param from * The tab whose data to copy. * @param to * The tab to which copy the data. */ private static void copyTabMetadata(Tab from, Tab to) { to.setCaption(from.getCaption()); to.setIcon(from.getIcon(), from.getIconAlternateText()); to.setDescription(from.getDescription()); to.setVisible(from.isVisible()); to.setEnabled(from.isEnabled()); to.setClosable(from.isClosable()); to.setStyleName(from.getStyleName()); to.setComponentError(from.getComponentError()); }