繁体   English   中英

eclipse插件开发-右键单击首选项菜单?

[英]eclipse plugin development - right click preferences menu?

我正在开发eclipse插件。 右键单击并在我的编辑器插件中选择“首选项”时,它将显示带有两个子树项的“常规”树项-“外观”和“编辑器”。 在“编辑器”下,选择了另一个树项“文本编辑器”。

右键单击“首选项”我在plugin.xml中声明为“ org.eclipse.ui.preferencePages”扩展点的项目时,如何更改行为以显示?

谢谢,Tomer

这取决于您的编辑器来自哪个类。 如果它是从org.eclipse.ui.texteditor.AbstractDecoratedTextEditor或其许多子类之一派生的,则可以重写collectContextMenuPreferencePages 缺省值为:

/**
 * Returns the preference page ids of the preference pages to be shown when executing the
 * preferences action from the editor context menu. The first page will be selected.
 * <p>
 * Subclasses may extend or replace.
 * </p>
 * 
 * @return the preference page ids to show, may be empty
 */
protected String[] collectContextMenuPreferencePages() {
    return new String[] { "org.eclipse.ui.preferencePages.GeneralTextEditor",
            "org.eclipse.ui.editors.preferencePages.Annotations", 
            "org.eclipse.ui.editors.preferencePages.QuickDiff", 
            "org.eclipse.ui.editors.preferencePages.Accessibility", 
            "org.eclipse.ui.editors.preferencePages.Spelling", 
            "org.eclipse.ui.editors.preferencePages.LinkedModePreferencePage", 
            "org.eclipse.ui.preferencePages.ColorsAndFonts", 
        };
}

暂无
暂无

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

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