Hi Tobias,
I have one more question. I would like to change the menus in a document in the background. Up to now I can change menus for loaded documents in
the foreground. Here is the code:
-----%<-----
XPropertySet xps = (XPropertySet)
                UnoRuntime.queryInterface(XPropertySet.class,
                xDesktop.getCurrentFrame());

XLayoutManager xLayoutManager = (XLayoutManager)
                    UnoRuntime.queryInterface(XLayoutManager.class,
                    xps.getPropertyValue("LayoutManager"));
-----%<-----

With this code (getCurrentFrame) I can only get the XLayoutManager of
the foreground Window.

Background info: I wrote a java application that opens a document.
Shortly after loading the document I start changing the menus. It can
happen that meanwhile an other OO Document comes in foreground and I
change the menus of this foreground window.

How can I get the XLayoutManager of the XComponent I am working on with
my application?

You could query the Interface com.sun.star.frame.XModel from you document. This has a method "getCurrentController()" which returns a com.sun.star.frame.XController. Now you could use the method "getFrame()" of this interface and so get the XFrame your document resides in.

Hope that helps

Regards

Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to