invisible Editor created by dialog showing up?!
I'm puzzled :
- In an editor.creation listener, I get a lot of NPE when it tries to
access its associated psiFile, because there is none. How is that possible?
- What's even stranger, is that it happens when I press F5, to copy a
class, and only the CopyClass dialog is showing up => I haven't created
anything => no new editor was created by me !?
Any clue?
Alain
Please sign in to leave a comment.
(continued)
..
I also run into Editor having no project associated, so I must write
code like
Is that 'normal', or expected?
Alain
This is absolutely normal since editor aren't only used for project file
editing but smart text fields or consolve view as well.
Maxim
> This is absolutely normal since editor aren't only used for project
file editing but smart text fields or consolve view as well.
I get it.
Don't you think it would be worth/cleaner to split the EditorFactory, or
just give it a little sister:
FileEditorFactory
, so we could write
FileEditorFactory.getInstance ().addFileEditorFactoryListener (..);
That would save us from adding the filtering plumbing in every single
editor listeners we write, to make sure we only watch file editors?
Does it make sense to you?
Alain
There's already one called FileEditorManager :)
FileEditorManager.getInstance(project).addFileEditorManagerListener(xxx);
Maxim
>> just give it a little sister:
>> FileEditorFactory
>
> There's already one called FileEditorManager :)
>
FileEditorManager.getInstance(project).addFileEditorManagerListener(xxx);
1/
Thanks.
Memo to self:
EditorFactory.
is the sister/cousin of
FileEditorManager
2/
When all you can do to find answers is guessing with poles and
Alt-Ctrl-N, names are important.
Once again, it shows there is a need for some solid base documentation
on the openAPI. Plugins are important to the success of IDEA. You
shouldn't delay this step too long.
Alain
Alain Ravet wrote:
It's Shift-Alt-Ctrl-N of course,
and
"Ctrl-N : accept package in pattern. "
http://www.intellij.net/tracker/idea/viewSCR?publicId=19948
(!! it's still "to be discussed" )
would help a LOT: looking for *Manager, without being able to say "look
only in com.intellij.*", brings a lot of noise in the result.
Alain