eclipse 如何在eclipse中删除文件关联中的锁定
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12850756/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to remove the lock in file association in eclipse
提问by Mirage
IN Eclipse i want to chnage the default editor of some .htm files.
在 Eclipse 中,我想更改某些 .htm 文件的默认编辑器。
If i try to go to FIle Association and assiciate the default editor then file gets opened in that new editor but i don't get the syntax highlighting.
如果我尝试转到文件关联并关联默认编辑器,则文件将在该新编辑器中打开,但我没有得到语法突出显示。
The solution is that the file association is locked ny some plugin editor
解决办法是文件关联被某些插件编辑器锁定
Preferences -- Context type----text ----Your editor -- reomve the extension
Preferences -- Context type----text ----Your editor -- reomve the extension
But i get the .htm(locked)
so i cant remove it.
但我得到了 .htm(locked)
所以我无法删除它。
Note: Certain items will be marked as "locked". An item is locked if it is one of the associations provided by the plug-in that declares the content type. In other words, you can remove only user-contributed associations.
注意:某些项目将被标记为“锁定”。如果某个项目是声明内容类型的插件提供的关联之一,则该项目将被锁定。换句话说,您只能删除用户贡献的关联。
Is there any way to remove those locks even thought it can be hackish way but i want to do it
有什么方法可以删除这些锁,即使认为它可能是黑客的方式,但我想这样做
回答by Stuart Berg
You don't need to "unlock" an existing association to add a new association and make it the default.
您无需“解锁”现有关联即可添加新关联并将其设为默认关联。
- Add a new association via the "Add" button
- Select the new entry
- Hit the "Default" button to make your new entry the default editor
- 通过“添加”按钮添加新关联
- 选择新条目
- 点击“默认”按钮使您的新条目成为默认编辑器
回答by Sven
Could it be, that you want to change the "File Association"? This can be done in General / Editors / File Associations. BUT Eclipse uses at least one default-editor and this is the reason for the "locked"-message in the "Content Types". You could set the "Text Editor" to all unwanted types. Looks like a workaround, but makes sense, because it is the same as the file associations of your operating system, that asks you for the program to display the file.
难道,你想改变“文件关联”?这可以在常规/编辑器/文件关联中完成。但是 Eclipse 至少使用一个默认编辑器,这就是“内容类型”中“锁定”消息的原因。您可以将“文本编辑器”设置为所有不需要的类型。看起来像是一种解决方法,但很有意义,因为它与操作系统的文件关联相同,要求您让程序显示文件。
Another question is, why do you want to unlock or remove the "Content Type"? Does it change anything in the Eclipse logic?
另一个问题是,为什么要解锁或删除“内容类型”?它会改变 Eclipse 逻辑中的任何内容吗?
回答by Mark
Go see this answer from "Greg Desmarais" (assign the desired editor to "default")
从“Greg Desmarais”中查看此答案(将所需的编辑器指定为“默认”)