Building a custom editor
Hello everyone.
I'm currently trying to implement a custom editor handling text-type files and replacing the default editor. I've written the editor class itself, implementing FileEditor, and I've written a provider implementing FileEditorProvider. I've also registered the provider at the fileEditorProvider extension point in my plugins.xml. Unfortunately, that's as far as I got using these forums, because the related threads all seem to be from around 2006 and using a lot of deprecated functions.
The current problem is that the editor is properly spawned by the provider, but it doesn't show up in the UI. It seems to just generate an empty panel. Do I need to implement another class that I'm still missing? So far I've just generated a new JPanel in my editor's constructor and returned that in the getComponent() and getPreferredFocusComponent() methods, not doing any manual work on it. I'm guessing that's not enough, so hopefully someone can throw me some pointers. :)
Thank you for your time.
Please sign in to leave a comment.
What you see in UI is what your FileEditor returns from 'getComponent()' method. If I understood correctly, you just return 'new JPanel()' from it, and you see empty panel in UI. That looks like an expected result.