Saving files from a custom editor

Hi,

Ive implemented a custom file editor (extends PerspectiveFileEditor). How do save the edited file (in a custom xml)? what method have I to override?

Thanks,

Andre

4 comments

Hello Andre,

A> Ive implemented a custom file editor (extends PerspectiveFileEditor).
A> How do save the edited file (in a custom xml)? what method have I to
A> override?

If your custom xml file is the file which is passed to the PerspectiveFileEditor
constructor, then you need to modify the document linked to the file as the
user is making changes in the editor, and IDEA will handle saving automatically.
If your custom xml file is not in any way related to it, then you'll have
to save it by yourself at whatever time you consider appropriate - there
is no method to override for this.

--
Dmitry Jemerov
Software Developer
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Hi Dmitry,

I'm editing my file using BasicGraphComponent created inside a PerspectiveFileEditor. I don't know how to manipulate documents in this case...

Have I to create a listener in my graph and call PerspetiveFileEditor.getDocuments()[0].xxxx every time graph changes?

Andre

0

I'd suggest you to do the changes through PSI in your XML file on every
change in your graph. Changing document directly is a bit hard.

"Andre" <ad-rocha@uol.com.br> wrote in message
news:32886782.1159801073882.JavaMail.itn@is.intellij.net...

Hi Dmitry,

>

I'm editing my file using BasicGraphComponent created inside a
PerspectiveFileEditor. I don't know how to manipulate documents in this
case...

>

Have I to create a listener in my graph and call
PerspetiveFileEditor.getDocuments()[0].xxxx every time graph changes?

>

Andre



0

Thanks Peter,

I'll do that.

Andre

0

Please sign in to leave a comment.