001: /*******************************************************************************
002: * Copyright (c) 2007 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.ui.tests.views.properties.tabbed.override.tablist;
011:
012: import org.eclipse.swt.graphics.Image;
013: import org.eclipse.ui.tests.views.properties.tabbed.override.items.IOverrideTestsItem;
014: import org.eclipse.ui.views.properties.tabbed.ITabItem;
015:
016: /**
017: * A tab item for the override tests example.
018: * <p>
019: * The OverrideTestsView TabbedPropertySheetPage example is a look at the
020: * properties view after the migration of a TabFolder/TabItem framework to the
021: * tabbed properties view. In the case of a TabFolder, the folder (provider)
022: * knows both the tab labels and tab items. This aligns to the tabbed properties
023: * view, but the tab labels are tab descriptors and tab items are section
024: * descriptions. This does not work with the default framework as the tabs
025: * provide the sections. In this case, the IOverridableTabListContentProvider
026: * framework has been provided.
027: * <p>
028: * The overridable tab list is a content provider that provides both the
029: * sections and the tab labels.
030: *
031: * @author Anthony Hunter
032: * @since 3.4
033: */
034: public class OverrideTestsTabItem implements ITabItem {
035: private IOverrideTestsItem item;
036: private boolean selected = false;
037:
038: /**
039: * Constructor for OverrideTestsTabItem
040: *
041: * @param anItem
042: * the item.
043: */
044: public OverrideTestsTabItem(IOverrideTestsItem anItem) {
045: this .item = anItem;
046: }
047:
048: /*
049: * (non-Javadoc)
050: *
051: * @see org.eclipse.ui.views.properties.tabbed.ITabItem#getImage()
052: */
053: public Image getImage() {
054: return item.getImage();
055: }
056:
057: /**
058: * Get the item.
059: *
060: * @return the item.
061: */
062: public IOverrideTestsItem getItem() {
063: return item;
064: }
065:
066: /*
067: * (non-Javadoc)
068: *
069: * @see org.eclipse.ui.views.properties.tabbed.ITabItem#getText()
070: */
071: public String getText() {
072: return item.getText();
073: }
074:
075: /*
076: * (non-Javadoc)
077: *
078: * @see org.eclipse.ui.views.properties.tabbed.ITabItem#isIndented()
079: */
080: public boolean isIndented() {
081: return false;
082: }
083:
084: /*
085: * (non-Javadoc)
086: *
087: * @see org.eclipse.ui.views.properties.tabbed.ITabItem#isSelected()
088: */
089: public boolean isSelected() {
090: return selected;
091: }
092:
093: /*
094: *
095: */
096: public void setSelected(boolean newSelected) {
097: this.selected = newSelected;
098: }
099:
100: }
|