2016-07-28 27 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