[Solved] DisableCommandsTest.java: "Open" command cannot be disabled with Java

I have executed the DisableCommandsTest.java from the Developer’s Guide on the following OO/LO distributions, always windows-based:

  • OpenOffice 2.0.4 (very old, i know)
  • OpenOffice 3.3
  • LibreOffice 3.6.5
  • LibreOffice 4.0.1

Everytime I upgraded my version, I always uninstalled the older release before installing the new one.

DisableCommandsTest shows how to disable four sample commands at runtime: Open, Quit, About and SelectAll.

With OpenOffice versions, the test works perfectly: all the four commands are disabled and are no longer visible from the upper menus.

However, with LibreOffice releases, the “Open” command cannot be disabled. It always remain available: (File->Open, or shortcut Ctrl+O).

Is that command named diferent in LibreOffice releases? Am I making any mistake in my executions?

I really need to launch LibreOffice WITHOUT “Open” command enabled. May anybody have executed that test (from developer’s guide as I said) and got succeeded disabling “Open” command with LibreOffice?

Any help would be really appreciated!

Joan Esteve

Solved by myself.

As expected, that command name had changed from OO to LO.

I finally got the sample working with Open command disabled and hidden.

I was able to disable “Open” command using the Interceptor.java example.

However, the button remains visible, so the result is not exactly the same.

With OpenOffice, the DisableCommandTest.java works correctly and disables all tested commands (“Open” included).

With LibreOffice, the same Test does not disable “Open” command.

Does anybody have faced that problem before?

Thanks!