Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/334.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java eclipse插件开发-右键单击首选项菜单?_Java_Eclipse_Eclipse Plugin_Eclipse Rcp_Plugin.xml - Fatal编程技术网

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

Java eclipse插件开发-右键单击首选项菜单?,java,eclipse,eclipse-plugin,eclipse-rcp,plugin.xml,Java,Eclipse,Eclipse Plugin,Eclipse Rcp,Plugin.xml,我正在开发eclipse插件。 当右键单击并在我的编辑器插件中选择“preferences”时,它将显示eclipse“General”树项,其中包含两个子树项-“外观”和“编辑器”。 在“编辑器”下,选择了另一个树项“文本编辑器” 当右键单击plugin.xml中声明为“org.eclipse.ui.preferencePages”扩展点的“preferences”项目时,如何更改显示的行为 谢谢,这取决于你的编辑器是从哪个类派生的。如果它派生自org.eclipse.ui.textedito

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

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


谢谢,这取决于你的编辑器是从哪个类派生的。如果它派生自
org.eclipse.ui.texteditor.AbstractDecoratedTextEditor
或其众多子类之一,则可以重写
CollectContextMenuPreferencePage
。默认设置为:

/**
 * 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", 
        };
}
/**
*返回执行时要显示的首选项页的首选项页ID
*“编辑器”上下文菜单中的“首选项”操作。将选择第一页。
*
*子类可以扩展或替换。
*

* *@返回要显示的首选项页面ID,可能为空 */ 受保护的字符串[]collectContextMenuPreferencePages(){ 返回新字符串[]{“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”, }; }
是。它扩展了org.eclipse.ui.editors.text.TextEditor,后者扩展了AbstractDecoratedTextEditor