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