01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 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.internal.ide.model;
11:
12: import org.eclipse.core.runtime.IAdapterFactory;
13: import org.eclipse.ui.IFileEditorInput;
14:
15: /**
16: * FileInputAdapterFactory is the adapter factory for the
17: * IFileEditorInput.
18: * @since 3.2
19: *
20: */
21:
22: public class FileInputAdapterFactory implements IAdapterFactory {
23: /*
24: * (non-Javadoc)
25: *
26: * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object,
27: * java.lang.Class)
28: */
29: public Object getAdapter(Object adaptableObject, Class adapterType) {
30: if (adaptableObject instanceof IFileEditorInput)
31: return ((IFileEditorInput) adaptableObject)
32: .getAdapter(adapterType);
33: return null;
34: }
35:
36: /*
37: * (non-Javadoc)
38: *
39: * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
40: */
41: public Class[] getAdapterList() {
42: return new Class[] { IFileEditorInput.class };
43: }
44: }
|