Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
484dd4eb
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看板
提交
484dd4eb
编写于
9月 19, 2013
作者:
L
leonidr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7129133: [macosx] Accelerators are displayed as Meta instead of the Command symbol
Reviewed-by: anthony, serb
上级
c37972b2
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
199 addition
and
3 deletion
+199
-3
makefiles/GensrcProperties.gmk
makefiles/GensrcProperties.gmk
+7
-0
src/macosx/classes/sun/awt/resources/awtosx.properties
src/macosx/classes/sun/awt/resources/awtosx.properties
+71
-0
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
+20
-3
src/share/classes/java/awt/Toolkit.java
src/share/classes/java/awt/Toolkit.java
+24
-0
src/share/classes/sun/awt/AWTAccessor.java
src/share/classes/sun/awt/AWTAccessor.java
+27
-0
test/java/awt/Toolkit/ToolkitPropertyTest/bug7129133.java
test/java/awt/Toolkit/ToolkitPropertyTest/bug7129133.java
+50
-0
未找到文件。
makefiles/GensrcProperties.gmk
浏览文件 @
484dd4eb
...
...
@@ -253,6 +253,13 @@ ifeq ($(OPENJDK_TARGET_OS),windows)
$(call CacheFind,$(JDK_TOPDIR)/src/windows/classes/sun/awt/windows)),\
ListResourceBundle,%zh_TW,%zh_HK))
endif
# os x specific awt properties
ifeq ($(OPENJDK_TARGET_OS),macosx)
$(eval $(call add_properties_to_compile,SUN_AWT,\
$(filter $(JDK_TOPDIR)/src/macosx/classes/sun/awt/resources/%.properties,\
$(call CacheFind,$(JDK_TOPDIR)/src/macosx/classes/sun/awt/resources)),\
ListResourceBundle))
endif
#sun/launcher/resources
$(eval $(call add_properties_to_compile,SUN_LAUNCHER,\
...
...
src/macosx/classes/sun/awt/resources/awtosx.properties
0 → 100644
浏览文件 @
484dd4eb
#
# OS X specific AWT properties
#
# Modifier names
AWT.shift
=
\u
21e7
AWT.control
=
\u2303
AWT.alt
=
\u2325
AWT.meta
=
\u2318
AWT.altGraph
=
\u2325
# Key names
AWT.enter
=
\u
23ce
AWT.backSpace
=
\u
232b
AWT.tab
=
\u
21e5
AWT.cancel
=
\u
238b
AWT.clear
=
\u2327
AWT.capsLock
=
\u
21ea
AWT.escape
=
\u
238b
AWT.space
=
\u2423
AWT.pgup
=
\u
21de
AWT.pgdn
=
\u
21df
AWT.end
=
\u2198
AWT.home
=
\u2196
AWT.left
=
\u2190
AWT.up
=
\u2191
AWT.right
=
\u2192
AWT.down
=
\u2193
AWT.comma
=
,
AWT.period
=
.
AWT.slash
=
/
AWT.semicolon
=
;
AWT.equals
=
\u
003d
AWT.openBracket
=
[
AWT.backSlash
=
\\
AWT.closeBracket
=
]
AWT.multiply
=
\u2328
*
AWT.add
=
\u2328
+
AWT.separator
=
\u2328
,
AWT.separater
=
\u2328
,
AWT.subtract
=
\u2328
-
AWT.decimal
=
\u2328
.
AWT.divide
=
\u2328
/
AWT.delete
=
\u2326
AWT.printScreen
=
\u2399
AWT.backQuote
=
`
AWT.quote
=
'
AWT.ampersand
=
&
AWT.asterisk
=
*
AWT.quoteDbl
=
"
AWT.Less=<
AWT.greater=>
AWT.braceLeft=[
AWT.braceRight=]
AWT.at=@
AWT.colon=:
AWT.circumflex=^
AWT.dollar=$
AWT.euro=
\u
20ac
AWT.exclamationMark=!
AWT.invertedExclamationMark=
\u
00a1
AWT.leftParenthesis=(
AWT.numberSign=#
AWT.plus=+
AWT.minus=-
AWT.rightParenthesis=)
AWT.underscore=_
# Numeric Keypad
AWT.numpad=
\u2328
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
浏览文件 @
484dd4eb
...
...
@@ -44,6 +44,8 @@ import sun.lwawt.*;
import
sun.lwawt.LWWindowPeer.PeerType
;
import
sun.security.action.GetBooleanAction
;
import
sun.util.CoreResourceBundleControl
;
class
NamedCursor
extends
Cursor
{
NamedCursor
(
String
name
)
{
super
(
name
);
...
...
@@ -67,13 +69,28 @@ public final class LWCToolkit extends LWToolkit {
static
{
System
.
err
.
flush
();
java
.
security
.
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
<
Object
>()
{
public
Object
run
()
{
ResourceBundle
platformResources
=
java
.
security
.
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
<
ResourceBundle
>()
{
public
ResourceBundle
run
()
{
ResourceBundle
platformResources
=
null
;
try
{
platformResources
=
ResourceBundle
.
getBundle
(
"sun.awt.resources.awtosx"
,
CoreResourceBundleControl
.
getRBControlInstance
());
}
catch
(
MissingResourceException
e
)
{
// No resource file; defaults will be used.
}
System
.
loadLibrary
(
"awt"
);
System
.
loadLibrary
(
"fontmanager"
);
return
null
;
return
platformResources
;
}
});
AWTAccessor
.
getToolkitAccessor
().
setPlatformResources
(
platformResources
);
if
(!
GraphicsEnvironment
.
isHeadless
())
{
initIDs
();
}
...
...
src/share/classes/java/awt/Toolkit.java
浏览文件 @
484dd4eb
...
...
@@ -56,6 +56,7 @@ import sun.awt.HeadlessToolkit;
import
sun.awt.NullComponentPeer
;
import
sun.awt.PeerEvent
;
import
sun.awt.SunToolkit
;
import
sun.awt.AWTAccessor
;
import
sun.security.util.SecurityConstants
;
import
sun.util.CoreResourceBundleControl
;
...
...
@@ -1599,6 +1600,12 @@ public abstract class Toolkit {
* here, so that only one copy is maintained.
*/
private
static
ResourceBundle
resources
;
private
static
ResourceBundle
platformResources
;
// called by platform toolkit
private
static
void
setPlatformResources
(
ResourceBundle
bundle
)
{
platformResources
=
bundle
;
}
/**
* Initialize JNI field and method ids
...
...
@@ -1647,6 +1654,14 @@ public abstract class Toolkit {
}
static
{
AWTAccessor
.
setToolkitAccessor
(
new
AWTAccessor
.
ToolkitAccessor
()
{
@Override
public
void
setPlatformResources
(
ResourceBundle
bundle
)
{
Toolkit
.
setPlatformResources
(
bundle
);
}
});
java
.
security
.
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
<
Void
>()
{
public
Void
run
()
{
...
...
@@ -1674,6 +1689,15 @@ public abstract class Toolkit {
* This method returns defaultValue if the property is not found.
*/
public
static
String
getProperty
(
String
key
,
String
defaultValue
)
{
// first try platform specific bundle
if
(
platformResources
!=
null
)
{
try
{
return
platformResources
.
getString
(
key
);
}
catch
(
MissingResourceException
e
)
{}
}
// then shared one
if
(
resources
!=
null
)
{
try
{
return
resources
.
getString
(
key
);
...
...
src/share/classes/sun/awt/AWTAccessor.java
浏览文件 @
484dd4eb
...
...
@@ -39,6 +39,7 @@ import java.lang.reflect.InvocationTargetException;
import
java.security.AccessControlContext
;
import
java.io.File
;
import
java.util.ResourceBundle
;
import
java.util.Vector
;
/**
...
...
@@ -704,6 +705,13 @@ public final class AWTAccessor {
boolean
isSequencedEvent
(
AWTEvent
event
);
}
/*
* An accessor for the Toolkit class
*/
public
interface
ToolkitAccessor
{
void
setPlatformResources
(
ResourceBundle
bundle
);
}
/*
* Accessor instances are initialized in the static initializers of
* corresponding AWT classes by using setters defined below.
...
...
@@ -731,6 +739,7 @@ public final class AWTAccessor {
private
static
TrayIconAccessor
trayIconAccessor
;
private
static
DefaultKeyboardFocusManagerAccessor
defaultKeyboardFocusManagerAccessor
;
private
static
SequencedEventAccessor
sequencedEventAccessor
;
private
static
ToolkitAccessor
toolkitAccessor
;
/*
* Set an accessor object for the java.awt.Component class.
...
...
@@ -1124,4 +1133,22 @@ public final class AWTAccessor {
// (so not a single instance of the event has been created).
return
sequencedEventAccessor
;
}
/*
* Set an accessor object for the java.awt.Toolkit class.
*/
public
static
void
setToolkitAccessor
(
ToolkitAccessor
ta
)
{
toolkitAccessor
=
ta
;
}
/*
* Get the accessor object for the java.awt.Toolkit class.
*/
public
static
ToolkitAccessor
getToolkitAccessor
()
{
if
(
toolkitAccessor
==
null
)
{
unsafe
.
ensureClassInitialized
(
Toolkit
.
class
);
}
return
toolkitAccessor
;
}
}
test/java/awt/Toolkit/ToolkitPropertyTest/bug7129133.java
0 → 100644
浏览文件 @
484dd4eb
/*
* Copyright (c) 2013, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7129133
* @summary [macosx] Accelerators are displayed as Meta instead of the Command symbol
* @author leonid.romanov@oracle.com
* @run main bug7129133
*/
import
java.awt.*
;
public
class
bug7129133
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
if
(
sun
.
awt
.
OSInfo
.
getOSType
()
!=
sun
.
awt
.
OSInfo
.
OSType
.
MACOSX
)
{
System
.
out
.
println
(
"This test is for MacOS only. Automatically passed on other platforms."
);
return
;
}
Toolkit
.
getDefaultToolkit
();
String
cmdSymbol
=
"\u2318"
;
String
val
=
Toolkit
.
getProperty
(
"AWT.meta"
,
"Meta"
);
if
(!
val
.
equals
(
cmdSymbol
))
{
throw
new
Exception
(
"Wrong property value for AWT.meta. Expected: "
+
cmdSymbol
+
", actual: "
+
val
);
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录