1.编辑.exsd文件:(如,datafactory.exsd内容如下) <?xml version=‘1.0‘ encoding=‘UTF-8‘?> <!-- Schema file written by PDE --> <schema targetNamespace="example.my.treeview"> <annotation> <appInfo> <meta.schema plugin="example.my.treeview" id="datafactory" name="Data Factory"/> </appInfo> <documentation> [Enter description of this extension point.] </documentation> </annotation> <element name="extension"> <complexType> <sequence> <element ref="factory"/> </sequence> <attribute name="point" type="string" use="required"> <annotation> <documentation> </documentation> </annotation> </attribute> <attribute name="id" type="string"> <annotation> <documentation> </documentation> </annotation> </attribute> <attribute name="name" type="string"> <annotation> <documentation> </documentation> <appInfo> <meta.attribute translatable="true"/> </appInfo> </annotation> </attribute> </complexType> </element> <element name="factory"> <complexType> <attribute name="id" type="string"> <annotation> <documentation> </documentation> </annotation> </attribute> <attribute name="name" type="string"> <annotation> <documentation> </documentation> </annotation> </attribute> <attribute name="class" type="string" use="required"> <annotation> <documentation> </documentation> </annotation> </attribute> </complexType> </element> <annotation> <appInfo> <meta.section type="since"/> </appInfo> <documentation> [Enter the first release in which this extension point appears.] </documentation> </annotation> <annotation> <appInfo> <meta.section type="examples"/> </appInfo> <documentation> [Enter extension point usage example here.] </documentation> </annotation> <annotation> <appInfo> <meta.section type="apiInfo"/> </appInfo> <documentation> [Enter API information here.] </documentation> </annotation> <annotation> <appInfo> <meta.section type="implementation"/> </appInfo> <documentation> [Enter information about supplied implementation of this extension point.] </documentation> </annotation> <annotation> <appInfo> <meta.section type="copyright"/> </appInfo> <documentation> </documentation> </annotation> </schema> 2.plugin.xml添加扩展点: <plugin> <extension-point id="datafactory" name="Data Factory" schema="schema/datafactory.exsd"/> <extension point="example.my.treeview.datafactory"> <factory class="example.my.treeview.data.DataFactory"/> </extension> </plugin> 3.实现相应的接口: |
|