Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
02ab2e2c
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看板
提交
02ab2e2c
编写于
6月 05, 2013
作者:
L
lana
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
e5c0b05d
6bd97af4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
119 addition
and
5 deletion
+119
-5
src/macosx/native/sun/awt/AWTWindow.m
src/macosx/native/sun/awt/AWTWindow.m
+1
-1
src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java
.../classes/java/awt/ContainerOrderFocusTraversalPolicy.java
+1
-1
src/share/classes/javax/swing/KeyboardManager.java
src/share/classes/javax/swing/KeyboardManager.java
+3
-2
src/solaris/native/sun/xawt/XlibWrapper.c
src/solaris/native/sun/xawt/XlibWrapper.c
+4
-1
test/javax/swing/KeyboardManager/8013370/Test8013370.java
test/javax/swing/KeyboardManager/8013370/Test8013370.java
+110
-0
未找到文件。
src/macosx/native/sun/awt/AWTWindow.m
浏览文件 @
02ab2e2c
...
...
@@ -539,7 +539,7 @@ AWT_ASSERT_APPKIT_THREAD;
AWTWindow
*
opposite
=
[
AWTWindow
lastKeyWindow
];
if
(
!
IS
(
self
.
styleBits
,
IS_DIALOG
))
{
[
CMenuBar
activate
:
self
.
javaMenuBar
modallyDisabled
:
NO
];
}
else
if
(
IS
(
self
.
styleBits
,
IS_MODAL
))
{
}
else
if
(
(
opposite
!=
NULL
)
&&
IS
(
self
.
styleBits
,
IS_MODAL
))
{
[
CMenuBar
activate
:
opposite
->
javaMenuBar
modallyDisabled
:
YES
];
}
[
AWTWindow
setLastKeyWindow
:
nil
];
...
...
src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java
浏览文件 @
02ab2e2c
...
...
@@ -42,7 +42,7 @@ import sun.util.logging.PlatformLogger;
* Component to focus. This behavior can be disabled using the
* <code>setImplicitDownCycleTraversal</code> method.
* <p>
* By default, methods of this class wi
th
return a Component only if it is
* By default, methods of this class wi
ll
return a Component only if it is
* visible, displayable, enabled, and focusable. Subclasses can modify this
* behavior by overriding the <code>accept</code> method.
* <p>
...
...
src/share/classes/javax/swing/KeyboardManager.java
浏览文件 @
02ab2e2c
...
...
@@ -285,10 +285,11 @@ class KeyboardManager {
while
(
iter
.
hasMoreElements
())
{
JMenuBar
mb
=
(
JMenuBar
)
iter
.
nextElement
();
if
(
mb
.
isShowing
()
&&
mb
.
isEnabled
()
)
{
// don't want to give these out
if
(
!(
ks
.
equals
(
ksE
))
)
{
boolean
extended
=
(
ksE
!=
null
)
&&
!
ksE
.
equals
(
ks
);
if
(
extended
)
{
fireBinding
(
mb
,
ksE
,
e
,
pressed
);
}
if
(
ks
.
equals
(
ksE
)
||
!
e
.
isConsumed
())
{
if
(!
extended
||
!
e
.
isConsumed
())
{
fireBinding
(
mb
,
ks
,
e
,
pressed
);
}
if
(
e
.
isConsumed
())
{
...
...
src/solaris/native/sun/xawt/XlibWrapper.c
浏览文件 @
02ab2e2c
...
...
@@ -1946,13 +1946,16 @@ secondary_loop_event(Display* dpy, XEvent* event, char* arg) {
JNIEXPORT
jboolean
JNICALL
Java_sun_awt_X11_XlibWrapper_XNextSecondaryLoopEvent
(
JNIEnv
*
env
,
jclass
clazz
,
jlong
display
,
jlong
ptr
)
{
uint32_t
timeout
=
1
;
AWT_CHECK_HAVE_LOCK
();
exitSecondaryLoop
=
False
;
while
(
!
exitSecondaryLoop
)
{
if
(
XCheckIfEvent
((
Display
*
)
jlong_to_ptr
(
display
),
(
XEvent
*
)
jlong_to_ptr
(
ptr
),
secondary_loop_event
,
NULL
))
{
return
JNI_TRUE
;
}
AWT_WAIT
(
AWT_SECONDARY_LOOP_TIMEOUT
);
timeout
=
(
timeout
<
AWT_SECONDARY_LOOP_TIMEOUT
)
?
(
timeout
<<
1
)
:
AWT_SECONDARY_LOOP_TIMEOUT
;
AWT_WAIT
(
timeout
);
}
return
JNI_FALSE
;
}
...
...
test/javax/swing/KeyboardManager/8013370/Test8013370.java
0 → 100644
浏览文件 @
02ab2e2c
/*
* 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.
*/
import
java.awt.Robot
;
import
java.awt.Toolkit
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.KeyEvent
;
import
javax.swing.AbstractAction
;
import
javax.swing.InputMap
;
import
javax.swing.JFrame
;
import
javax.swing.JMenuBar
;
import
javax.swing.JMenuItem
;
import
javax.swing.KeyStroke
;
import
sun.awt.SunToolkit
;
import
static
java
.
awt
.
event
.
InputEvent
.
CTRL_DOWN_MASK
;
import
static
javax
.
swing
.
JComponent
.
WHEN_IN_FOCUSED_WINDOW
;
import
static
javax
.
swing
.
JOptionPane
.
showMessageDialog
;
import
static
javax
.
swing
.
SwingUtilities
.
invokeAndWait
;
/*
* @test
* @bug 8013370
* @summary Ensure that key stroke is not null
* @author Sergey Malenkov
*/
public
class
Test8013370
implements
Runnable
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Test8013370
task
=
new
Test8013370
();
invokeAndWait
(
task
);
Robot
robot
=
new
Robot
();
robot
.
waitForIdle
();
robot
.
keyPress
(
KeyEvent
.
VK_CONTROL
);
robot
.
keyRelease
(
KeyEvent
.
VK_CONTROL
);
robot
.
waitForIdle
();
invokeAndWait
(
task
);
task
.
validate
();
}
private
JFrame
frame
;
private
boolean
error
;
@Override
public
void
run
()
{
if
(
this
.
frame
==
null
)
{
JMenuBar
menu
=
new
JMenuBar
()
{
@Override
protected
boolean
processKeyBinding
(
KeyStroke
stroke
,
KeyEvent
event
,
int
condition
,
boolean
pressed
)
{
if
(
stroke
==
null
)
{
Test8013370
.
this
.
error
=
true
;
return
false
;
}
return
super
.
processKeyBinding
(
stroke
,
event
,
condition
,
pressed
);
}
};
menu
.
add
(
new
JMenuItem
(
"Menu"
));
InputMap
map
=
menu
.
getInputMap
(
WHEN_IN_FOCUSED_WINDOW
);
// We add exactly 10 actions because the ArrayTable is converted
// from a array to a hashtable when more than 8 values are added.
for
(
int
i
=
0
;
i
<
9
;
i
++)
{
String
name
=
" Action #"
+
i
;
map
.
put
(
KeyStroke
.
getKeyStroke
(
KeyEvent
.
VK_A
+
i
,
CTRL_DOWN_MASK
),
name
);
menu
.
getActionMap
().
put
(
name
,
new
AbstractAction
(
name
)
{
@Override
public
void
actionPerformed
(
ActionEvent
event
)
{
showMessageDialog
(
null
,
getValue
(
NAME
));
}
});
}
this
.
frame
=
new
JFrame
(
"8013370"
);
this
.
frame
.
setJMenuBar
(
menu
);
this
.
frame
.
setVisible
(
true
);
}
else
{
this
.
frame
.
dispose
();
}
}
private
void
validate
()
{
if
(
this
.
error
)
{
throw
new
Error
(
"KeyStroke is null"
);
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录