2016-07-28 61 views
1

我一直在为OpenOffice的扩展工作,我使用LOEclipse(Libreoffice starter extension)来创建它。我试图在LibreOffice的Tools/Options中创建一个OptionsPage。LOEclipse,如何在openoffice扩展中创建一个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

源如果有人有任何建议,我将非常感激。谢谢。

回答

0

我在StarterProjectImpl项目中看不到名为OptionsDialog.xcu的文件。你是否在某个地方效仿了一个例子?

https://github.com/vmiklos/lo-sdk-examples/tree/master/java/OptionsPageDemo有一个叫做OptionsPageDemo的例子。我从https://github.com/vmiklos/lo-sdk-examples下载它。

然后我在NetBeans中打开它并更新库(从LibreOffice文件夹中juh.jar,jurt.jar,ridl.jar,unoil.jar)。在OpenOffice 4.1.2中运行和安装成功显示了选项屏幕。尝试保存选项时发生错误,但您的问题所涉及的部分正在工作。

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

+0

感谢吉姆,这是帮助我,我有一个StarterProjectImpl.java的问题,我错过了XContainerWindowEventHandler和一些事件相关的事件。再次感谢。 – unknown