Sorry, I previously misunderstood you before...
In the call to dispatch() I call another method which does some checks and then creates an instance of a class which extends JFrame.

"I meant: you want only once instance of your JFrame in the whole office?" (I've misunderstood this before) : the answer is not, I need to open a JFrame for each opened document on OOo. The only problem is that toolbar button and menu item seem to be two different extensions...


Ariel Constenla-Haile wrote:
Hello giancarlo,

On Wednesday 11 March 2009, 08:39, giancarlo wrote:
Using the flag I can manage only the button or the menu call, but not
both...

I guess [without seeing the code it's just wild guessing] you have a ProtocolHandler implementation that's instantiated both by the menu and the toolbar. Are you instantiating the JFrame everytime in the call to dispatch()? do yo have a custom class extending JFrame? ...

If I click over the extension button (from the toolbar), then no new
extension process (a simple JFrame) starts if I click again before
closing the existing JFrame
But if I click over the menu item before closing the JFrame (the one
created clicking over the toolbar button), then another process starts...
Using the flag isn't enough for managing this...

it seems to me you want to share the same JFrame instance with the ProtocolHandler invoked form the menu and the toolbar. Again, this can be easy, depending on how you design it there are differnt ways to know if your JFrame instance is running.

So, you've told me "Another point is: do you want your extension to
"run" only once per frame, or once per OOo main process?", the answer is
only once per OOo main process...

once per OOo main process?

I meant: you want only once instance of your JFrame in the whole office? hat happens if the user clicks on your toolbar from another document? do you instantiate another JFrame or just set the focus on the only one instance? etc.

Regards


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org

Reply via email to