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;
11:
12: import org.eclipse.core.resources.IResource;
13: import org.eclipse.core.runtime.IAdaptable;
14:
15: /**
16: * The IContributorResourceAdapter is an interface that defines
17: * the API required to get a resource that an object adapts to
18: * for use of object contributions, decorators and property
19: * pages that have adaptable = true.
20: * Implementors of this interface are typically registered with an
21: * IAdapterFactory for lookup via the getAdapter() mechanism.
22: */
23: public interface IContributorResourceAdapter {
24:
25: /**
26: * Return the resource that the supplied adaptable
27: * adapts to. An IContributorResourceAdapter assumes
28: * that any object passed to it adapts to one equivalent
29: * resource.
30: *
31: * @param adaptable the adaptable being queried
32: * @return a resource, or <code>null</code> if there
33: * is no adapted resource for this type
34: */
35: public IResource getAdaptedResource(IAdaptable adaptable);
36:
37: }
|