Java 类org.eclipse.ui.views.properties.tabbed.ISection 实例源码

项目:seg.jUCMNav    文件:GEFTabbedPropertySheetPage.java   
protected TabContents createTab(ITabDescriptor tabDescriptor) {
    TabContents content = super.createTab(tabDescriptor);

    ISection[] sections = content.getSections();
    for (int i = 0; i < sections.length; i++) {
        if (sections[i] instanceof AbstractGEFPropertySection) {
            AbstractGEFPropertySection current = (AbstractGEFPropertySection) sections[i];

            if (!maxLabelWidth.containsKey(tabDescriptor.getId()))
                maxLabelWidth.put(tabDescriptor.getId(), ""); //$NON-NLS-1$

            sectionToTab.put(current, tabDescriptor.getId());

            if (current.getLabelText().length() > ((String) maxLabelWidth.get(tabDescriptor.getId())).length()) {
                maxLabelWidth.put(tabDescriptor.getId(), current.getLabelText());
            }
        }
    }

    return content;
}