Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
faf9c616
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看板
提交
faf9c616
编写于
9月 17, 2009
作者:
A
alexp
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
4833524: BasicTreeUI.isToggleSelectionEvent() does not properly handle popup triggers
Reviewed-by: rupashka
上级
e5c72fdd
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
34 addition
and
20 deletion
+34
-20
src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java
...share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java
+1
-1
src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java
...share/classes/javax/swing/plaf/basic/BasicComboPopup.java
+3
-2
src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java
...re/classes/javax/swing/plaf/basic/BasicFileChooserUI.java
+2
-1
src/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java
...re/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java
+8
-0
src/share/classes/javax/swing/plaf/basic/BasicListUI.java
src/share/classes/javax/swing/plaf/basic/BasicListUI.java
+7
-6
src/share/classes/javax/swing/plaf/basic/BasicTableUI.java
src/share/classes/javax/swing/plaf/basic/BasicTableUI.java
+8
-5
src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
+4
-4
src/share/classes/javax/swing/text/DefaultCaret.java
src/share/classes/javax/swing/text/DefaultCaret.java
+1
-1
未找到文件。
src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java
浏览文件 @
faf9c616
...
...
@@ -1766,7 +1766,7 @@ public class BasicComboBoxUI extends ComboBoxUI {
}
private
boolean
isTypeAheadKey
(
KeyEvent
e
)
{
return
!
e
.
isAltDown
()
&&
!
e
.
isControlDown
()
&&
!
e
.
isMetaDown
(
);
return
!
e
.
isAltDown
()
&&
!
BasicGraphicsUtils
.
isMenuShortcutKeyDown
(
e
);
}
//
...
...
src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java
浏览文件 @
faf9c616
...
...
@@ -483,11 +483,12 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup {
protected
JList
createList
()
{
return
new
JList
(
comboBox
.
getModel
()
)
{
public
void
processMouseEvent
(
MouseEvent
e
)
{
if
(
e
.
isControlDown
(
))
{
if
(
BasicGraphicsUtils
.
isMenuShortcutKeyDown
(
e
))
{
// Fix for 4234053. Filter out the Control Key from the list.
// ie., don't allow CTRL key deselection.
Toolkit
toolkit
=
Toolkit
.
getDefaultToolkit
();
e
=
new
MouseEvent
((
Component
)
e
.
getSource
(),
e
.
getID
(),
e
.
getWhen
(),
e
.
getModifiers
()
^
InputEvent
.
CTRL_MASK
,
e
.
getModifiers
()
^
toolkit
.
getMenuShortcutKeyMask
()
,
e
.
getX
(),
e
.
getY
(),
e
.
getXOnScreen
(),
e
.
getYOnScreen
(),
e
.
getClickCount
(),
...
...
src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java
浏览文件 @
faf9c616
...
...
@@ -924,7 +924,8 @@ public class BasicFileChooserUI extends FileChooserUI {
boolean
isTrav
=
(
selectedFile
!=
null
&&
chooser
.
isTraversable
(
selectedFile
));
boolean
isDirSelEnabled
=
chooser
.
isDirectorySelectionEnabled
();
boolean
isFileSelEnabled
=
chooser
.
isFileSelectionEnabled
();
boolean
isCtrl
=
(
e
!=
null
&&
(
e
.
getModifiers
()
&
ActionEvent
.
CTRL_MASK
)
!=
0
);
boolean
isCtrl
=
(
e
!=
null
&&
(
e
.
getModifiers
()
&
Toolkit
.
getDefaultToolkit
().
getMenuShortcutKeyMask
())
!=
0
);
if
(
isDir
&&
isTrav
&&
(
isCtrl
||
!
isDirSelEnabled
))
{
changeDirectory
(
selectedFile
);
...
...
src/share/classes/javax/swing/plaf/basic/BasicGraphicsUtils.java
浏览文件 @
faf9c616
...
...
@@ -33,7 +33,10 @@ import java.awt.FontMetrics;
import
java.awt.Graphics
;
import
java.awt.Insets
;
import
java.awt.Rectangle
;
import
java.awt.Toolkit
;
import
java.awt.event.KeyEvent
;
import
java.awt.event.InputEvent
;
import
sun.swing.SwingUtilities2
;
...
...
@@ -303,4 +306,9 @@ public class BasicGraphicsUtils
static
boolean
isLeftToRight
(
Component
c
)
{
return
c
.
getComponentOrientation
().
isLeftToRight
();
}
static
boolean
isMenuShortcutKeyDown
(
InputEvent
event
)
{
return
(
event
.
getModifiers
()
&
Toolkit
.
getDefaultToolkit
().
getMenuShortcutKeyMask
())
!=
0
;
}
}
src/share/classes/javax/swing/plaf/basic/BasicListUI.java
浏览文件 @
faf9c616
...
...
@@ -2371,8 +2371,9 @@ public class BasicListUI extends ListUI
JList
src
=
(
JList
)
e
.
getSource
();
ListModel
model
=
src
.
getModel
();
if
(
model
.
getSize
()
==
0
||
e
.
isAltDown
()
||
e
.
isControlDown
()
||
e
.
isMetaDown
()
||
isNavigationKey
(
e
))
{
if
(
model
.
getSize
()
==
0
||
e
.
isAltDown
()
||
BasicGraphicsUtils
.
isMenuShortcutKeyDown
(
e
)
||
isNavigationKey
(
e
))
{
// Nothing to select
return
;
}
...
...
@@ -2665,7 +2666,7 @@ public class BasicListUI extends ListUI
if
(
row
!=
-
1
&&
DragRecognitionSupport
.
mousePressed
(
e
))
{
dragPressDidSelection
=
false
;
if
(
e
.
isControlDown
(
))
{
if
(
BasicGraphicsUtils
.
isMenuShortcutKeyDown
(
e
))
{
// do nothing for control - will be handled on release
// or when drag starts
return
;
...
...
@@ -2717,7 +2718,7 @@ public class BasicListUI extends ListUI
anchorSelected
=
list
.
isSelectedIndex
(
anchorIndex
);
}
if
(
e
.
isControlDown
(
))
{
if
(
BasicGraphicsUtils
.
isMenuShortcutKeyDown
(
e
))
{
if
(
e
.
isShiftDown
())
{
if
(
anchorSelected
)
{
list
.
addSelectionInterval
(
anchorIndex
,
row
);
...
...
@@ -2742,7 +2743,7 @@ public class BasicListUI extends ListUI
}
public
void
dragStarting
(
MouseEvent
me
)
{
if
(
me
.
isControlDown
(
))
{
if
(
BasicGraphicsUtils
.
isMenuShortcutKeyDown
(
me
))
{
int
row
=
SwingUtilities2
.
loc2IndexFileList
(
list
,
me
.
getPoint
());
list
.
addSelectionInterval
(
row
,
row
);
}
...
...
@@ -2758,7 +2759,7 @@ public class BasicListUI extends ListUI
return
;
}
if
(
e
.
isShiftDown
()
||
e
.
isControlDown
(
))
{
if
(
e
.
isShiftDown
()
||
BasicGraphicsUtils
.
isMenuShortcutKeyDown
(
e
))
{
return
;
}
...
...
src/share/classes/javax/swing/plaf/basic/BasicTableUI.java
浏览文件 @
faf9c616
...
...
@@ -1027,7 +1027,7 @@ public class BasicTableUI extends TableUI
shouldStartTimer
=
table
.
isCellSelected
(
pressedRow
,
pressedCol
)
&&
!
e
.
isShiftDown
()
&&
!
e
.
isControlDown
(
)
&&
!
BasicGraphicsUtils
.
isMenuShortcutKeyDown
(
e
)
&&
!
outsidePrefSize
;
}
...
...
@@ -1051,7 +1051,7 @@ public class BasicTableUI extends TableUI
dragPressDidSelection
=
false
;
if
(
e
.
isControlDown
(
)
&&
isFileList
)
{
if
(
BasicGraphicsUtils
.
isMenuShortcutKeyDown
(
e
)
&&
isFileList
)
{
// do nothing for control - will be handled on release
// or when drag starts
return
;
...
...
@@ -1115,7 +1115,9 @@ public class BasicTableUI extends TableUI
CellEditor
editor
=
table
.
getCellEditor
();
if
(
dragEnabled
||
editor
==
null
||
editor
.
shouldSelectCell
(
e
))
{
table
.
changeSelection
(
pressedRow
,
pressedCol
,
e
.
isControlDown
(),
e
.
isShiftDown
());
table
.
changeSelection
(
pressedRow
,
pressedCol
,
BasicGraphicsUtils
.
isMenuShortcutKeyDown
(
e
),
e
.
isShiftDown
());
}
}
...
...
@@ -1212,7 +1214,7 @@ public class BasicTableUI extends TableUI
public
void
dragStarting
(
MouseEvent
me
)
{
dragStarted
=
true
;
if
(
me
.
isControlDown
(
)
&&
isFileList
)
{
if
(
BasicGraphicsUtils
.
isMenuShortcutKeyDown
(
me
)
&&
isFileList
)
{
table
.
getSelectionModel
().
addSelectionInterval
(
pressedRow
,
pressedRow
);
table
.
getColumnModel
().
getSelectionModel
().
...
...
@@ -1251,7 +1253,8 @@ public class BasicTableUI extends TableUI
return
;
}
table
.
changeSelection
(
row
,
column
,
e
.
isControlDown
(),
true
);
table
.
changeSelection
(
row
,
column
,
BasicGraphicsUtils
.
isMenuShortcutKeyDown
(
e
),
true
);
}
...
...
src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
浏览文件 @
faf9c616
...
...
@@ -2265,7 +2265,7 @@ public class BasicTreeUI extends TreeUI
*/
protected
boolean
isToggleSelectionEvent
(
MouseEvent
event
)
{
return
(
SwingUtilities
.
isLeftMouseButton
(
event
)
&&
event
.
isControlDown
(
));
BasicGraphicsUtils
.
isMenuShortcutKeyDown
(
event
));
}
/**
...
...
@@ -3255,7 +3255,7 @@ public class BasicTreeUI extends TreeUI
// handle first letter navigation
if
(
tree
!=
null
&&
tree
.
getRowCount
()>
0
&&
tree
.
hasFocus
()
&&
tree
.
isEnabled
())
{
if
(
e
.
isAltDown
()
||
e
.
isControlDown
()
||
e
.
isMetaDown
(
)
||
if
(
e
.
isAltDown
()
||
BasicGraphicsUtils
.
isMenuShortcutKeyDown
(
e
)
||
isNavigationKey
(
e
))
{
return
;
}
...
...
@@ -3511,7 +3511,7 @@ public class BasicTreeUI extends TreeUI
dragPressDidSelection
=
false
;
if
(
e
.
isControlDown
(
))
{
if
(
BasicGraphicsUtils
.
isMenuShortcutKeyDown
(
e
))
{
// do nothing for control - will be handled on release
// or when drag starts
return
;
...
...
@@ -3565,7 +3565,7 @@ public class BasicTreeUI extends TreeUI
public
void
dragStarting
(
MouseEvent
me
)
{
dragStarted
=
true
;
if
(
me
.
isControlDown
(
))
{
if
(
BasicGraphicsUtils
.
isMenuShortcutKeyDown
(
me
))
{
tree
.
addSelectionPath
(
pressedPath
);
setAnchorSelectionPath
(
pressedPath
);
setLeadSelectionPath
(
pressedPath
,
true
);
...
...
src/share/classes/javax/swing/text/DefaultCaret.java
浏览文件 @
faf9c616
...
...
@@ -510,7 +510,7 @@ public class DefaultCaret extends Rectangle implements Caret, FocusListener, Mou
if
((
e
.
getModifiers
()
&
ActionEvent
.
SHIFT_MASK
)
!=
0
&&
getDot
()
!=
-
1
)
{
moveCaret
(
e
);
}
else
{
}
else
if
(!
e
.
isPopupTrigger
())
{
positionCaret
(
e
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录