首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

getConfigurationElementsFor 没法获得扩展点的信息

2012-07-29 
getConfigurationElementsFor 无法获得扩展点的信息IConfigurationElement[]?configurationElements????

getConfigurationElementsFor 无法获得扩展点的信息

    IConfigurationElement[]?configurationElements?=??? ????????????Platform.getExtensionRegistry().getConfigurationElementsFor(ExtensionPointId);??

?无法取得扩展点信息,原因是要在plugin.xml中的Extension Points界面中增加扩展点信息,点击add按钮,就会在工程schema文件夹下面生成.exsd文件。

有了这个文件,plugin.xml中自定义的扩展点才会被识别。

?

Extension Point

Plug-in with extension point (plugin_id ):

plugin.xml > Extension Points > Add > ID=point_id , Name

point_id .exsd > Definition > New Element > Name=element_name

element_name > New Attribute > Name=class_name , Type=java, Implements=package_name .InterfaceName > Implements

point_id .exsd > Definition > extension > New Choice > right-click > New > element_name

plugin.xml > Runtime > Exported Packages > Add > package_name

Activator.start (for example):

 IConfigurationElement[] elements = Platform.getExtensionRegistry ().getConfigurationElementsFor ("plugin_id.point_id"); for (IConfigurationElement e?: elements) {   Object o = e.createExecutableExtension ("class_name");   if (o instanceof InterfaceName) {   } }

Plug-in with extension:

MANIFEST.MF > Dependencies > Required Plug-ins > plugin with extension point

MANIFEST.MF > Extensions > Add > plugin_id.point_id > right-click > New > element_name > class_name

Add plug-in with extension to run configuration.

热点排行