[英]Adding a template to an extension point in Eclipse
I am a fan of adding extension points to my Eclipse RCP applications, as it makes them very modular. 我喜欢在Eclipse RCP应用程序中添加扩展点,因为它使它们成为非常模块化的。
Now, when you write the extension point schema, it is possible to add the documentation that will be shown in the Extension Point Selection wizard. 现在,当您编写扩展点架构时,可以添加将在“扩展点选择”向导中显示的文档。 This wizard contains also an Available Templates section.
该向导还包含“可用模板”部分。 When a template is selected, some code is generated for you.
选择模板后,将为您生成一些代码。 In this case I would like to use some AbstractClass as my base.
在这种情况下,我想使用一些AbstractClass作为基础。
How do I add a template in this section? 如何在本节中添加模板? I couldn't find this in the schema editor.
我在模式编辑器中找不到。
You can have a look at the org.eclipse.pde.ui.templates extension point. 您可以查看org.eclipse.pde.ui.templates扩展点。
With this you need to have a class that implements ITemplateSection, and associate it whit the extension point you want the template to be in. 有了这个,您需要一个实现ITemplateSection的类,并将其与希望模板包含在其中的扩展点相关联。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.