@Override public TabContents createTab() { List sections = new ArrayList(getSectionDescriptors().size()); for (Iterator iter = getSectionDescriptors().iterator(); iter.hasNext();) { ISectionDescriptor descriptor = (ISectionDescriptor) iter.next(); ISection section = descriptor.getSectionClass(); sections.add(section); } TabContents tab = new TabContents(); tab.setSections((ISection[]) sections.toArray(new ISection[sections .size()])); return tab; }
/** * Hides the given tab. */ private void hideTab(TabContents target) { if (target != null) { Composite tabComposite = (Composite) tabToComposite.get(target); if (tabComposite != null) { target.aboutToBeHidden(); tabComposite.setVisible(false); } } }
/** * Get the section implementation that provides the list of tabs. In our * implementation, all the sections provide the list of tabs, so we select * the first section from the tab descriptor. * * @return the section. */ private AbstractOverridableTabListPropertySection getOverridableTabListPropertySection() { TabContents tab = tabbedPropertySheetPage.getCurrentTab(); Assert.isNotNull(tab); if (tab != null) { ISection section = tab.getSectionAtIndex(0); if (section instanceof AbstractOverridableTabListPropertySection) { return (AbstractOverridableTabListPropertySection) section; } } return null; } }
if (activePropertySheet) { if (currentTab != null) { currentTab.aboutToBeHidden(); currentTab.aboutToBeShown(); currentTab.refresh();
if (tabComposite == null) { tabComposite = createTabComposite(); tab.createControls(tabComposite, TabbedPropertySheetPage.this); tab.setInput(tabbedPropertyViewer.getWorkbenchPart(), (ISelection) tabbedPropertyViewer.getInput()); tab.refresh();
.remove(descriptor); if (tab != null && tab.controlsHaveBeenCreated()) { if (tab == currentTab) { disposingCurrentTab = false; currentTab.aboutToBeHidden(); currentTab = null;
/** * Refresh the currently active tab. */ public void refresh() { currentTab.refresh(); }
/** * Disposes the TabContents objects passed to this method. If the * 'currentTab' is going to be disposed, then the caller should call * aboutToBeHidden() on the currentTab and set it to null before calling * this method. Also, the caller needs to ensure that descriptorToTab map * entries corresponding to the disposed TabContents objects are also * removed. * * @param tabs * @since 3.6 */ protected void disposeTabs(Collection tabs) { for (Iterator iter = tabs.iterator(); iter.hasNext();) { TabContents tab = (TabContents) iter.next(); Composite composite = (Composite) tabToComposite.remove(tab); tab.dispose(); if (composite != null) { composite.dispose(); } } }
/** * Shows the given tab. */ private void showTab(TabContents target) { if (target != null) { Composite tabComposite = (Composite) tabToComposite.get(target); if (tabComposite != null) { /** * the following method call order is important - do not * change it or the widgets might be drawn incorrectly */ tabComposite.moveAbove(null); target.aboutToBeShown(); tabComposite.setVisible(true); } } }
currentTab.aboutToBeHidden(); currentTab = null;