/// called when system parent is available, reparents the bean window privatesynchronizedvoid aquireSystemWindow()
{ if ( !bPeer )
{ // set real parent
XVclWindowPeer xVclWindowPeer = UnoRuntime.queryInterface(
XVclWindowPeer.class, mWindow);
/// called when system parent is about to die, reparents the bean window privatesynchronizedvoid releaseSystemWindow()
{ if ( bPeer )
{ // hide document window
XWindow aWindow = UnoRuntime.queryInterface(XWindow.class, mWindow);
aWindow.setVisible( false );
try
{ // get this windows native window type int type = getNativeWindowSystemType();
// Java AWT windows only have a system window when showing.
XWindowPeer parentPeer; if ( isShowing() )
{ // create direct parent relationship
parentPeer = new JavaWindowPeerFake(getWrappedWindowHandle(), type);
bPeer = true;
} else
{ // no parent yet
parentPeer = null;
bPeer = false;
}
/** We make sure that the office window is notified that the parent *willberemoved.
*/
@Override publicvoid removeNotify()
{ try {
releaseSystemWindow();
} catch (java.lang.Exception e) {
System.err.println("LocaleOfficeWindow.removeNotify: Exception in releaseSystemWindow.");
System.err.println(e.getMessage());
e.printStackTrace(System.err);
} super.removeNotify();
}
/** *ReturnsanAnycontainingasequencesofcom.sun.star.beans.NamedValue.OneNamedValue *containsthename"WINDOW"andthevalueisaLongrepresentingthewindowhandle. *ThesecondNamedValuehasthename"XEMBED"andthevalueistrue,whentheXEmbed *protocolshallbeusedforembeddingthenativeWindow.
*/ protected Any getWrappedWindowHandle()
{
NamedValue window = new NamedValue( "WINDOW", new Any(new Type(Long.class), Long.valueOf(getNativeWindow())));
NamedValue xembed = new NamedValue( "XEMBED", new Any(new Type(Boolean.class), Boolean.FALSE));
if (getNativeWindowSystemType() == SystemDependent.SYSTEM_XWINDOW )
{
String vendor = System.getProperty("java.vendor"); if ((vendor.equals("Sun Microsystems Inc.") || vendor.equals("Oracle Corporation"))
&& Boolean.getBoolean("sun.awt.xembedserver"))
{
xembed = new NamedValue( "XEMBED", new Any(new Type(Boolean.class), Boolean.TRUE));
}
} returnnew Any( new Type("[]com.sun.star.beans.NamedValue"), new NamedValue[] {window, xembed});
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-10-12)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.