Page 1 of 1

create new file with assigned url?

Posted: Thu Jun 08, 2017 5:02 pm
by Patrik
My requirement for a specific AuthorOperation is that i want to ensure that a specific file is opened in oXygen editor. (I will access it through the URIResolver.)

Currently, when the file is not existing I create the content, write it to disk and then open it.

Even better would be if I could create a new document with a specific URL assigned to it. This way there is no side-effect until the user saves the file.
I found a method to create a new file (Workspace.createNewEditor()) but I could not find a way to set a specific URL without explicitly saving it to disk!?

Thanks and regards,
Patrik

Re: create new file with assigned url?

Posted: Fri Jun 09, 2017 10:29 am
by Radu
Hi Patrik,

Sorry but we do not have such an API. I added an internal issue for this.
What you could do would be to create the file on disk, open it in Oxygen, mark the opened editor as modified (WSEditor.setModified(true)) and then remove if from disk.
This will probably not work that well when Oxygen 19.1 will be released because Oxygen 19.1 will detect the underlining file does not exist anymore and will show a dialog asking you what to do about it.

Regards,
Radu

Re: create new file with assigned url?

Posted: Fri Jun 09, 2017 10:32 am
by Patrik
Thanks. It's not that urgent anyway since the current behavior is good enough...

Regards,
Patrik