提交 6a2a9f2a 编写于 作者: A asaha

Merge

......@@ -635,6 +635,7 @@ de1d09f09e571e38afdf1fb72984ec210e7c19e6 jdk8u111-b02
710f0c95444deb36b422f449f422d925a72f6b2c jdk8u111-b04
d689f7b806c89e535f784ba94bea1ae129ee0f19 jdk8u111-b05
6c822cce832523a5aee9632e28065f0c302187ed jdk8u111-b06
1afe84012d643b4092dbf25f1cbb761508c19ed2 jdk8u111-b07
47e20a90bdbb2327289e330606b73a9fe4dc857e jdk8u112-b00
96393e490afd4acba5b92c5ede68dc9bbb60a38e jdk8u112-b01
b44d695f738baba091370828b84ae2c4cd715c1b jdk8u112-b02
......
/*
* Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -153,6 +153,19 @@ class WFramePeer extends WWindowPeer implements FramePeer {
@Override
public void setMenuBar(MenuBar mb) {
WMenuBarPeer mbPeer = (WMenuBarPeer) WToolkit.targetToPeer(mb);
if (mbPeer != null) {
if (mbPeer.framePeer != this) {
mb.removeNotify();
mb.addNotify();
mbPeer = (WMenuBarPeer) WToolkit.targetToPeer(mb);
if (mbPeer != null && mbPeer.framePeer != this) {
throw new IllegalStateException("Wrong parent peer");
}
}
if (mbPeer != null) {
addChildPeer(mbPeer);
}
}
setMenuBar0(mbPeer);
updateInsets(insets_);
}
......
/*
* Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -31,6 +31,8 @@ final class WMenuBarPeer extends WMenuPeer implements MenuBarPeer {
// MenuBarPeer implementation
final WFramePeer framePeer;
@Override
public native void addMenu(Menu m);
@Override
......@@ -44,8 +46,11 @@ final class WMenuBarPeer extends WMenuPeer implements MenuBarPeer {
// Toolkit & peer internals
WMenuBarPeer(MenuBar target) {
this.target = target;
WFramePeer framePeer = (WFramePeer)
framePeer = (WFramePeer)
WToolkit.targetToPeer(target.getParent());
if (framePeer != null) {
framePeer.addChildPeer(this);
}
create(framePeer);
// fix for 5088782: check if menu object is created successfully
checkMenuCreation();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册