This function is called during updatepreviewcontent - meaning it will create a new temporary file
on every edit/change - and this file will be put in a queue for deletion after the jvm.

Do we really need to create a new tempfile in *every* preview ? 

Why not reuse the same file within one dialog and then actually delete it when the dialog closes ?