[oXygen-user] Buffer-related questions (when opened from plugin)
Oxygen XML Editor Support
support at oxygenxml.com
Fri Jun 15 09:23:11 CDT 2012
Hi Florent,
> Which is not usable if I don't implement a Targeted URL Stream
> Handler Plugin, is it?
Right, you would need to implement a special protocol handler plugin
extension.
> Interesting. Does that mean that this can't prevent editing
> when the user is using the Grid view?
You are right, we do not have API for accessing the Grid page (it is not
very used for customizations).
The Grid page does not make much sense for being used by a technical writer.
But, a WSEditor has a method "changePage" and the possibility to add a
listener to it via "addEditorListener" so if the user switches to the
Grid page you could automatically switch to some other page (Text or
Author) and thus avoid having the user modify a read-only content.
Another approach would be to let the user modify the content and then
throw an error when the user attempts to save.
You also have methods like: "WSEditorBase.setEditorTabText(String)"
which would allow you to add a "(read-only)" status showing in the
editor's tab.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
On 6/15/2012 5:13 PM, Florent Georges wrote:
> Oxygen XML Editor Support
>
>> "PluginWorkspace.getCurrentEditorAccess(int)" returns each time
>> a new wrapper object over our internal implementation
>
> Ok I see, thanks!
>
>>> Is there any way to open a file in read-only using the API?
>>> Other than creating a dedicated WSEditorChangeListener of
>>> course.
>
>> There are two ways I think:
>
>> 1) We have an interface called
>> "URLHandlerReadOnlyCheckerExtension" which can be implemented
>> in the "URLStreamHandlerPluginExtension", there is a sample for
>> it in the Plugins SDK.
>
> Which is not usable if I don't implement a Targeted URL Stream
> Handler Plugin, is it?
>
>> 2) On the "WSEditorChangeListener.editorOpened(URL)" callback
>> after a WSEditor is opened you can gain access to its current
>> page "WSEditor.getCurrentPage()" and if it is an instance of
>> WSTextBasedEditorPage use this method: "setEditable(boolean)"
>
> Interesting. Does that mean that this can't prevent editing
> when the user is using the Grid view?
>
> Regards,
>
> --
> Florent Georges
> http://fgeorges.org/
> http://h2oconsulting.be/
>
More information about the oXygen-user
mailing list