Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
d5fdf789
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d5fdf789
编写于
7月 11, 2016
作者:
S
ssadetsky
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8158994: Service Menu services
Reviewed-by: prr, mschoene
上级
112046f2
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
62 addition
and
7 deletion
+62
-7
src/windows/classes/sun/awt/windows/WMenuItemPeer.java
src/windows/classes/sun/awt/windows/WMenuItemPeer.java
+2
-1
src/windows/classes/sun/awt/windows/WMenuPeer.java
src/windows/classes/sun/awt/windows/WMenuPeer.java
+3
-1
src/windows/classes/sun/awt/windows/WObjectPeer.java
src/windows/classes/sun/awt/windows/WObjectPeer.java
+38
-1
src/windows/classes/sun/awt/windows/WPopupMenuPeer.java
src/windows/classes/sun/awt/windows/WPopupMenuPeer.java
+2
-1
src/windows/native/sun/windows/awt_Frame.cpp
src/windows/native/sun/windows/awt_Frame.cpp
+9
-1
src/windows/native/sun/windows/awt_MenuBar.cpp
src/windows/native/sun/windows/awt_MenuBar.cpp
+4
-1
src/windows/native/sun/windows/awt_MenuBar.h
src/windows/native/sun/windows/awt_MenuBar.h
+4
-1
未找到文件。
src/windows/classes/sun/awt/windows/WMenuItemPeer.java
浏览文件 @
d5fdf789
/*
* Copyright (c) 1996, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
6
, 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
...
...
@@ -107,6 +107,7 @@ class WMenuItemPeer extends WObjectPeer implements MenuItemPeer {
this
.
target
=
target
;
this
.
parent
=
(
WMenuPeer
)
WToolkit
.
targetToPeer
(
target
.
getParent
());
this
.
isCheckbox
=
isCheckbox
;
parent
.
addChildPeer
(
this
);
create
(
parent
);
// fix for 5088782: check if menu object is created successfully
checkMenuCreation
();
...
...
src/windows/classes/sun/awt/windows/WMenuPeer.java
浏览文件 @
d5fdf789
/*
* Copyright (c) 1996, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
6
, 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
...
...
@@ -51,10 +51,12 @@ class WMenuPeer extends WMenuItemPeer implements MenuPeer {
if
(
parent
instanceof
MenuBar
)
{
WMenuBarPeer
mbPeer
=
(
WMenuBarPeer
)
WToolkit
.
targetToPeer
(
parent
);
this
.
parent
=
mbPeer
;
mbPeer
.
addChildPeer
(
this
);
createMenu
(
mbPeer
);
}
else
if
(
parent
instanceof
Menu
)
{
this
.
parent
=
(
WMenuPeer
)
WToolkit
.
targetToPeer
(
parent
);
this
.
parent
.
addChildPeer
(
this
);
createSubMenu
(
this
.
parent
);
}
else
{
...
...
src/windows/classes/sun/awt/windows/WObjectPeer.java
浏览文件 @
d5fdf789
/*
* Copyright (c) 1996, 20
08
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 20
16
, 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
...
...
@@ -24,6 +24,9 @@
*/
package
sun.awt.windows
;
import
java.util.Map
;
import
java.util.WeakHashMap
;
abstract
class
WObjectPeer
{
static
{
...
...
@@ -45,6 +48,8 @@ abstract class WObjectPeer {
// used to synchronize the state of this peer
private
final
Object
stateLock
=
new
Object
();
private
volatile
Map
<
WObjectPeer
,
WObjectPeer
>
childPeers
;
public
static
WObjectPeer
getPeerForTarget
(
Object
t
)
{
WObjectPeer
peer
=
(
WObjectPeer
)
WToolkit
.
targetToPeer
(
t
);
return
peer
;
...
...
@@ -77,6 +82,9 @@ abstract class WObjectPeer {
}
if
(
call_disposeImpl
)
{
if
(
childPeers
!=
null
)
{
disposeChildPeers
();
}
disposeImpl
();
}
}
...
...
@@ -88,4 +96,33 @@ abstract class WObjectPeer {
* Initialize JNI field and method IDs
*/
private
static
native
void
initIDs
();
// if a child peer existence depends on this peer, add it to this collection
final
void
addChildPeer
(
WObjectPeer
child
)
{
synchronized
(
getStateLock
())
{
if
(
childPeers
==
null
)
{
childPeers
=
new
WeakHashMap
<>();
}
if
(
isDisposed
())
{
throw
new
IllegalStateException
(
"Parent peer is disposed"
);
}
childPeers
.
put
(
child
,
this
);
}
}
// called to dispose dependent child peers
private
void
disposeChildPeers
()
{
synchronized
(
getStateLock
())
{
for
(
WObjectPeer
child
:
childPeers
.
keySet
())
{
if
(
child
!=
null
)
{
try
{
child
.
dispose
();
}
catch
(
Exception
e
)
{
// ignored
}
}
}
}
}
}
src/windows/classes/sun/awt/windows/WPopupMenuPeer.java
浏览文件 @
d5fdf789
/*
* Copyright (c) 1996, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
6
, 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
...
...
@@ -58,6 +58,7 @@ final class WPopupMenuPeer extends WMenuPeer implements PopupMenuPeer {
parent
=
WToolkit
.
getNativeContainer
((
Component
)
parent
);
parentPeer
=
(
WComponentPeer
)
WToolkit
.
targetToPeer
(
parent
);
}
parentPeer
.
addChildPeer
(
this
);
createMenu
(
parentPeer
);
// fix for 5088782: check if menu object is created successfully
checkMenuCreation
();
...
...
src/windows/native/sun/windows/awt_Frame.cpp
浏览文件 @
d5fdf789
/*
* Copyright (c) 1996, 201
5
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
6
, 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
...
...
@@ -1113,11 +1113,19 @@ AwtMenuBar* AwtFrame::GetMenuBar()
void
AwtFrame
::
SetMenuBar
(
AwtMenuBar
*
mb
)
{
if
(
menuBar
)
{
menuBar
->
SetFrame
(
NULL
);
}
menuBar
=
mb
;
if
(
mb
==
NULL
)
{
// Remove existing menu bar, if any.
::
SetMenu
(
GetHWnd
(),
NULL
);
}
else
{
AwtFrame
*
oldFrame
=
menuBar
->
GetFrame
();
if
(
oldFrame
&&
oldFrame
!=
this
)
{
oldFrame
->
SetMenuBar
(
NULL
);
}
menuBar
->
SetFrame
(
this
);
if
(
menuBar
->
GetHMenu
()
!=
NULL
)
{
::
SetMenu
(
GetHWnd
(),
menuBar
->
GetHMenu
());
}
...
...
src/windows/native/sun/windows/awt_MenuBar.cpp
浏览文件 @
d5fdf789
/*
* Copyright (c) 1996, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
6
, 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
...
...
@@ -58,6 +58,9 @@ AwtMenuBar::~AwtMenuBar()
void
AwtMenuBar
::
Dispose
()
{
if
(
m_frame
!=
NULL
&&
m_frame
->
GetMenuBar
()
==
this
)
{
m_frame
->
SetMenuBar
(
NULL
);
}
m_frame
=
NULL
;
AwtMenu
::
Dispose
();
...
...
src/windows/native/sun/windows/awt_MenuBar.h
浏览文件 @
d5fdf789
/*
* Copyright (c) 1996, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
6
, 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
...
...
@@ -63,6 +63,9 @@ public:
virtual
AwtMenuBar
*
GetMenuBar
()
{
return
this
;
}
INLINE
AwtFrame
*
GetFrame
()
{
return
m_frame
;
}
INLINE
void
SetFrame
(
AwtFrame
*
frame
)
{
m_frame
=
frame
;
}
virtual
HWND
GetOwnerHWnd
();
virtual
void
RedrawMenuBar
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录