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.tests.views.properties.tabbed.model.Element;
13: import org.eclipse.ui.tests.views.properties.tabbed.model.File;
14: import org.eclipse.ui.tests.views.properties.tabbed.model.Folder;
15: import org.eclipse.ui.tests.views.properties.tabbed.override.items.FileItem;
16: import org.eclipse.ui.tests.views.properties.tabbed.override.items.FolderItem;
17: import org.eclipse.ui.tests.views.properties.tabbed.override.items.IOverrideTestsItem;
18:
19: /**
20: * The advanced tab list is displayed when Information, Warning or Error is the
21: * selected element in the override tests view.
22: * <p>
23: * The OverrideTestsView TabbedPropertySheetPage example is a look at the
24: * properties view after the migration of a TabFolder/TabItem framework to the
25: * tabbed properties view. In the case of a TabFolder, the folder (provider)
26: * knows both the tab labels and tab items. This aligns to the tabbed properties
27: * view, but the tab labels are tab descriptors and tab items are section
28: * descriptions. This does not work with the default framework as the tabs
29: * provide the sections. In this case, the IOverridableTabListContentProvider
30: * framework has been provided.
31: * <p>
32: * The overridable tab list is a content provider that provides both the
33: * sections and the tab labels.
34: *
35: * @author Anthony Hunter
36: * @since 3.4
37: */
38: public class AdvancedTabList extends AbstractTabList {
39:
40: private IOverrideTestsItem[] items;
41:
42: /*
43: * (non-Javadoc)
44: *
45: * @see org.eclipse.ui.tests.views.properties.tabbed.override.tablist.AbstractTabList#appliesTo(org.eclipse.ui.tests.views.properties.tabbed.model.Element)
46: */
47: public boolean appliesTo(Element element) {
48: return ((element instanceof File) || (element instanceof Folder));
49: }
50:
51: /*
52: * (non-Javadoc)
53: *
54: * @see org.eclipse.ui.tests.views.properties.tabbed.override.tablist.IOverrideTestsTabList#getItems()
55: */
56: public IOverrideTestsItem[] getItems() {
57: if (items == null) {
58: items = new IOverrideTestsItem[] { new FileItem(),
59: new FolderItem() };
60: }
61: return items;
62: }
63:
64: }
|