openoffice-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berkhan Dipso" <berkhan.di...@prmyazilim.com>
Subject Display options dialog from toolbar
Date Fri, 31 Jul 2015 06:47:01 GMT
Hi;

 

I'm trying to add a button to my Java OpenOffice Extension that is going to
show my Options page.

 

I've achieved to show the options page, but I can not activate the tree node
of my extension.

 

I've found two threads about this issue:

https://forum.openoffice.org/en/forum/viewtopic.php?f=47
<https://forum.openoffice.org/en/forum/viewtopic.php?f=47&t=48260> &t=48260

https://forum.openoffice.org/en/forum/viewtopic.php?f=20
<https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=66473> &t=66473

 

Both of them mentioning "OptionsPageURL" parameter. But I can not make it
work.

The things I've tried so far:

 

1)      Get the path of the dialog using component path:

 

XPackageInformationProvider xPackageInformationProvider =
PackageInformationProvider.get(m_xContext);

String extensionCurrentPath =
xPackageInformationProvider.getPackageLocation("com.prm.UnifierAddOn");

//This returns :
file:///C:/Users/Berkhan/Documents/NetBeansProjects/UnifierAddOn/build/soffi
ce_debug/user/uno_packages/cache/uno_packages/sv13d2ra.tmp_/UnifierAddOn.oxt
<file:///C:\Users\Berkhan\Documents\NetBeansProjects\UnifierAddOn\build\soff
ice_debug\user\uno_packages\cache\uno_packages\sv13d2ra.tmp_\UnifierAddOn.ox
t> 

 

com.sun.star.beans.PropertyValue[] args = new
com.sun.star.beans.PropertyValue[1];

args[0] = new PropertyValue(

"OptionsPageURL", 0, 

extensionCurrentPath + "/dialogs/EntryDialogUnifier.xdl",

PropertyState.DIRECT_VALUE);

 

XDispatchProvider docDispatchProvider =
UnoRuntime.queryInterface(XDispatchProvider.class, m_xFrame);

DispatchResultEvent dRE = (DispatchResultEvent) dispatcher.executeDispatch( 

                                                docDispatchProvider,

                                                ".uno:OptionsTreeDialog", 

                                                "", 

                                                0, 

                                                args

                    );

 

2)      Use path of the dialog given in OptionsDialog.xcu

com.sun.star.beans.PropertyValue[] args = new
com.sun.star.beans.PropertyValue[1];

args[0] = new PropertyValue(

"OptionsPageURL", 0, 

"%origin%/../../../../../dialogs/EntryDialogUnifier.xdl",

PropertyState.DIRECT_VALUE);

XDispatchProvider docDispatchProvider =
UnoRuntime.queryInterface(XDispatchProvider.class, m_xFrame);

DispatchResultEvent dRE = (DispatchResultEvent) dispatcher.executeDispatch( 

                                                docDispatchProvider,

                                                ".uno:OptionsTreeDialog", 

                                                "", 

                                                0, 

                                                args

                    );

 

3)      Adding the parameter to dispatch URL:

DispatchResultEvent dRE = (DispatchResultEvent) dispatcher.executeDispatch( 

                                                docDispatchProvider,

                                                ".uno:OptionsTreeDialog", 

                                                + "?OptionsPageURL:string="

                                                +
"%origin%/../../../../../dialogs/EntryDialogUnifier.xdl"

                                                "", 

                                                0, 

                                                new PropertyValue [] {}

                    );

//I also tried to pass extensionCurrentPath .

 

None of them worked.

 

How can I test my code? And is there a tool to show me the right value to
pass to "OptionsPageURL" parameter?

 

Or is it just not working in OO 4.1.1 ?

 

Please advise. Thanks.

 

 

Berkhan Dipşo

Solutions Architect

Tel          : +90 (216) 469 96 00 (14)

GSM      : +90 (533) 03 03 550

 

PRM YAZILIM

Oracle Gold Partner

Primavera Specialized

 <http://www.prmyazilim.com/> www.prmyazilim.com

 

 <http://www.linkedin/company/prm-yazilim>
http://www.linkedin/company/prm-yazilim

 <http://www.twitter.com/prmyazilim> http://www.twitter.com/prmyazilim

 

6-10 Temmuz - İSTANBUL

Primavera eğitimlerine ön kayıt icin:

 <http://apps.primavera-tr.com/drupal/node/15>
http://apps.primavera-tr.com/drupal/node/15

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message