List of usage examples for com.vaadin.ui TabSheet removeAllComponents
@Override public void removeAllComponents()
From source file:de.catma.ui.visualizer.VisualizationManagerView.java
License:Open Source License
/** * Additional handling for charts because when closing a non active chart, * the active chart becomes empty. In addition to the standard behaviour this * method removes and reinserts all remaining {@link DistributionChartView}s. * /* www . ja v a 2s.c om*/ * @see de.catma.ui.tabbedview.TabbedView#onTabClose(com.vaadin.ui.TabSheet, com.vaadin.ui.Component) */ @Override public void onTabClose(TabSheet tabsheet, Component tabContent) { Iterator<Component> compIter = tabsheet.getComponentIterator(); HashSet<Component> contents = new HashSet<Component>(); while (compIter.hasNext()) { contents.add(compIter.next()); } boolean hasLeft = (tabsheet.getComponentCount() > 1); super.onTabClose(tabsheet, tabContent); if (hasLeft) { tabsheet.removeAllComponents(); contents.remove(tabContent); for (Component c : contents) { addClosableTab((ClosableTab) c, c.toString()); } } }