Plugin acces to (Custom) Editor Variables

Post here questions and problems related to oXygen frameworks/document types.
geurtlagemaat
Posts: 2

Plugin acces to (Custom) Editor Variables

Fri Oct 24, 2014 12:12 pm

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
Radu
Posts: 5872

Re: Plugin acces to (Custom) Editor Variables

Fri Oct 24, 2014 12:28 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
geurtlagemaat
Posts: 2

Re: Plugin acces to (Custom) Editor Variables

Fri Oct 24, 2014 4:47 pm

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
Radu
Posts: 5872

Re: Plugin acces to (Custom) Editor Variables

Fri Oct 24, 2014 4:57 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

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

Who is online

Users browsing this forum: No registered users and 0 guests