Event for file created with template content?

Hi,

in my VirtualFileListener, fileCreated(..) is called when I create a new file with a template (e.g. HTML file). At that point, the actual file is still empty (even when I check manually) and the template content is not inserted yet. I also implemented contentsChanged(...) and beforeContentsChange(...), but they are never called for the content of the template.

I need the content of the file. At the moment I help myself by waiting for the FileEditorManagerListener.openEditor() event that gets triggered right aftter creating a file (because the editor is opened for newly created files) and get the content there.

This seems a bit wrong, though. Is there an alternative point, where I can access the file content?

Regards,
Holger

2 comments
Comment actions Permalink

You can set up a DocumentListener to watch for document change notifications. However, there may be a better way to solve your problem - what exactly are you trying to accomplish?

0
Comment actions Permalink

I'd like to take the new file and send it via network to another IDEA instance -- ideally one step (i.e. "here is a new file and this is the content")  and not two like at the moment ("here's a new file" .. ."here's the content").

Regards,
Holger

0

Please sign in to leave a comment.