简体   繁体   English

Eclipse插件开发:具有html扩展名的多页编辑器

[英]Eclipse Plugin Development: multipage editor with html extension

I've created a plugin from wizard "Plugin with a mutli tab Editor". 我已经从向导“使用mutli选项卡编辑器插入”创建了一个插件。

Problem: In Project Configuration if I set the File Extension field to html , the plugin not works. 问题:如果在“项目配置”中将“ File Extension字段设置为html ,则插件将无法正常工作。 If I leave it mpe (pre-inserted field) or I insert another unknown file extension, then it works. 如果我将其保留为mpe (预插入字段)或插入另一个未知文件扩展名,则它可以工作。

What can cause this problem and how can I activate the plugin for html files? 什么会导致此问题,如何激活html文件的插件?

EDIT: Ok, I'll try to describe step by step my problem. 编辑:好的,我将尝试逐步描述我的问题。

I create a new Plugin Project 我创建一个新的插件项目 新插件项目

I set project name: 我设置项目名称:

项目基础设置

...and the project properties ...以及项目属性

项目属性

I create a plugin using template "multi page editor" 我使用模板“多页编辑器”创建了一个插件

模板插件

Now, I must choose the class names and File Extension (mpe is pre-inserted from eclipse, I leave it for now). 现在,我必须选择类名和文件扩展名 (mpe已从eclipse中预先插入,我暂时保留它)。

在此处输入图片说明

Ok. 好。 Eclipse generate all files and a project that works. Eclipse生成所有文件和一个有效的项目。 So, if I test it: 所以,如果我测试一下:

日食

and I create a test project with a test.mpe files 然后用test.mpe文件创建一个测试项目

测试项目

I can see 3 tabs (because 3 tabs are configured in template code) and a default icon on file name test.mpe on Project Explorer. 我可以在Project Explorer的文件名test.mpe上看到3个选项卡(因为3个选项卡是在模板代码中配置的)和默认图标。 The plugin WORKS! 插件有效!

Now... I close all and I repeat EXACTLY all steps, I using HTML instead of MPE , I test it and... there is no tabs and there is no icon . 现在...我关闭所有和我准确地重复所有步骤,我使用HTML ,而不是MPE ,我测试,并... ... 有没有标签,也没有图标

测试HTML

Why? 为什么? And How can I solve it? 我该如何解决呢?

Your editor is not set as the default, and the one you have installed is being chosen instead. 您的编辑器未设置为默认编辑器,而是选择了已安装的编辑器。 See the full documentation and example at http://help.eclipse.org/juno/topic/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ui_editors.html?cp=2_1_1_143 . 请参阅http://help.eclipse.org/juno/topic/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ui_editors.html?cp=2_1_1_143上的完整文档和示例。

The problem is what nitind said. 问题是nitind所说的。 So simple solution is right click on your created .html file and select Open with and select the editor plugin you installed to open the .html file. 如此简单的解决方案是,右键单击创建的.html文件,然后选择“打开方式”,然后选择安装的编辑器插件以打开.html文件。 So then the file will be opened in your created editor, but not with the default html editor. 因此,该文件将在您创建的编辑器中打开,但不会使用默认的html编辑器打开。

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

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