Mercurial > projects > dwt-addons
comparison dwtx/core/runtime/IAdapterFactory.d @ 3:6518c18a01f7
eclipse.core package without osgi dependencies
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 26 Mar 2008 00:57:19 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
2:a012107a911c | 3:6518c18a01f7 |
---|---|
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 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwtx.core.runtime.IAdapterFactory; | |
14 | |
15 import dwt.dwthelper.utils; | |
16 | |
17 /** | |
18 * An adapter factory defines behavioral extensions for | |
19 * one or more classes that implements the <code>IAdaptable</code> | |
20 * interface. Adapter factories are registered with an | |
21 * adapter manager. | |
22 * <p> | |
23 * This interface can be used without OSGi running. | |
24 * </p><p> | |
25 * Clients may implement this interface. | |
26 * </p> | |
27 * @see IAdapterManager | |
28 * @see IAdaptable | |
29 */ | |
30 public interface IAdapterFactory { | |
31 /** | |
32 * Returns an object which is an instance of the given class | |
33 * associated with the given object. Returns <code>null</code> if | |
34 * no such object can be found. | |
35 * | |
36 * @param adaptableObject the adaptable object being queried | |
37 * (usually an instance of <code>IAdaptable</code>) | |
38 * @param adapterType the type of adapter to look up | |
39 * @return a object castable to the given adapter type, | |
40 * or <code>null</code> if this adapter factory | |
41 * does not have an adapter of the given type for the | |
42 * given object | |
43 */ | |
44 public Object getAdapter(Object adaptableObject, ClassInfo adapterType); | |
45 | |
46 /** | |
47 * Returns the collection of adapter types handled by this | |
48 * factory. | |
49 * <p> | |
50 * This method is generally used by an adapter manager | |
51 * to discover which adapter types are supported, in advance | |
52 * of dispatching any actual <code>getAdapter</code> requests. | |
53 * </p> | |
54 * | |
55 * @return the collection of adapter types | |
56 */ | |
57 public ClassInfo[] getAdapterList(); | |
58 } |