Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
131eb6f0
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看板
提交
131eb6f0
编写于
12月 04, 2012
作者:
J
jviswana
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
4631925: JColor Chooser is not fully accessible
Reviewed-by: alexsch
上级
3f71ca92
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
18 addition
and
2 deletion
+18
-2
src/share/classes/javax/swing/JColorChooser.java
src/share/classes/javax/swing/JColorChooser.java
+4
-0
src/share/classes/javax/swing/colorchooser/ColorChooserPanel.java
...e/classes/javax/swing/colorchooser/ColorChooserPanel.java
+1
-0
src/share/classes/javax/swing/colorchooser/ColorPanel.java
src/share/classes/javax/swing/colorchooser/ColorPanel.java
+12
-2
src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java
...e/classes/javax/swing/plaf/basic/BasicColorChooserUI.java
+1
-0
未找到文件。
src/share/classes/javax/swing/JColorChooser.java
浏览文件 @
131eb6f0
...
...
@@ -182,6 +182,7 @@ public class JColorChooser extends JComponent implements Accessible {
dialog
=
new
ColorChooserDialog
((
Dialog
)
window
,
title
,
modal
,
c
,
chooserPane
,
okListener
,
cancelListener
);
}
dialog
.
getAccessibleContext
().
setAccessibleDescription
(
title
);
return
dialog
;
}
...
...
@@ -647,6 +648,7 @@ class ColorChooserDialog extends JDialog {
buttonPane
.
setLayout
(
new
FlowLayout
(
FlowLayout
.
CENTER
));
JButton
okButton
=
new
JButton
(
okString
);
getRootPane
().
setDefaultButton
(
okButton
);
okButton
.
getAccessibleContext
().
setAccessibleDescription
(
okString
);
okButton
.
setActionCommand
(
"OK"
);
okButton
.
addActionListener
(
new
ActionListener
()
{
public
void
actionPerformed
(
ActionEvent
e
)
{
...
...
@@ -659,6 +661,7 @@ class ColorChooserDialog extends JDialog {
buttonPane
.
add
(
okButton
);
cancelButton
=
new
JButton
(
cancelString
);
cancelButton
.
getAccessibleContext
().
setAccessibleDescription
(
cancelString
);
// The following few lines are used to register esc to close the dialog
Action
cancelKeyAction
=
new
AbstractAction
()
{
...
...
@@ -688,6 +691,7 @@ class ColorChooserDialog extends JDialog {
buttonPane
.
add
(
cancelButton
);
JButton
resetButton
=
new
JButton
(
resetString
);
resetButton
.
getAccessibleContext
().
setAccessibleDescription
(
resetString
);
resetButton
.
addActionListener
(
new
ActionListener
()
{
public
void
actionPerformed
(
ActionEvent
e
)
{
reset
();
...
...
src/share/classes/javax/swing/colorchooser/ColorChooserPanel.java
浏览文件 @
131eb6f0
...
...
@@ -135,6 +135,7 @@ final class ColorChooserPanel extends AbstractColorChooserPanel implements Prope
String
label
=
this
.
model
.
getText
(
this
,
"HexCode"
);
// NON-NLS: suffix
boolean
visible
=
label
!=
null
;
this
.
text
.
setVisible
(
visible
);
this
.
text
.
getAccessibleContext
().
setAccessibleDescription
(
label
);
this
.
label
.
setVisible
(
visible
);
if
(
visible
)
{
this
.
label
.
setText
(
label
);
...
...
src/share/classes/javax/swing/colorchooser/ColorPanel.java
浏览文件 @
131eb6f0
...
...
@@ -37,6 +37,7 @@ import javax.swing.JLabel;
import
javax.swing.JPanel
;
import
javax.swing.JRadioButton
;
import
javax.swing.border.EmptyBorder
;
import
javax.swing.JSpinner.DefaultEditor
;
final
class
ColorPanel
extends
JPanel
implements
ActionListener
{
...
...
@@ -119,17 +120,26 @@ final class ColorPanel extends JPanel implements ActionListener {
int
count
=
this
.
model
.
getCount
();
this
.
spinners
[
4
].
setVisible
(
count
>
4
);
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
String
text
=
this
.
model
.
getLabel
(
this
,
i
);
Object
object
=
this
.
spinners
[
i
].
getLabel
();
if
(
object
instanceof
JRadioButton
)
{
JRadioButton
button
=
(
JRadioButton
)
object
;
button
.
setText
(
this
.
model
.
getLabel
(
this
,
i
));
button
.
setText
(
text
);
button
.
getAccessibleContext
().
setAccessibleDescription
(
text
);
}
else
if
(
object
instanceof
JLabel
)
{
JLabel
label
=
(
JLabel
)
object
;
label
.
setText
(
t
his
.
model
.
getLabel
(
this
,
i
)
);
label
.
setText
(
t
ext
);
}
this
.
spinners
[
i
].
setRange
(
this
.
model
.
getMinimum
(
i
),
this
.
model
.
getMaximum
(
i
));
this
.
spinners
[
i
].
setValue
(
this
.
values
[
i
]);
this
.
spinners
[
i
].
getSlider
().
getAccessibleContext
().
setAccessibleName
(
text
);
this
.
spinners
[
i
].
getSpinner
().
getAccessibleContext
().
setAccessibleName
(
text
);
DefaultEditor
editor
=
(
DefaultEditor
)
this
.
spinners
[
i
].
getSpinner
().
getEditor
();
editor
.
getTextField
().
getAccessibleContext
().
setAccessibleName
(
text
);
this
.
spinners
[
i
].
getSlider
().
getAccessibleContext
().
setAccessibleDescription
(
text
);
this
.
spinners
[
i
].
getSpinner
().
getAccessibleContext
().
setAccessibleDescription
(
text
);
editor
.
getTextField
().
getAccessibleContext
().
setAccessibleDescription
(
text
);
}
}
...
...
src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java
浏览文件 @
131eb6f0
...
...
@@ -94,6 +94,7 @@ public class BasicColorChooserUI extends ColorChooserUI
tabbedPane
=
new
JTabbedPane
();
tabbedPane
.
setName
(
"ColorChooser.tabPane"
);
tabbedPane
.
setInheritsPopupMenu
(
true
);
tabbedPane
.
getAccessibleContext
().
setAccessibleDescription
(
tabbedPane
.
getName
());
singlePanel
=
new
JPanel
(
new
CenterLayout
());
singlePanel
.
setName
(
"ColorChooser.panel"
);
singlePanel
.
setInheritsPopupMenu
(
true
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录