Tobias Krais wrote:
Hi together,
one year ago I implemented some additional menu items for OOo menus in
Java. I added these items transient. But now we discovered that they are
too transient for us: when opening a document, the menu items are added.
When changing the document into "Page view" mode (German:
"Seitenansicht") the transient menu items are gone and discover no more
until starting the same procedure again.
My question: is this behaviour a bug? Shouldn't the transient menu item
remain when switching the view?
If this is not a bug, how can I discover when I have to re-add the item?
Hi Tobias,
This is not a bug but how the OpenOffice.org framework works. The
controller will be removed from the frame and another controller is
attached. The layout manager which controls the user interface elements
has to destroy all element when a controller is detached. Your transient
changes are only stored within this user interface element (menu bar),
which gets destroyed.
Solution: You have to implement a
com.sun.star.frame.XFrameActionListener which must be registered at the
frame. Whenever you receive the event FrameAction_COMPONENT_ATTACHED you
have to make the transient changes again. Please be aware that the frame
can be recycled and another document (even from another application
module) can be associated with the frame. So you should verify that you
want to make changes to this frame.
Regards,
Carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]