• <i id='GhfRM'><tr id='GhfRM'><dt id='GhfRM'><q id='GhfRM'><span id='GhfRM'><b id='GhfRM'><form id='GhfRM'><ins id='GhfRM'></ins><ul id='GhfRM'></ul><sub id='GhfRM'></sub></form><legend id='GhfRM'></legend><bdo id='GhfRM'><pre id='GhfRM'><center id='GhfRM'></center></pre></bdo></b><th id='GhfRM'></th></span></q></dt></tr></i><div id='GhfRM'><tfoot id='GhfRM'></tfoot><dl id='GhfRM'><fieldset id='GhfRM'></fieldset></dl></div>

  • <tfoot id='GhfRM'></tfoot>

      <small id='GhfRM'></small><noframes id='GhfRM'>

        <bdo id='GhfRM'></bdo><ul id='GhfRM'></ul>

    1. <legend id='GhfRM'><style id='GhfRM'><dir id='GhfRM'><q id='GhfRM'></q></dir></style></legend>

        编写 Eclipse 插件来修改编辑器首选项

        Writing Eclipse plugin to modify Editor Preferences(编写 Eclipse 插件来修改编辑器首选项)

        <small id='Jyo8X'></small><noframes id='Jyo8X'>

            <bdo id='Jyo8X'></bdo><ul id='Jyo8X'></ul>
              <tbody id='Jyo8X'></tbody>
            <legend id='Jyo8X'><style id='Jyo8X'><dir id='Jyo8X'><q id='Jyo8X'></q></dir></style></legend>

                <tfoot id='Jyo8X'></tfoot>
                <i id='Jyo8X'><tr id='Jyo8X'><dt id='Jyo8X'><q id='Jyo8X'><span id='Jyo8X'><b id='Jyo8X'><form id='Jyo8X'><ins id='Jyo8X'></ins><ul id='Jyo8X'></ul><sub id='Jyo8X'></sub></form><legend id='Jyo8X'></legend><bdo id='Jyo8X'><pre id='Jyo8X'><center id='Jyo8X'></center></pre></bdo></b><th id='Jyo8X'></th></span></q></dt></tr></i><div id='Jyo8X'><tfoot id='Jyo8X'></tfoot><dl id='Jyo8X'><fieldset id='Jyo8X'></fieldset></dl></div>
                1. 本文介绍了编写 Eclipse 插件来修改编辑器首选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想为 Eclipse CDT 开发一个插件(工具栏按钮),用户可以在其中轻松地在 8 和 4 个空格选项卡之间切换并打开/关闭软选项卡.(为什么要问这个问题?感谢我的组织中的编码指南,用于区分 C/C++ 旧代码和新代码)

                  I'd like to develop a plugin (tool bar buttons) for Eclipse CDT where users can easily switch between 8 and 4 spaces tabs and turn on/off soft tabs. (Why bother you asked? Thanks to the coding guideline in my org for tabbing difference between C/C++ legacy and new codes)

                  我设法创建了工具栏按钮,但找不到修改编辑器首选项的信息(通常在工作区首选项 General->Editors->Text Editors 中找到的那些).

                  I managed to create toolbar buttons but I couldn't find information to modify Editor Preferences (The ones you normally find in Workspace preferences General->Editors->Text Editors).

                  问题 4587572 似乎涵盖了一点,但我对插件开发还是很陌生,所以我不真懂.

                  The question 4587572 seems to cover a bit but I'm still very new to Plug-in dev so I don't really understand.

                  我想我想修改 EDITOR_TAB_WIDTH 和 EDITOR_SPACES_FOR_TABS 的属性org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants用于正在运行的文本编辑器.

                  I guess I want to modify EDITOR_TAB_WIDTH and EDITOR_SPACES_FOR_TABS properties of org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants for the running text Editor.

                  不仅修改,我什至无法使用以下代码读取属性.只返回我提供的默认值:30.

                  Not only modifying, I couldn't even read the properties with following code. Just returns me default value:30 I provided.

                  int width = Platform.getPreferencesService().getInt(
                      "org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants",
                      "EDITOR_TAB_WIDTH", 30, null);
                  

                  我的问题总结是:如何从我的插件修改正在运行的编辑器的选项卡设置?

                  My question in summary is: How do I modify tab settings of a running Editor from my plugin?

                  非常感谢您的帮助.

                  推荐答案

                  您可以使用类似于以下的代码来获取和设置任何插件中的首选项.

                  You can use code similar to the following to get and set preferences in any plugin.

                  IPreferenceStore s = new ScopedPreferenceStore(new InstanceScope(), "org.eclipse.ui");
                  ss.setValue("SHOW_MEMORY_MONITOR", true);
                  

                  这篇关于编写 Eclipse 插件来修改编辑器首选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Cannot load 64-bit SWT libraries on 32-bit JVM ( replacing SWT file )(无法在 32 位 JVM 上加载 64 位 SWT 库(替换 SWT 文件))
                  How can I specify the default JVM arguments for programs I run from eclipse?(如何为从 Eclipse 运行的程序指定默认 JVM 参数?)
                  Class JavaLaunchHelper is implemented in both ... libinstrument.dylib. One of the two will be used. Which one is undefined(JavaLaunchHelper 类在... libinstrument.dylib 中都实现了.将使用两者之一.哪个是未定义的) - IT屋-程序员软件开发技术分享
                  Running Eclipse on Windows 7 JRE and JDK not found(找不到在 Windows 7 JRE 和 JDK 上运行 Eclipse)
                  StringBuilder vs. .concat vs. quot;+quot; Operator relative performance different in eclipse than command line?(StringBuilder vs. .concat vs. “+eclipse中的操作员相对性能与命令行不同?)
                  Is there a maximum number you can set Xmx to when trying to increase jvm memory?(尝试增加 jvm 内存时,您可以将 Xmx 设置为最大数量吗?)
                  <i id='hq3ml'><tr id='hq3ml'><dt id='hq3ml'><q id='hq3ml'><span id='hq3ml'><b id='hq3ml'><form id='hq3ml'><ins id='hq3ml'></ins><ul id='hq3ml'></ul><sub id='hq3ml'></sub></form><legend id='hq3ml'></legend><bdo id='hq3ml'><pre id='hq3ml'><center id='hq3ml'></center></pre></bdo></b><th id='hq3ml'></th></span></q></dt></tr></i><div id='hq3ml'><tfoot id='hq3ml'></tfoot><dl id='hq3ml'><fieldset id='hq3ml'></fieldset></dl></div>
                      <bdo id='hq3ml'></bdo><ul id='hq3ml'></ul>

                            <tfoot id='hq3ml'></tfoot>
                          1. <small id='hq3ml'></small><noframes id='hq3ml'>

                            <legend id='hq3ml'><style id='hq3ml'><dir id='hq3ml'><q id='hq3ml'></q></dir></style></legend>
                              <tbody id='hq3ml'></tbody>