Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
115011af
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看板
提交
115011af
编写于
7月 30, 2014
作者:
P
pchelko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8048549: [macosx] Disable usage of system menu bar if AWT is embedded in FX
Reviewed-by: serb, anthony
上级
83a65790
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
35 addition
and
22 deletion
+35
-22
src/macosx/classes/com/apple/laf/AquaMenuBarUI.java
src/macosx/classes/com/apple/laf/AquaMenuBarUI.java
+17
-22
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
+7
-0
src/macosx/native/sun/awt/LWCToolkit.m
src/macosx/native/sun/awt/LWCToolkit.m
+11
-0
未找到文件。
src/macosx/classes/com/apple/laf/AquaMenuBarUI.java
浏览文件 @
115011af
...
@@ -26,11 +26,14 @@
...
@@ -26,11 +26,14 @@
package
com.apple.laf
;
package
com.apple.laf
;
import
java.awt.*
;
import
java.awt.*
;
import
java.security.AccessController
;
import
javax.swing.*
;
import
javax.swing.*
;
import
javax.swing.plaf.ComponentUI
;
import
javax.swing.plaf.ComponentUI
;
import
javax.swing.plaf.basic.BasicMenuBarUI
;
import
javax.swing.plaf.basic.BasicMenuBarUI
;
import
sun.lwawt.macosx.LWCToolkit
;
import
sun.security.action.GetBooleanAction
;
import
sun.security.action.GetPropertyAction
;
import
sun.security.action.GetPropertyAction
;
// MenuBar implementation for Mac L&F
// MenuBar implementation for Mac L&F
...
@@ -131,28 +134,20 @@ public class AquaMenuBarUI extends BasicMenuBarUI implements ScreenMenuBarProvid
...
@@ -131,28 +134,20 @@ public class AquaMenuBarUI extends BasicMenuBarUI implements ScreenMenuBarProvid
ScreenMenuBar
fScreenMenuBar
;
ScreenMenuBar
fScreenMenuBar
;
boolean
useScreenMenuBar
=
getScreenMenuBarProperty
();
boolean
useScreenMenuBar
=
getScreenMenuBarProperty
();
private
static
String
getPrivSysProp
(
final
String
propName
)
{
return
java
.
security
.
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
propName
));
}
static
boolean
getScreenMenuBarProperty
()
{
static
boolean
getScreenMenuBarProperty
()
{
final
String
props
[]
=
new
String
[]{
""
};
// Do not allow AWT to set the screen menu bar if it's embedded in another UI toolkit
if
(
LWCToolkit
.
isEmbedded
())
return
false
;
boolean
useScreenMenuBar
=
false
;
if
(
AccessController
.
doPrivileged
(
try
{
new
GetBooleanAction
(
AquaLookAndFeel
.
sPropertyPrefix
+
"useScreenMenuBar"
)))
{
props
[
0
]
=
getPrivSysProp
(
AquaLookAndFeel
.
sPropertyPrefix
+
"useScreenMenuBar"
);
return
true
;
}
if
(
props
[
0
]
!=
null
&&
props
[
0
].
equals
(
"true"
))
useScreenMenuBar
=
true
;
if
(
AccessController
.
doPrivileged
(
else
{
new
GetBooleanAction
(
AquaLookAndFeel
.
sOldPropertyPrefix
+
"useScreenMenuBar"
)))
{
props
[
0
]
=
getPrivSysProp
(
AquaLookAndFeel
.
sOldPropertyPrefix
+
"useScreenMenuBar"
);
System
.
err
.
println
(
AquaLookAndFeel
.
sOldPropertyPrefix
+
"useScreenMenuBar has been deprecated. Please switch to "
+
if
(
props
[
0
]
!=
null
&&
props
[
0
].
equals
(
"true"
))
{
AquaLookAndFeel
.
sPropertyPrefix
+
"useScreenMenuBar"
);
System
.
err
.
println
(
AquaLookAndFeel
.
sOldPropertyPrefix
+
"useScreenMenuBar has been deprecated. Please switch to "
+
AquaLookAndFeel
.
sPropertyPrefix
+
"useScreenMenuBar"
);
return
true
;
useScreenMenuBar
=
true
;
}
}
return
false
;
}
}
catch
(
final
Throwable
t
)
{
};
return
useScreenMenuBar
;
}
}
}
}
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
浏览文件 @
115011af
...
@@ -784,6 +784,13 @@ public final class LWCToolkit extends LWToolkit {
...
@@ -784,6 +784,13 @@ public final class LWCToolkit extends LWToolkit {
*/
*/
native
boolean
isApplicationActive
();
native
boolean
isApplicationActive
();
/**
* Returns true if AWT toolkit is embedded, false otherwise.
*
* @return true if AWT toolkit is embedded, false otherwise
*/
public
static
native
boolean
isEmbedded
();
/************************
/************************
* Native methods section
* Native methods section
************************/
************************/
...
...
src/macosx/native/sun/awt/LWCToolkit.m
浏览文件 @
115011af
...
@@ -452,3 +452,14 @@ Java_sun_font_FontManager_populateFontFileNameMap
...
@@ -452,3 +452,14 @@ Java_sun_font_FontManager_populateFontFileNameMap
}
}
/*
* Class: sun_lwawt_macosx_LWCToolkit
* Method: isEmbedded
* Signature: ()Z
*/
JNIEXPORT
jboolean
JNICALL
Java_sun_lwawt_macosx_LWCToolkit_isEmbedded
(
JNIEnv
*
env
,
jclass
klass
)
{
return
[
ThreadUtilities
isAWTEmbedded
]
?
JNI_TRUE
:
JNI_FALSE
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录