Tab tab = this.addTab(child); if (attr.hasKey("visible")) { tab.setVisible(DesignAttributeHandler.readAttribute("visible", attr, Boolean.class));
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 setVisible(boolean visible) { getVaadinTab().setVisible(visible); }
@Override public void setVisible(boolean visible) { getVaadinTab().setVisible(visible); }
@Override public TabBuilder<C> visible(boolean visible) { tab.setVisible(visible); return this; }
@Override public void setVisible(boolean visible) { tabbarTab.setVisible(visible); }
private void updateTabVisibility() { for (int i=0; i<tabSheet.getComponentCount(); i++) { TabSheet.Tab tab = tabSheet.getTab(i); if (tab.getComponent() instanceof SelectionAwareTable) { ContentType contentType = ((SelectionAwareTable) tab.getComponent()).getContentType(); boolean visible = m_graphContainer.getTopologyServiceClient().contributesTo(contentType); tab.setVisible(visible); } } }
private void updateTabVisibility() { for (int i=0; i<tabSheet.getComponentCount(); i++) { TabSheet.Tab tab = tabSheet.getTab(i); if (tab.getComponent() instanceof SelectionAwareTable) { ContentType contentType = ((SelectionAwareTable) tab.getComponent()).getContentType(); boolean visible = m_graphContainer.getTopologyServiceClient().contributesTo(contentType); tab.setVisible(visible); } } }
/** * 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()); }