Page 1 of 1
Plugin acces to (Custom) Editor Variables
Posted: Fri Oct 24, 2014 12:12 pm
by geurtlagemaat
Hi,
Is there a way to access Custom Editor Variables and or Editor Variables from a Oxygen Plugin? Or is there a way to read a custom plugin.xml property?
Regards,
Geurt Lagemaat
Re: Plugin acces to (Custom) Editor Variables
Posted: Fri Oct 24, 2014 12:28 pm
by Radu
Hi Geurt,
Both of these should be possible.
1) From a plugin you can call API like:
Code: Select all
PluginWorkspaceProvider.getPluginWorkspace().getUtilAccess().expandEditorVariables("${pd}", null);
which should expand both Oxygen defined editor variables and custom editor variables which have been defined in the Oxygen Preferences->
Custom Editor Variables list.
2) In the plugin.xml you can define a system property like:
Code: Select all
<property name="propName" value="propValue"/>
and then from the plugin's Java code you will find this property in the global system properties list
java.lang.System.getProperties()
Also in Oxygen 16.1 we added Java API to add a custom editor variable resolver to Oxygen
ro.sync.exml.workspace.api.util.UtilAccess.addCustomEditorVariablesResolver(EditorVariablesResolver) so for example if in some places in Oxygen you use an editor variable like
${customName} you can add a resolver via the Java API which solves it to some special value.
Regards,
Radu
Re: Plugin acces to (Custom) Editor Variables
Posted: Fri Oct 24, 2014 4:47 pm
by geurtlagemaat
Many thanks for the prompt reply! The PluginWorkspaceProvider.getPluginWorkspace().getUtilAccess().expandEditorVariables("${pd}", null); is working, many thanks.
Just curious: using the <property name="propName" value="propValue"/> approach in plugin.xml, how to code the property elem in plugin.xml? I can not get this approach working, property is not a element in the plugin.dtd, maybe my old Oxygen version (12.10) is the problem?
Thanks & Regards, Geurt
Re: Plugin acces to (Custom) Editor Variables
Posted: Fri Oct 24, 2014 4:57 pm
by Radu
Hi Geurt,
Yes, you have an older Oxygen. The possibility to provide a system property in a plugin.xml was added in Oxygen 15.0.
Regards,
Radu