<!ELEMENT extension (factory+)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
<!ATTLIST factory
adaptableType CDATA #REQUIRED
class CDATA #REQUIRED>
<!ELEMENT adapter EMPTY>
<!ATTLIST adapter
type CDATA #REQUIRED>
<extension point=
"org.eclipse.core.runtime.adapters"
>
<factory class=
"com.xyz.MyFileAdapterFactory"
adaptableType=
"org.eclipse.core.resources.IFile"
>
<adapter type=
"com.xyz.MyFile"
/>
</factory>
</extension>
IAdapterManager.hasAdapter
方法来查询或者使用 IAdapterFactory 上的其中一种 getAdapter 方法来检索使用此扩展点注册的适配器工厂。在运行时不需要使用 IAdapterFactory.registerAdapters 来注册使用此扩展点来注册的适配器工厂。
Copyright (c) 2004, 2005 IBM Corporation and others.
All rights reserved. This program and the accompanying materials are made
available under the terms of the Eclipse Public License v1.0 which
accompanies
this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html