简体   繁体   中英

Eclipse Plugin Development: multipage editor with html extension

I've created a plugin from wizard "Plugin with a mutli tab Editor".

Problem: In Project Configuration if I set the File Extension field to html , the plugin not works. If I leave it mpe (pre-inserted field) or I insert another unknown file extension, then it works.

What can cause this problem and how can I activate the plugin for html files?

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).

在此处输入图片说明

Ok. Eclipse generate all files and a project that works. So, if I test it:

日食

and I create a test project with a test.mpe files

测试项目

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. 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

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 .

The problem is what nitind said. 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. So then the file will be opened in your created editor, but not with the default html editor.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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