Reputation: 488
Say I have a custom editor inspired by the C Editor, but besides all its features I want to add several more of my own, and maybe change some functionalities from the C Editor to better suit me.
Now the core editor class can extend pretty easily the C Editor class and override methods or add more methods.
But how can I import extensions and extension points to make them work exactly as in the editor I'm extending?
Some buttons are greyed out, although the shortcuts work for some reason.(i.e "Show Whitespace Character" and "Toggle Block Selection"). Some buttons like the "Show Mark Occurence" are missing entirely. Some buttons like Next & Previous Annotation are greyed out and don't work by shortcut either.
I gather some of these are extensions added in the C Editor, but without trying to replicate them all from scratch, is there a way to inherit them in my editor?
The C Editor seems to be doing something like this, since it doesn't appear to contain the extension for the "Toggle Block Selection", which is present in the TextEditor it extends.
Upvotes: 1
Views: 204
Reputation: 7970
You need to fill in the contributorClass
field in the org.eclipse.ui.editors
extension point.
From the docs:
This class is used to add new actions to the workbench menu and tool bar which reflect the features of the editor type.
Upvotes: 1