01: /*******************************************************************************
02: * Copyright (c) 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.tests.views.properties.tabbed.override.tablist;
11:
12: import org.eclipse.ui.views.properties.tabbed.ISectionDescriptor;
13: import org.eclipse.ui.views.properties.tabbed.ISectionDescriptorProvider;
14:
15: /**
16: * Section descriptor provider for the override tests example.
17: * <p>
18: * The OverrideTestsView TabbedPropertySheetPage example is a look at the
19: * properties view after the migration of a TabFolder/TabItem framework to the
20: * tabbed properties view. In the case of a TabFolder, the folder (provider)
21: * knows both the tab labels and tab items. This aligns to the tabbed properties
22: * view, but the tab labels are tab descriptors and tab items are section
23: * descriptions. This does not work with the default framework as the tabs
24: * provide the sections. In this case, the IOverridableTabListContentProvider
25: * framework has been provided.
26: * <p>
27: * The overridable tab list is a content provider that provides both the
28: * sections and the tab labels.
29: *
30: * @author Anthony Hunter
31: * @since 3.4
32: */
33: public class OverrideTestsSectionDescriptorProvider implements
34: ISectionDescriptorProvider {
35:
36: private ISectionDescriptor[] sectionDescriptors;
37:
38: /*
39: * (non-Javadoc)
40: *
41: * @see org.eclipse.ui.views.properties.tabbed.ISectionDescriptorProvider#getSectionDescriptors()
42: */
43: public ISectionDescriptor[] getSectionDescriptors() {
44: if (sectionDescriptors == null) {
45: sectionDescriptors = new ISectionDescriptor[] { new OverrideTestsSectionDescriptor() };
46: }
47: return sectionDescriptors;
48: }
49: }
|