Selecting/Creating oXygen editor windows

Hello, I have recently been developing a standalone oXygen 12.0 workspace plugin that produces an XML document containing oXygen's track-change processing instructions. Currently this plugin can write its results either to an existing editor or to a file. In the latter case the file is opened in an oXygen editor once it has been written. In the former case, the editor is correctly updated but not selected as the current editor. Is there a way of selecting this output editor as the current editor from within the plugin? I would also like to allow the user to send the output to a "new" freshly constructed editor window with an appropriate "untitled #number" name, where the action of "saving" the document would prompt the user for the location to save the file in. There may be cases where the user just wants to view the result, rather than save it to a file. We generally know the type of document that is being generated (e.g. DITA, DocBook, general XML) so could supply this to the oXygen editor creation API, if this is helpful. Any pointers on how this - or something similar - could be achieved would be welcome. I am new to the oXygen plugin development and this mailing list; and have done my best to search both the API and archive for answers to the issues I have just raised. I apologise in advance for missing previous answers to these questions. Regards, Anthony.

Hi Michael, See some answers below: On 11/3/2010 12:33 PM, Michael Smith wrote:
Hello,
I have recently been developing a standalone oXygen 12.0 workspace plugin that produces an XML document containing oXygen's track-change processing instructions. Currently this plugin can write its results either to an existing editor or to a file. In the latter case the file is opened in an oXygen editor once it has been written. In the former case, the editor is correctly updated but not selected as the current editor. Is there a way of selecting this output editor as the current editor from within the plugin?
Yes, just use the ro.sync.exml.workspace.api.Workspace.open(URL url); method. Oxygen cannot open an URL twice inside it so calling the method on an URL which is already opened will result in the editor tab getting selected.
I would also like to allow the user to send the output to a "new" freshly constructed editor window with an appropriate "untitled #number" name, where the action of "saving" the document would prompt the user for the location to save the file in. There may be cases where the user just wants to view the result, rather than save it to a file. We generally know the type of document that is being generated (e.g. DITA, DocBook, general XML) so could supply this to the oXygen editor creation API, if this is helpful. Any pointers on how this - or something similar - could be achieved would be welcome.
This cannot be done using the current API for now. So you would like something like: newEditor(String extension, String xmlContent); Is this right? Maybe we can improve the API to contain such a method in a future version. Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com

Hi Radu, Thanks for your prompt and constructive response.
I would also like to allow the user to send the output to a "new" freshly constructed editor window with an appropriate "untitled #number" name, where the action of "saving" the document would prompt the user for the location to save the file in. There may be cases where the user just wants to view the result, rather than save it to a file. We generally know the type of document that is being generated (e.g. DITA, DocBook, general XML) so could supply this to the oXygen editor creation API, if this is helpful. Any pointers on how this - or something similar - could be achieved would be welcome.
This cannot be done using the current API for now. So you would like something like:
newEditor(String extension, String xmlContent);
Is this right? Maybe we can improve the API to contain such a method in a future version. Yes that type of interface would work for us.
A couple of alternative API's for your consideration would be: (1) newEditor(String extension); (2) newEditor(String extension, Reader reader); Alternative (1) would create a new editor with an empty document and alternative (2) would create a new editor with a document being read from the reader. In the case of the plugin I am currently developing, I would use whatever interface that might be provided in the future to create a new editor whose 'final' content was read in from a reader. Here, 'final' is used to represent the content shown to the user after the plugin has completed its output. Thanks again, Anthony. -- -- ------------------------------------------------------------------------- Michael Anthony Smith, DeltaXML Ltd "Change control for XML" T: +44 1684 578751 E: anthony.smith@deltaxml.com http://www.deltaxml.com Registered in England 02528681 Reg. Office: Monsell House, WR8 0QN, UK
participants (2)
-
Michael Smith
-
Radu Coravu