problem: EditorFactoryListener comes too early


Short version :
-



How can we ask an editor to do some stuff, when it is created, just
before it gives the control back to the user.


Details :
-



When the user opens a java file in an editor, IDEA will

1/ load the file in some way
2/ ...
3/ add all the persisted fold regions (methods, fold selection, etc..)
4/ ...

and finally
5/ give the control back to the user.



I need to do some action after (3), and before (5)


Problem :
-



The /EditorFactoryListener/ only allow us to place some action before (3).
That's too early, as IDEA hasn't created the FoldRegions yet.


Question :
-



How can we "inject" some action, between (3) and (5).


Alain

6 comments


It's so basic, I feel this feature must be there, but I just don't know
its name, so I can't call it.
Does anybody know its name? I guess it must be xxxListener, or something
like that.


Alain

0


Any comment on this one?

It limits the level of automation I can bring into the CamouflagePlugin, so I'd be happy to find a workaround.

Alain

0

I'm afraid there is no such listener. As a workaround you may try to use
SwingUtilities.invokeLater in editrCreated but I'm not sure if it will work.

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

"Alain Ravet" <alain.ravet.list@wanadoo.be> wrote in message
news:bnmmi7$anm$1@is.intellij.net...
>

Short version :
----------

>

How can we ask an editor to do some stuff, when it is created, just
before it gives the control back to the user.

>
>

Details :
----------

>

When the user opens a java file in an editor, IDEA will

>

1/ load the file in some way
2/ ...
3/ add all the persisted fold regions (methods, fold selection, etc..)
4/ ...

>

and finally
5/ give the control back to the user.

>
>
>

I need to do some action after (3), and before (5)

>
>

Problem :
---------

>

The /EditorFactoryListener/ only allow us to place some action before (3).
That's too early, as IDEA hasn't created the FoldRegions yet.

>
>

Question :
---------

>

How can we "inject" some action, between (3) and (5).

>
>

Alain

>


0

Valentin Kipiatkov (JetBrains) wrote:

>I'm afraid there is no such listener.
>


I wonder :
Without such a listener, how do you plug the standard initial folding
method - the one I want my code to start after - in the sequence of
actions triggered by new editors creation?


Alain

0

We just listen to editorCreated.
\
--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

"Alain Ravet" <alain.ravet.list@wanadoo.be> wrote in message
news:bodrvj$o61$3@is.intellij.net...

Valentin Kipiatkov (JetBrains) wrote:

>

>I'm afraid there is no such listener.
>

>
>

I wonder :
Without such a listener, how do you plug the standard initial folding
method - the one I want my code to start after - in the sequence of
actions triggered by new editors creation?

>
>

Alain

>


0

Valentin Kipiatkov (JetBrains) wrote:

>We just listen to editorCreated.
>

>

Of course, my mistake.
The problem is still there, though. There is no way to code :
"Tell me when you're done, so I can start my job, and finish your work"

Alain

0

Please sign in to leave a comment.