2011-07-09 55 views
0

我想覆盖我的应用程序中的eclipse的默认重命名功能。 我创建了一个扩展RenameParticipant的类。 在plugin.xml中添加了扩展点在哪里添加eclipse扩展

但它不起作用。 在我的应用程序中有超过30个项目(或插件??)(例如:core,debug,editor,parser,ui等)。我想知道的是,应该在哪里放置我的重命名扩展名。即在哪些项目的plugin.xml我需要添加扩展名重命名?

请帮我弄清楚这一点。我对插件开发很陌生。 由于提前, 安

回答

0

你应该在plugin.xml文件中的使用扩展点org.eclipse.ltk.core.refactoring.renameParticipants插件包含您的参与类,因为扩展点有指参与者类。

例如,请参阅以下在org.eclipse.jdt.ui/plugin.xml中使用org.eclipse.ltk.core.refactoring.renameParticipants扩展点。

<extension point="org.eclipse.ltk.core.refactoring.renameParticipants"> 
    <renameParticipant class="org.eclipse.jdt.internal.corext.refactoring.nls.NLSAccessorFieldRenameParticipant" id="org.eclipse.jdt.ui.NLSFieldRenameParticipant" name="%Refactoring.NLSFieldRenameParticipant"> 
    <enablement> 
     <with variable="affectedNatures"> 
     <iterate operator="or"> 
      <equals value="org.eclipse.jdt.core.javanature"/> 
     </iterate> 
     </with> 
     <with variable="element"> 
     <instanceof value="org.eclipse.jdt.core.IField"/> 
     </with> 
    </enablement> 
    </renameParticipant> 
</extension>