I'm developing eclipse plugin. When right clicking and chose 'preferences' in my editor plugin it shows two trees 'Appearance' & 'Editors'under 'General'. I want to add few more nodes from Window-->preference which shows code templates, content assist and many more. How can i do that? I have tried overriding collectContextMenuPreferencePages from AbstractDecoratedTextEditor and try to add extension which are related to code templates, however its not showing in preference page.
@Override
protected String[] collectContextMenuPreferencePages() {
return new String[] { "org.eclipse.ui.preferencePages.GeneralTextEditor", //$NON-NLS-1$
"org.eclipse.ui.editors.preferencePages.Annotations", //$NON-NLS-1$
"org.eclipse.ui.editors.preferencePages.QuickDiff", //$NON-NLS-1$
"org.eclipse.ui.editors.preferencePages.Accessibility", //$NON-NLS-1$
"org.eclipse.ui.editors.preferencePages.Spelling", //$NON-NLS-1$
"org.eclipse.ui.editors.preferencePages.LinkedModePreferencePage", //$NON-NLS-1$
"org.eclipse.ui.preferencePages.ColorsAndFonts", //$NON-NLS-1$
"org.eclipse.ui.editors.templates",
};
}
How can i add General node which is present in window-->preference to editor preference? Thank you.
That is the correct method to override.
This is what the Java editor does:
Of course all these ids must be declared using the
org.eclipse.ui.preferencePages
extension point in the usual way.The first page in the array is the one selected when the preferences are shown.