文档提供程序

标识:org.eclipse.ui.documentProviders

起始发行版:发行版 1.0

描述:此扩展点用来定义文件类型与文档提供程序之间或者编辑器的输入类型与编辑器可使用的文档提供程序之间的映射。文档提供程序必须实现接口 org.eclipse.ui.texteditor.IDocumentProvider。编辑器输入必须是 org.eclipse.ui.IEditorInput 的实例。

配置标记:

   <!ELEMENT extension (provider*)>

   <!ATTLIST extension
     point CDATA #REQUIRED
     id    CDATA #IMPLIED
     name  CDATA #IMPLIED
   >

   <!ELEMENT provider EMPTY>

   <!ATTLIST provider
     extensions CDATA #IMPLIED
     inputTypes CDATA #IMPLIED
     class      CDATA #REQUIRED
     id         CDATA #REQUIRED
   >

示例:
<extension point="org.eclipse.ui.documentProviders">
    <provider
        extensions=".jav" 
        class="org.eclipse.ui.examples.javaeditor.JavaDocumentProvider" 
        id="org.eclipse.ui.examples.javaeditor.JavaDocumentProvider">
    </provider>
   </extension> 

此示例将 org.eclipse.ui.examples.javaeditor.JavaDocumentProvider 注册为扩展名为“.jav”的文件的缺省提供程序。

<extension point="org.eclipse.ui.documentProviders">
    <provider
        inputTypes="org.eclipse.ui.IStorageEditorInput" 
        class="org.eclipse.ui.editors.text.FileDocumentProvider" 
        id="org.eclipse.ui.editors.text.FileDocumentProvider">
    </provider>
   </extension> 

此示例将 org.eclipse.ui.editors.text.FileDocumentProvider 注册为是 instance of org.eclipse.ui.IStorageEditorInput 的所有编辑器输入的缺省提供程序。

API 信息:为文件扩展名注册的文档提供程序优先于为输入类型注册的那些文档提供程序。文档提供程序必须实现接口 org.eclipse.ui.texteditor.IDocumentProvider。编辑器输入必须是 org.eclipse.ui.IEditorInput 的实例。

Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved.