Oxygen API to detect close operation on file
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 18
- Joined: Tue Jul 12, 2022 10:17 pm
Oxygen API to detect close operation on file
Hello and good day.
I'm working on a project with the requirement of suggesting an action to the user upon trying to close a file in the editor, is there any API I could use that detects when a file was selected to close by the "X" button or the right click close option?
Thank you.
-Frank
I'm working on a project with the requirement of suggesting an action to the user upon trying to close a file in the editor, is there any API I could use that detects when a file was selected to close by the "X" button or the right click close option?
Thank you.
-Frank
-
- Posts: 18
- Joined: Tue Jul 12, 2022 10:17 pm
Re: Oxygen API to detect close operation on file
Hello team,
I while after I posted the question I came across the API for editorAboutToBeClosed() which is exactly what I was looking for.
But I did have another query, since I have the plugin workspace access is there a way to extract the name of the file its been worked on?
Thank you.
-Frank
I while after I posted the question I came across the API for editorAboutToBeClosed() which is exactly what I was looking for.
But I did have another query, since I have the plugin workspace access is there a way to extract the name of the file its been worked on?
Thank you.
-Frank
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Oxygen API to detect close operation on file
Hi Frank,
The "editorAboutToBeClosed" callback receives the URL of the file which is about to be closed.
Regards,
Radu
The "editorAboutToBeClosed" callback receives the URL of the file which is about to be closed.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 18
- Joined: Tue Jul 12, 2022 10:17 pm
Re: Oxygen API to detect close operation on file
Hi Radu
Thanks for your response, I have been testing the API that you suggested and works great.
I do have a question regarding the API, is it possible to detect only when the user clicks on the (X) or does a right click and selects "close" on the file?
Right now it is triggering the API when the file is closed by any reason such as closing oxygen itself and other methods that involve closing a file, but I only need it to trigger on direct closure of the file.
Thank you for your time and assistance,
Frank
Thanks for your response, I have been testing the API that you suggested and works great.
I do have a question regarding the API, is it possible to detect only when the user clicks on the (X) or does a right click and selects "close" on the file?
Right now it is triggering the API when the file is closed by any reason such as closing oxygen itself and other methods that involve closing a file, but I only need it to trigger on direct closure of the file.
Thank you for your time and assistance,
Frank
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Oxygen API to detect close operation on file
Hi Frank,
We do not have particular API which would allow you to know "how" an end user decided to close a file.
We do have this callback that you receive in the plugin extension "ro.sync.exml.plugin.workspace.WorkspaceAccessPluginExtension.applicationClosing()" and which should notify you before the actual opened documents are closed so maybe you can use this to your advantage and on the "WorkspaceAccessPluginExtension.applicationClosing" callback remove for example the listener you have added to listen for editor closed notifications.
Regards,
Radu
We do not have particular API which would allow you to know "how" an end user decided to close a file.
We do have this callback that you receive in the plugin extension "ro.sync.exml.plugin.workspace.WorkspaceAccessPluginExtension.applicationClosing()" and which should notify you before the actual opened documents are closed so maybe you can use this to your advantage and on the "WorkspaceAccessPluginExtension.applicationClosing" callback remove for example the listener you have added to listen for editor closed notifications.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service