/** * Enables the tab with the given index. * * <p> * * @param tabContent the content of the tab that should be enabled */ public void enableTab(E tabContent) { Integer index = new Integer(m_tabPanel.getWidgetIndex(tabContent)); Element tab = getTabElement(index.intValue()); if ((tab != null) && m_disabledTabIndexes.containsKey(index)) { tab.removeClassName(I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().tabDisabled()); tab.setTitle(m_disabledTabIndexes.get(index)); m_disabledTabIndexes.remove(index); } }
/** * Disables the tab with the given index. * * <p> * * @param tabContent the content of the tab that should be disabled * @param reason the reason why the tab is disabled */ public void disableTab(E tabContent, String reason) { Integer index = new Integer(m_tabPanel.getWidgetIndex(tabContent)); Element tab = getTabElement(index.intValue()); if ((tab != null) && !m_disabledTabIndexes.containsKey(index)) { if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(tab.getTitle())) { m_disabledTabIndexes.put(index, tab.getTitle()); } else { m_disabledTabIndexes.put(index, ""); } tab.addClassName(I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().tabDisabled()); tab.setTitle(reason); } }