add OptionListener to OptionStorage in wsaccess js plugin

Post here questions and problems related to oXygen frameworks/document types.
bk-one
Posts: 13

add OptionListener to OptionStorage in wsaccess js plugin

Wed Jan 09, 2019 4:13 pm

hi,

has somebody in the oxygen team successfully added an OptionListener to the optionStorage in an javascript based wsaccess plugin?

best wishes,
barbara
Radu
Posts: 5930

Re: add OptionListener to OptionStorage in wsaccess js plugin

Thu Jan 10, 2019 12:31 pm

Hi Barbara,

Right, the "ro.sync.exml.workspace.api.options.WSOptionListener" abstract class has a constructor which needs to be passed the key as an argument:

https://www.oxygenxml.com/InstData/Editor/SDK/javadoc/ro/sync/exml/workspace/api/options/WSOptionListener.html

and I also cannot find a way to do this from the Javascript code.
If you want I can try to add on our side of the code a default constructor for "WSOptionListener" and an extra method "setKey", in this way the Javascript which would add the listener:

Code: Select all

  optionsListener = {
    optionValueChanged: function (event) {
    }
  }
 adapter = new JavaAdapter(Packages.ro.sync.exml.workspace.api.options.WSOptionListener, optionsListener);
 adapter.setKey("myKey");
 pluginWorkspaceAccess.getOptionsStorage().addOptionListener(adapter);


Would it help you if I made these changes to the "WSOptionListener" class (default constructor and "setKey" method) available for Oxygen 21 (February 2019)?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
bk-one
Posts: 13

Re: add OptionListener to OptionStorage in wsaccess js plugin

Thu Jan 10, 2019 1:25 pm

hi radu,

thanks for your effort.
that would be great!

best wishes,
barbara

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 0 guests