FileEditorProvider question

Does anyone know of a simple example plugin which uses FileEditorProvider? Or any good pages explaining it?
All I know at the moment is use

<extensions defaultExtensionNs="com.intellij">
<fileEditorProvider implementation="...">
</extensions>

in plugin.xml

I'm looking to write a plugin with a feature similar to the GUIDesigner in which you have a new tab appear for editing.

Any help would be greatly appreciated :)

5 comments
Comment actions Permalink

There's a few implementations available in Community sources, just search for implementations in. What exactly is your question(s)/problem(s)

0
Comment actions Permalink

Oh I was asking if someone knows of a plugin that uses FileEditorProvider from this list below, because I've been looking through them but haven't found one yet..
But thanks I will try searching for implementations. :D
https://docs.google.com/spreadsheet/lv?key=0ApDPbpSNCArIdE9nWF9CRjgxUHBHZV8xeDNKWUZ0Zmc&rm=full#gid=0

As for specific questions: I'm just getting started so this is as specific I can get:

My understanding is that you have to create three classes (just keeping it simple at the moment):

1) Class that implements FileEditorProvider - in particular create a new instance of the editor and return it in the createEditor method
2) Class (the editor) that implements FileEditor - in particular return an instance of a JComponent that will appear on screen
3) An editor JComponent class (currently thinking of extending a JPanel)?

Question 1:
How do I know where the contents of the editor class will show up in the window? Does it just automatically appear as a new tab?


Question 2:
So far all I have learned is the action system.. but how do you make the editor appear in a new tab for example, after the user clicks on something?
What exactly happens as a result of adding something to <extensions defaultExtensionNs="com.intellij"> </extensions>?

I suppose it's what the tool window sample was trying to show?
http://confluence.jetbrains.com/pages/viewpage.action?pageId=36020355

0
Comment actions Permalink

Unfortunately there's no easy way (I know of) to scan all 3rd party plugins for usage of certain classes from IntelliJ Platform, so you'll have to dig through the sources manually if you really a 3rd-party sample plugin.
See com.intellij.openapi.fileEditor.impl.text.LargeFileEditorProvider for a very basic example

Exactly, you'll have to create three classes to provide custom editor/component in your newly added tab. The Tab will automatically appear according to the implementation you provide in FileEditorProvider#accept.
Return FileEditorPolicy.PLACE_AFTER_DEFAULT_EDITOR from com.intellij.openapi.fileEditor.FileEditorProvider#getPolicy to add an additional tab if you don't want to replace default editor.

Please see http://confluence.jetbrains.com/display/IDEADEV/PluginDevelopment to get started with plugin development. Extension points are discussed here: http://confluence.jetbrains.com/display/IDEADEV/IntelliJ+IDEA+Plugin+Structure#IntelliJIDEAPluginStructure-PluginExtensions

0
Comment actions Permalink
Unfortunately there's no easy way (I know of) to scan all 3rd party plugins for usage of certain classes from IntelliJ Platform


Thankfully the majority of IDEA plugins are hosted on GitHub, so I recommend searching opensource repositories for API usages :)
Generally it's best to do this by searching for either the extension point XML tag or the base/super class to extend.

If you're unsure of a particular extension point to use, it can also be a good idea to search the plugin repository and find a plugin that already offers this functionality.

Additionally, unfortunately the search functionality on these forums are not the best; So if you are searching for terms and getting no results, you might get lucky by trying different synonyms

That's just my two cents however, good luck with your plugin Shasti R!

0
Comment actions Permalink

Thank you for the suggestions, I will try searching around
:D

0

Please sign in to leave a comment.