简体   繁体   English

XText编辑器作为Eclipse插件

[英]XText Editor as an Eclipse Plugin

I'm doing an XText Editor as an Eclipse Plugin. 我正在做一个XText编辑器作为Eclipse插件。 Till now I've created XText plugin but its not loaded in the eclipse wizard… but the functionality is live, ie, I'm able to create a mydsl file and make use of its grammar. 到目前为止,我已经创建了XText插件,但是尚未将其加载到eclipse向导中……但是该功能是实时的,即,我能够创建mydsl文件并利用其语法。

Secondly… if i place the generated plugin file in the plugins folder of Eclipse still it is not loaded in the choose wizard. 其次,如果我将生成的插件文件放置在Eclipse的plugins文件夹中,则它仍不会加载到选择向导中。 How do I make it available in the list of plugins? 如何在插件列表中使用它?

Xtext doesn't generate a project wizard by default. 默认情况下,Xtext不会生成项目向导。 If you want this wizard, you have to add a fragment to your DSL generation workflow and relaunch the workflow. 如果需要此向导,则必须向DSL生成工作流添加一个片段,然后重新启动该工作流。

fragment = projectWizard.SimpleProjectWizardFragment {
    generatorProjectName = "${projectName}.generator"
    modelFileExtension = file.extensions
} 

Then, you have to merge plugin.xml with plugin_gen.xml from ui plugin. 然后,您必须将ui插件中的plugin.xml与plugin_gen.xml合并。 A new extension point has been added: 添加了新的扩展点:

<extension point="org.eclipse.ui.newWizards">
  <wizard category="org.eclipse.xtext.projectwiz"
    class="org.eclipse.xtext.example.domainmodel.ui.DomainmodelExecutableExtensionFactory:org.eclipse.xtext.example.domainmodel.ui.wizard.DomainmodelNewProjectWizard"
        id="org.eclipse.xtext.example.domainmodel.ui.wizard.DomainmodelNewProjectWizard"
        name="Domainmodel Project"
        project="true">
  </wizard>
</extension>

More informations here . 更多信息在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM