KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > navigator > resources > workbench > TabbedPropertySheetAdapterFactory


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  ******************************************************************************/

11
12 package org.eclipse.ui.internal.navigator.resources.workbench;
13
14 import org.eclipse.core.runtime.IAdapterFactory;
15 import org.eclipse.ui.navigator.CommonNavigator;
16 import org.eclipse.ui.views.properties.IPropertySheetPage;
17 import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
18
19 /**
20  * An property sheet page adapter factory for the Project Explorer.
21  *
22  * @since 3.2
23  */

24 public class TabbedPropertySheetAdapterFactory
25     implements IAdapterFactory {
26
27     /*
28      * (non-Javadoc)
29      *
30      * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object,
31      * java.lang.Class)
32      */

33     public Object JavaDoc getAdapter(Object JavaDoc adaptableObject, Class JavaDoc adapterType) {
34
35         if (adaptableObject instanceof CommonNavigator) {
36             if (IPropertySheetPage.class == adapterType)
37                 return new TabbedPropertySheetPage(
38                     new TabbedPropertySheetProjectExplorerContributor(
39                         (CommonNavigator) adaptableObject));
40         }
41         return null;
42     }
43
44     /*
45      * (non-Javadoc)
46      *
47      * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
48      */

49     public Class JavaDoc[] getAdapterList() {
50         return new Class JavaDoc[] {IPropertySheetPage.class};
51     }
52
53 }
54
Popular Tags