Hi together,

I wrote a little cute java program that is converting documents via OOo.
This conversion machine is running hidden. It will fail, even crash down
if someone uses OOo in foreground and closes the last opened window. For
this reason I registered a TerminateListener that throws a
TerminateVetoException, which prevents my lovely program from crashing.
But this exception even prevents the user to close his visible document(s).

So I search for a better solution and thought a CloseListener throwing a
CloseVetoException could be one. But it works only half. Here is the
code I use:
-----%<----
    public void addCloseListener() {
        // initial close listener
        xCloseListener = new XCloseListener() {
            public void queryClosing(EventObject arg0, boolean arg1)
                    throws CloseVetoException {
                throw new CloseVetoException();
            }

            public void notifyClosing(EventObject arg0) {}

            public void disposing(EventObject arg0) {}
        };
        this.xComponent.addEventListener(xCloseListener);
    }
-----%<-----
The result is, that I again cannot close the visible OOo Desktop - but I
can close my document!

Is there a solution, to use the CloseListener (or any other Listener)
that allows the user to close the visible OOo desktop, but prevents my
hidden document and OOo to close?

Greetings, Tobias

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

Reply via email to