Bringing up my a Jpanel/Jframe when file of type .lite is opened
Hi,
I want to open up my custom editor when a file with extension .lite is opned( using double click or Ctrl + Shift + N). To start with i am trying to bring up a Jpanel. I have implemented
1. FileEditorProvider
2. FileEditor
I guess something is wrong with component registration. Can some one point out what i am missing?
Please sign in to leave a comment.
Hello Deeps,
1. There is no need to register your FileEditorProvider as both an application
component and an extension. It should be only registered as an extension.
2. If some method is annotated as @NotNull, it means that "return null;"
is not an acceptable implementation of the method. Please implement all methods
correctly.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Thanks Dmitry.
I have implemented all the methods annotated as nonnull but still I do not see a Jpanel on double clicking a the file abc.lite.
Hello Deeps,
You should see two tabs at the bottom of the window, one of them with the
standard text editor and another with your editor.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Hello,
Thanks for your help.
But I do not see tabs at the bottom, am i missing something. I tried debugging it by adding a break point in BswLiteEditorProvider, but it never stopeed there.
Hello Deeps,
Is your plugin shown in the list of plugins on the Welcome screen when you
run the plugin run configuration?
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Hi Dmitry.
I do not see the current editor on welcome screen. It shows few other plugins that i have tried under "My plugins" header and a strange 'Non higlighted " one with "plugin name disabled" title which can not be clicked.
Is it necessary to have an action registered in plugin.xml, to get it working?
Thank you very much for the help.
Deeps.
Hello Deeps,
Are you trying to get your plugin running in IntelliJ IDEA or in some other
IntelliJ Platform-based IDE?
No, that's not necessary.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Thanks Dmitry. It worked when i changed the name field in plugin.xml.
Is there any way to get java input and output files from Virtual Files so that i can use the parsers i have written for my standalone editor. I am using stream tokenizer in my editor for parsing.
Thanks a ton.
It worked, i can open up I/O streams for the virtual file caught by the editorProvider. I am able to change the content through my editor and save them. But I am not able to see them immediately in the textEditor. It takes some time for the text editor to show the changes.
Is there any way to refresh the text editor?
Deepanshu.
Hello Deeps,
You should be performing modifications through a Document, not through a
VirtualFile.
See http://confluence.jetbrains.net/display/IDEADEV/IntelliJIDEAArchitectural+Overview
for more information.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Thanks Dmitry.
But it is working now. Using the virtualFile caught in the FileEditor i am getting the filePath. And uding the filepath i am opening a filestream and doing my editing etc.
After i save using the ouputFileStream i do not see the changes reflected in the textFileEditor tab. Is there any way i can refresh it.
Hello Deeps,
There are many ways to accomplish a task in an IntelliJ IDEA plugin that
seem to be working, and fewer correct ways to accomplish the task. If you
are modifying the contents of a text file in IntelliJ IDEA, the correct way
to accomplish this task is through the Document interface.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
http://confluence.jetbrains.net/display/IDEADEV/IntelliJ+IDEA+Architectural+Overview#IntelliJIDEAArchitecturalOverview-Documents
Correct link (I believe)