summaryrefslogtreecommitdiff
path: root/bean/com/sun/star
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2007-08-30 12:58:11 +0000
committerVladimir Glazounov <vg@openoffice.org>2007-08-30 12:58:11 +0000
commit3c0e594857ee9c4184310f7e220e92d12af19a97 (patch)
tree4e3af2528bc06422bb19a591c6d3c75bc13b12d4 /bean/com/sun/star
parentd5e43bed6c2aec93fb95b0a18fb46516d9dfa39a (diff)
INTEGRATION: CWS c12v002_SRC680 (1.6.32); FILE MERGED
2007/04/02 09:25:33 jl 1.6.32.1: #t6453597# LocalOfficeWindow has now a method getWrappedWindowHandle
Diffstat (limited to 'bean/com/sun/star')
-rw-r--r--bean/com/sun/star/comp/beans/LocalOfficeWindow.java45
1 files changed, 39 insertions, 6 deletions
diff --git a/bean/com/sun/star/comp/beans/LocalOfficeWindow.java b/bean/com/sun/star/comp/beans/LocalOfficeWindow.java
index cc134f49c819..9f0ace66e896 100644
--- a/bean/com/sun/star/comp/beans/LocalOfficeWindow.java
+++ b/bean/com/sun/star/comp/beans/LocalOfficeWindow.java
@@ -4,9 +4,9 @@
*
* $RCSfile: LocalOfficeWindow.java,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: rt $ $Date: 2005-09-07 22:00:31 $
+ * last change: $Author: vg $ $Date: 2007-08-30 13:58:11 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -55,6 +55,9 @@ import com.sun.star.awt.WindowClass;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import com.sun.star.uno.Exception;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.Type;
+import com.sun.star.beans.NamedValue;
/**
* This class represents a local office window.
@@ -147,10 +150,10 @@ public class LocalOfficeWindow
// set real parent
XVclWindowPeer xVclWindowPeer = (XVclWindowPeer)UnoRuntime.queryInterface(
XVclWindowPeer.class, mWindow);
- xVclWindowPeer.setProperty( "PluginParent", new Long(getNativeWindow()) );
- bPeer = true;
- // show document window
+ xVclWindowPeer.setProperty( "PluginParent", getWrappedWindowHandle());
+ bPeer = true;
+ // show document window
XWindow aWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, mWindow);
aWindow.setVisible( true );
}
@@ -203,7 +206,7 @@ public class LocalOfficeWindow
{
// create direct parent relationship
//setVisible( true );
- parentPeer = new JavaWindowPeerFake( getNativeWindow(), type);
+ parentPeer = new JavaWindowPeerFake(getWrappedWindowHandle(), type);
bPeer = true;
}
else
@@ -263,4 +266,34 @@ public class LocalOfficeWindow
*/
private native int getNativeWindowSystemType();
+ /**
+ Returns an Any containing a sequences of com.sun.star.beans.NamedValue. One NamedValue
+ contains the name "WINDOW" and the value is a Long representing the window handle.
+ The second NamedValue has the name "XEMBED" and the value is true, when the XEmbed
+ protocol shall be used fore embedding the native Window.
+ */
+ protected Any getWrappedWindowHandle()
+ {
+
+ NamedValue window = new NamedValue(
+ "WINDOW", new Any(new Type(Long.class), new Long(getNativeWindow())));
+ NamedValue xembed = new NamedValue(
+ "XEMBED", new Any(new Type(Boolean.class), new Boolean(false)));
+
+ if (getNativeWindowSystemType() == SystemDependent.SYSTEM_XWINDOW )
+ {
+ String vendor = System.getProperty("java.vendor");
+ if (vendor.equals("Sun Microsystems Inc.")
+ && Boolean.valueOf(System.getProperty("sun.awt.xembedserver")).booleanValue())
+ {
+ xembed = new NamedValue(
+ "XEMBED",
+ new Any(new Type(Boolean.class), new Boolean(true)));
+ }
+ }
+ return new Any(
+ new Type("[]com.sun.star.beans.NamedValue"),
+ new NamedValue[] {window, xembed});
+ }
+
}