RE: EXTERNAL: Re: soffice process still running

2013-02-04 Thread Steele, Raymond
Ariel, 

I am not sure I understand why the following causes only the last opened 
document to close, but it seems to be the solution.

if (!xEnumerationAccess.hasElements()) {
xDesktop.terminate();

Thanks!

Raymond

-Original Message-
From: Ariel Constenla-Haile [mailto:arie...@apache.org] 
Sent: Friday, February 01, 2013 5:24 AM
To: api@openoffice.apache.org
Subject: Re: EXTERNAL: Re: soffice process still running

On Thu, Jan 31, 2013 at 05:48:11PM +, Steele, Raymond wrote:
> Thanks for the feedback. 
> 
> I implemented the following, but the method kills off any other 
> instance of soffice that is running.
> 
> Desktop_obj
> = 
> component_factory.createInstanceWithContext("com.sun.star.frame.Deskto
> p", context); XDesktop desktop = 
> UnoRuntime.queryInterface(XDesktop.class,
> desktop_obj); desktop.terminate();
> 
> Any way that I can close the instance without killing off other 
> soffice instances?

What do you mean by "instance"? There is only one instance of soffice.bin per 
application using the same user installation directory.

If you mean that it closes all other documents, then you can check if this 
document is the last opened document, and if true, terminate the
desktop:
http://www.openoffice.org/api/docs/common/ref/com/sun/star/frame/XDesktop.html#getComponents

XComponentLoader xComponentLoader = UnoRuntime.queryInterface(
XComponentLoader.class,
xContext.getServiceManager().createInstanceWithContext(
"com.sun.star.frame.Desktop", xContext)); XTextDocument xTextDocument = 
UnoRuntime.queryInterface(
 XTextDocument.class,
 xComponentLoader.loadComponentFromURL(
"private:factory/swriter",
"_default",
FrameSearchFlag.ALL,
new PropertyValue[]{}));
xTextDocument.getText().setString("Dummy text.");

XCloseable xCloseable = UnoRuntime.queryInterface(
XCloseable.class, xTextDocument);
xCloseable.close(true);

XDesktop xDesktop = UnoRuntime.queryInterface(
XDesktop.class, xComponentLoader);
XEnumerationAccess xEnumerationAccess = xDesktop.getComponents();

if (!xEnumerationAccess.hasElements()) {
xDesktop.terminate();
}


Regards
--
Ariel Constenla-Haile
La Plata, Argentina


Re: Incompatible change for extensions

2013-02-04 Thread Oliver Brinzing
Hi

> What do you think how much effort it would be to create a new scheme
> for the new extended toolbars and keep the old one at least for a while?

+1

due to api changes (e.g. toolsbars, com.sun.star.awt.XMessageBox, ...) i cannot
run my oo32 extension with aoo 3.5 at the moment. so testing is pretty 
difficult.

Best Regards

Oliver


-- 

GnuPG key 0xCFD04A45: 8822 057F 4956 46D3 352C 1A06 4E2C AB40 CFD0 4A45



signature.asc
Description: OpenPGP digital signature


Re: Incompatible change for extensions

2013-02-04 Thread Jürgen Schmidt
Hi Ariel,

after some talks about this topic at FOSDEM I was thinking about it
again. What do you think how much effort it would be to create a new
scheme for the new extended toolbars and keep the old one at least for a
while? I know it will be more work in the underlying code but we should
at least think about it or what do you mean?

Juergen


Regarding implementing the XDispatchProviderInterceptor interface in a client application

2013-02-04 Thread Shukla, Mangesh
Hi,
I am looking for some sample code in C++ for the functionality available 
through XDispatchProviderInterceptor . I wish to track some menu items in the 
menu bar (created using Add-ons). When the user clicks on the Add-on Menu 
buttons, I wish to intercept the call using the XDispatchProviderInterceptor 
interface in an external application which is connected to OpenOffice. Is this 
possible?

I will be grateful if you can provide some sample code to demonstrate the above 
or comment on how I should go about it.

thanks,
Mangesh.