Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
79197f4e
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
79197f4e
编写于
10月 09, 2013
作者:
L
leonidr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8004050: [macosx] The 'ESC' key does not work with jdk8
Reviewed-by: alexsch, serb
上级
c6ac174c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
12 deletion
+28
-12
src/macosx/classes/com/apple/laf/AquaComboBoxUI.java
src/macosx/classes/com/apple/laf/AquaComboBoxUI.java
+26
-10
src/macosx/classes/com/apple/laf/AquaKeyBindings.java
src/macosx/classes/com/apple/laf/AquaKeyBindings.java
+2
-2
未找到文件。
src/macosx/classes/com/apple/laf/AquaComboBoxUI.java
浏览文件 @
79197f4e
...
...
@@ -281,12 +281,16 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
actionMap
.
put
(
"aquaSelectPageUp"
,
highlightPageUpAction
);
actionMap
.
put
(
"aquaSelectPageDown"
,
highlightPageDownAction
);
actionMap
.
put
(
"aquaHidePopup"
,
hideAction
);
SwingUtilities
.
replaceUIActionMap
(
comboBox
,
actionMap
);
}
abstract
class
ComboBoxAction
extends
AbstractAction
{
private
abstract
class
ComboBoxAction
extends
AbstractAction
{
public
void
actionPerformed
(
final
ActionEvent
e
)
{
if
(!
comboBox
.
isEnabled
()
||
!
comboBox
.
isShowing
())
return
;
if
(!
comboBox
.
isEnabled
()
||
!
comboBox
.
isShowing
())
{
return
;
}
if
(
comboBox
.
isPopupVisible
())
{
final
AquaComboBoxUI
ui
=
(
AquaComboBoxUI
)
comboBox
.
getUI
();
...
...
@@ -302,7 +306,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
/**
* Hilight _but do not select_ the next item in the list.
*/
Action
highlightNextAction
=
new
ComboBoxAction
()
{
private
Action
highlightNextAction
=
new
ComboBoxAction
()
{
@Override
public
void
performComboBoxAction
(
AquaComboBoxUI
ui
)
{
final
int
si
=
listBox
.
getSelectedIndex
();
...
...
@@ -318,7 +322,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
/**
* Hilight _but do not select_ the previous item in the list.
*/
Action
highlightPreviousAction
=
new
ComboBoxAction
()
{
private
Action
highlightPreviousAction
=
new
ComboBoxAction
()
{
@Override
void
performComboBoxAction
(
final
AquaComboBoxUI
ui
)
{
final
int
si
=
listBox
.
getSelectedIndex
();
...
...
@@ -330,7 +334,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
}
};
Action
highlightFirstAction
=
new
ComboBoxAction
()
{
private
Action
highlightFirstAction
=
new
ComboBoxAction
()
{
@Override
void
performComboBoxAction
(
final
AquaComboBoxUI
ui
)
{
listBox
.
setSelectedIndex
(
0
);
...
...
@@ -338,7 +342,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
}
};
Action
highlightLastAction
=
new
ComboBoxAction
()
{
private
Action
highlightLastAction
=
new
ComboBoxAction
()
{
@Override
void
performComboBoxAction
(
final
AquaComboBoxUI
ui
)
{
final
int
size
=
listBox
.
getModel
().
getSize
();
...
...
@@ -347,7 +351,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
}
};
Action
highlightPageUpAction
=
new
ComboBoxAction
()
{
private
Action
highlightPageUpAction
=
new
ComboBoxAction
()
{
@Override
void
performComboBoxAction
(
final
AquaComboBoxUI
ui
)
{
final
int
current
=
listBox
.
getSelectedIndex
();
...
...
@@ -367,7 +371,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
}
};
Action
highlightPageDownAction
=
new
ComboBoxAction
()
{
private
Action
highlightPageDownAction
=
new
ComboBoxAction
()
{
@Override
void
performComboBoxAction
(
final
AquaComboBoxUI
ui
)
{
final
int
current
=
listBox
.
getSelectedIndex
();
...
...
@@ -482,13 +486,13 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
// This is somewhat messy. The difference here from BasicComboBoxUI.EnterAction is that
// arrow up or down does not automatically select the
static
final
Action
triggerSelectionAction
=
new
AbstractAction
()
{
private
static
final
Action
triggerSelectionAction
=
new
AbstractAction
()
{
public
void
actionPerformed
(
final
ActionEvent
e
)
{
triggerSelectionEvent
((
JComboBox
)
e
.
getSource
(),
e
);
}
};
static
final
Action
toggleSelectionAction
=
new
AbstractAction
()
{
private
static
final
Action
toggleSelectionAction
=
new
AbstractAction
()
{
public
void
actionPerformed
(
final
ActionEvent
e
)
{
final
JComboBox
comboBox
=
(
JComboBox
)
e
.
getSource
();
if
(!
comboBox
.
isEnabled
())
return
;
...
...
@@ -506,6 +510,18 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
}
};
private
static
Action
hideAction
=
new
AbstractAction
()
{
@Override
public
void
actionPerformed
(
final
ActionEvent
e
)
{
final
JComboBox
comboBox
=
(
JComboBox
)
e
.
getSource
();
if
(
comboBox
.
isPopupVisible
())
{
comboBox
.
firePopupMenuCanceled
();
comboBox
.
setPopupVisible
(
false
);
}
}
};
public
void
applySizeFor
(
final
JComponent
c
,
final
Size
size
)
{
if
(
arrowButton
==
null
)
return
;
final
Border
border
=
arrowButton
.
getBorder
();
...
...
src/macosx/classes/com/apple/laf/AquaKeyBindings.java
浏览文件 @
79197f4e
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011,
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
...
...
@@ -209,7 +209,7 @@ public class AquaKeyBindings {
LateBoundInputMap
getComboBoxInputMap
()
{
return
new
LateBoundInputMap
(
new
SimpleBinding
(
new
String
[]
{
"ESCAPE"
,
"
h
idePopup"
,
"ESCAPE"
,
"
aquaH
idePopup"
,
"PAGE_UP"
,
"aquaSelectPageUp"
,
"PAGE_DOWN"
,
"aquaSelectPageDown"
,
"HOME"
,
"aquaSelectHome"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录