Use ComponentsValidatorPluginExtension only when Oxygen Author?

I have taken on a project with a plugin that adds a menu but also disables selected menu items and the XSLT Debugger perspective, among other things. The end users will use Oxygen Author, but the project's developers use Oxygen Editor. They now want to use Oxygen Editor with the plug-in's menu added but without any of the other menu items being removed. Is there a way to fall back to using Oxygen's default components validator (which, presumably, doesn't disable anything) but only when the plug-in is run from Oxygen Editor? Somewhat separately, my attempt to get the StandalonePluginWorkspace to work out whether or not the application is Oxygen Editor is currently failing with a NullPointerException (see below) when I use 'pluginWorkspace'. Any ideas? Regards, Tony Graham. -- XML Division Antenna House, Inc. tony@antennahouse.com public class ComponentsValidatorPluginExtension implements ro.sync.exml.plugin.startup.ComponentsValidatorPluginExtension { ... @Override public ComponentsValidator getComponentsValidator() { StandalonePluginWorkspace pluginWorkspace = (StandalonePluginWorkspace) PluginWorkspaceProvider.getPluginWorkspace(); boolean isEditor = pluginWorkspace.getApplicationType() == ApplicationType.XML_EDITOR; return new ComponentsValidator() { ...

Hi Tony, The components validator plugin's "getComponentsValidator" method is called too early, when the "PluginWorkspaceProvider.getPluginWorkspace()" singleton object is not yet built. Maybe instead you could look at a Java system property called "com.oxygenxml.app.descriptor" which for Oxygen XML Editor should have the value "ro.sync.exml.EditorFrameDescriptor". Regards, Radu Radu Coravu <oXygen/> XML Editor http://www.oxygenxml.com On 7/2/2019 5:35 PM, Tony Graham wrote:
I have taken on a project with a plugin that adds a menu but also disables selected menu items and the XSLT Debugger perspective, among other things.
The end users will use Oxygen Author, but the project's developers use Oxygen Editor. They now want to use Oxygen Editor with the plug-in's menu added but without any of the other menu items being removed.
Is there a way to fall back to using Oxygen's default components validator (which, presumably, doesn't disable anything) but only when the plug-in is run from Oxygen Editor?
Somewhat separately, my attempt to get the StandalonePluginWorkspace to work out whether or not the application is Oxygen Editor is currently failing with a NullPointerException (see below) when I use 'pluginWorkspace'. Any ideas?
Regards,
Tony Graham.

On 03/07/2019 10:46, Oxygen XML Editor Support (Radu Coravu) wrote:
The components validator plugin's "getComponentsValidator" method is called too early, when the "PluginWorkspaceProvider.getPluginWorkspace()" singleton object is not yet built. Maybe instead you could look at a Java system property called "com.oxygenxml.app.descriptor" which for Oxygen XML Editor should have the value "ro.sync.exml.EditorFrameDescriptor". That worked, thank you.
// Menu items, etc., are not disabled in Oxygen XML Editor. boolean isEditor = System.getProperty("com.oxygenxml.app.descriptor").equals("ro.sync.exml.EditorFrameDescriptor"); Regards, Tony Graham. -- XML Division Antenna House, Inc. tony@antennahouse.com
participants (2)
-
Oxygen XML Editor Support (Radu Coravu)
-
Tony Graham