diff options
author | Oliver Bolte <obo@openoffice.org> | 2005-07-19 14:08:45 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2005-07-19 14:08:45 +0000 |
commit | 817efc18856047c24de9f56ce62e4a2352eed8e3 (patch) | |
tree | a2d5dd997a0a62789648b45ff6d2850bf57ceca4 /bean/com | |
parent | a138981c03bc02783c0286d230e495360aa2257f (diff) |
INTEGRATION: CWS jl21bean (1.3.8); FILE MERGED
2005/05/25 09:32:41 jl 1.3.8.1: #i49835# office window not displayed because of component listener
Diffstat (limited to 'bean/com')
-rw-r--r-- | bean/com/sun/star/comp/beans/LocalOfficeWindow.java | 46 |
1 files changed, 12 insertions, 34 deletions
diff --git a/bean/com/sun/star/comp/beans/LocalOfficeWindow.java b/bean/com/sun/star/comp/beans/LocalOfficeWindow.java index 5452c3784a16..f0820b4217d0 100644 --- a/bean/com/sun/star/comp/beans/LocalOfficeWindow.java +++ b/bean/com/sun/star/comp/beans/LocalOfficeWindow.java @@ -2,9 +2,9 @@ * * $RCSfile: LocalOfficeWindow.java,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: obo $ $Date: 2005-07-07 13:16:03 $ + * last change: $Author: obo $ $Date: 2005-07-19 15:08:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -166,7 +166,7 @@ public class LocalOfficeWindow } /// called when system parent is available, reparents the bean window - private void aquireSystemWindow() + private synchronized void aquireSystemWindow() { if ( !bPeer ) { @@ -183,7 +183,7 @@ public class LocalOfficeWindow } /// called when system parent is about to die, reparents the bean window - private void releaseSystemWindow() + private synchronized void releaseSystemWindow() { if ( bPeer ) { @@ -199,26 +199,6 @@ public class LocalOfficeWindow } } - /// callback handler to get to know when we become visible - class ComponentEventHandler - extends java.awt.event.ComponentAdapter - { - public void componentHidden( java.awt.event.ComponentEvent e) - { - // only when we become invisible, we might lose our system window - CallWatchThread aCallWatchThread = new CallWatchThread( 500 ); - setVisible(false); - try { aCallWatchThread.cancel(); } - catch ( java.lang.InterruptedException aExc ) - {} // ignore - } - - public void componentShown( java.awt.event.ComponentEvent e) - { - // only when we become visible, we get a system window - aquireSystemWindow(); - } - } /// Overriding java.awt.Component.setVisible() due to Java bug (no showing event). public void setVisible( boolean b ) @@ -236,20 +216,20 @@ public class LocalOfficeWindow /** Factory method for a UNO AWT toolkit window as a child of this Java window. * */ - private XWindowPeer createUNOWindowPeer() + private synchronized XWindowPeer createUNOWindowPeer() { try { // get this windows native window type - int type = getNativeWindowSystemType(); + int type = getNativeWindowSystemType(); - // Java AWT windows only have a system window when showing. - XWindowPeer parentPeer; - if ( isShowing() ) - { + // Java AWT windows only have a system window when showing. + XWindowPeer parentPeer; + if ( isShowing() ) + { // create direct parent relationship //setVisible( true ); - parentPeer = new JavaWindowPeerFake( getNativeWindow(), type); + parentPeer = new JavaWindowPeerFake( getNativeWindow(), type); bPeer = true; } else @@ -270,11 +250,9 @@ public class LocalOfficeWindow ? WindowAttribute.SHOW : 0; mWindow = queryAWTToolkit().createWindow(desc); - // to get notified when we become visible - addComponentListener( new ComponentEventHandler() ); // set initial visibility - XWindow aWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, mWindow); + XWindow aWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, mWindow); aWindow.setVisible( bPeer ); } catch (com.sun.star.uno.Exception exp) { |