Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
08d5fa6f
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看板
提交
08d5fa6f
编写于
10月 11, 2013
作者:
K
kshefov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7124338: [macosx] Selection lost if a selected item removed from a java.awt.List
Reviewed-by: serb, anthony
上级
4b246c34
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
162 addition
and
0 deletion
+162
-0
test/java/awt/List/FirstItemRemoveTest/FirstItemRemoveTest.html
...ava/awt/List/FirstItemRemoveTest/FirstItemRemoveTest.html
+43
-0
test/java/awt/List/FirstItemRemoveTest/FirstItemRemoveTest.java
...ava/awt/List/FirstItemRemoveTest/FirstItemRemoveTest.java
+119
-0
未找到文件。
test/java/awt/List/FirstItemRemoveTest/FirstItemRemoveTest.html
0 → 100644
浏览文件 @
08d5fa6f
<html>
<!--
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 6299858
@summary PIT. Focused border not shown on List if selected item is removed, XToolkit
@author Dmitry.Cherepanov@SUN.COM area=awt.list
@run applet FirstItemRemoveTest.html
-->
<head>
<title>
</title>
</head>
<body>
<h1>
FirstItemRemoveTest
<br>
Bug ID: 6299858
</h1>
<p>
This is an AUTOMATIC test, simply wait for completion
</p>
<APPLET
CODE=
"FirstItemRemoveTest.class"
WIDTH=
200
HEIGHT=
200
></APPLET>
</body>
</html>
test/java/awt/List/FirstItemRemoveTest/FirstItemRemoveTest.java
0 → 100644
浏览文件 @
08d5fa6f
/*
* 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 6299858 7124338
@summary PIT. Focused border not shown on List if selected item is removed, XToolkit
@author Dmitry.Cherepanov@SUN.COM area=awt.list
@run applet FirstItemRemoveTest.html
*/
import
java.applet.Applet
;
import
java.awt.*
;
import
java.awt.event.*
;
public
class
FirstItemRemoveTest
extends
Applet
{
List
list
=
new
List
(
4
,
false
);
Panel
panel
=
new
Panel
();
public
void
init
()
{
list
.
add
(
"000"
);
list
.
add
(
"111"
);
list
.
add
(
"222"
);
list
.
add
(
"333"
);
list
.
add
(
"444"
);
list
.
add
(
"555"
);
panel
.
setLayout
(
new
FlowLayout
());
panel
.
add
(
list
);
this
.
add
(
panel
);
this
.
setLayout
(
new
FlowLayout
());
}
//End init()
public
void
start
()
{
setSize
(
200
,
200
);
setVisible
(
true
);
validate
();
test
();
}
// start()
private
void
test
(){
if
(
sun
.
awt
.
OSInfo
.
getOSType
()
==
sun
.
awt
.
OSInfo
.
OSType
.
MACOSX
)
{
System
.
err
.
println
(
"Skipped. This test is not for OS X."
);
return
;
}
Robot
r
;
try
{
r
=
new
Robot
();
}
catch
(
AWTException
e
)
{
throw
new
RuntimeException
(
e
.
getMessage
());
}
// Removing first item in order to reproduce incorrect behaviour
r
.
delay
(
1000
);
list
.
remove
(
0
);
r
.
delay
(
1000
);
// Request focus to list
Point
loc
=
this
.
getLocationOnScreen
();
r
.
delay
(
1000
);
r
.
mouseMove
(
loc
.
x
+
10
,
loc
.
y
+
10
);
r
.
delay
(
10
);
r
.
mousePress
(
InputEvent
.
BUTTON1_MASK
);
r
.
delay
(
10
);
r
.
mouseRelease
(
InputEvent
.
BUTTON1_MASK
);
r
.
delay
(
1000
);
list
.
requestFocusInWindow
();
r
.
delay
(
1000
);
r
.
waitForIdle
();
if
(
KeyboardFocusManager
.
getCurrentKeyboardFocusManager
().
getFocusOwner
()
!=
list
){
throw
new
RuntimeException
(
"Test failed - list isn't focus owner."
);
}
// The focus index should be set to first item after removing
// So if we press VK_SPACE then the selected item will be equals 0.
r
.
delay
(
100
);
r
.
keyPress
(
KeyEvent
.
VK_SPACE
);
r
.
delay
(
10
);
r
.
keyRelease
(
KeyEvent
.
VK_SPACE
);
r
.
delay
(
1000
);
r
.
waitForIdle
();
int
selectedIndex
=
list
.
getSelectedIndex
();
if
(
selectedIndex
!=
0
){
throw
new
RuntimeException
(
"Test failed. list.getSelectedIndex() = "
+
selectedIndex
);
}
}
}
// class AutomaticAppletTest
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录