KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > ide > model > FileInputAdapterFactory


1 /*******************************************************************************
2  * Copyright (c) 2000, 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 package org.eclipse.ui.internal.ide.model;
12
13 import org.eclipse.core.runtime.IAdapterFactory;
14 import org.eclipse.ui.IFileEditorInput;
15
16 /**
17  * FileInputAdapterFactory is the adapter factory for the
18  * IFileEditorInput.
19  * @since 3.2
20  *
21  */

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

30     public Object JavaDoc getAdapter(Object JavaDoc adaptableObject, Class JavaDoc adapterType) {
31         if (adaptableObject instanceof IFileEditorInput)
32             return ((IFileEditorInput) adaptableObject).getAdapter(adapterType);
33         return null;
34     }
35
36     /*
37      * (non-Javadoc)
38      *
39      * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
40      */

41     public Class JavaDoc[] getAdapterList() {
42         return new Class JavaDoc[] { IFileEditorInput.class };
43     }
44 }
45
Popular Tags