LOEclipse,如何在 openoffice 扩展中创建一个 OptionsPage?

LOEclipse, how to create an OptionsPage in a openoffice extension?

我一直在开发 openoffice 的扩展,我正在使用 LOEclipse ( Libreoffice starter extension) 创建它。我正在尝试在 LibreOffice 的 Tools/Options 中创建一个 OptionsPage。

这是我的 OptionsDialog.xcu 文件:

    <?xml version="1.0" encoding="UTF-8"?>

<oor:component-data oor:name="OptionsDialog" oor:package="org.openoffice.Office" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w2.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <node oor:name="Nodes">
    <node oor:name="org.libreoffice.example.InfoPage" oor:op="fuse">
      <prop oor:name="Label">
        <value>Some Label</value>
      </prop>
      <prop oor:name="AllModules">
        <value>true</value>
      </prop>
      <prop oor:name="OptionsPage">
        <value>%origin%/../../../../../dialog/InfoDialog.xdl</value>
      </prop>

      <node oor:name="Leaves">
        <node oor:name="org.libreoffice.example.OptionsPage" oor:op="fuse">
          <prop oor:name="Id">
            <value>org.libreoffice.example.OptionsPage</value>
          </prop>
          <prop oor:name="Label">
            <value>Some Label</value>
          </prop>
          <prop oor:name="OptionsPage">
            <value>%origin%/../../../../../dialog/OptionsDialog.xdl</value>
          </prop>
          <prop oor:name="EventHandlerService">
            <value>org.libreoffice.example.comp.StarterProjectImpl</value>
          </prop>
        </node>
      </node>
    </node>
  </node>
</oor:component-data>

问题是 EventHandlerService 不工作,如果我编译扩展它不会创建这个菜单,但是如果我删除 EventeHandlerServices 的值它会显示菜单但它不会保留数据。

可以看到StarterProjectImpl的源码here

如果有人有什么建议,我将不胜感激。谢谢

我在 StarterProjectImpl 项目中没有看到名为 OptionsDialog.xcu 的文件。您是否在关注某处的示例?

https://github.com/vmiklos/lo-sdk-examples/tree/master/java/OptionsPageDemo. I downloaded it from https://github.com/vmiklos/lo-sdk-examples 有一个名为 OptionsPageDemo 的示例。

然后我在 NetBeans 中打开它并更新库(juh.jar、jurt.jar、ridl.jar、unoil.jar 来自 LibreOffice 文件夹)。 运行 并且在 OpenOffice 4.1.2 中安装成功显示了选项屏幕。尝试保存选项时出错,但您的问题所询问的部分有效。

这也来自 google 搜索:https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=19784