Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
ae2e7b82
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看板
提交
ae2e7b82
编写于
9月 11, 2014
作者:
A
alexsch
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8055304: More boxing for DirectoryComboBoxModel
Reviewed-by: serb, prr, skoivu
上级
8ac893cf
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
51 addition
and
40 deletion
+51
-40
src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java
...com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java
+3
-10
src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java
...re/classes/javax/swing/plaf/metal/MetalFileChooserUI.java
+3
-10
src/share/classes/sun/swing/WindowsPlacesBar.java
src/share/classes/sun/swing/WindowsPlacesBar.java
+1
-5
src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java
.../classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java
+3
-10
src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
...ndows/classes/sun/awt/shell/Win32ShellFolderManager2.java
+41
-5
未找到文件。
src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java
浏览文件 @
ae2e7b82
...
@@ -1067,16 +1067,9 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
...
@@ -1067,16 +1067,9 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
directories
.
clear
();
directories
.
clear
();
File
[]
baseFolders
;
File
[]
baseFolders
=
(
useShellFolder
)
if
(
useShellFolder
)
{
?
(
File
[])
ShellFolder
.
get
(
"fileChooserComboBoxFolders"
)
baseFolders
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
File
[]>()
{
:
fsv
.
getRoots
();
public
File
[]
run
()
{
return
(
File
[])
ShellFolder
.
get
(
"fileChooserComboBoxFolders"
);
}
});
}
else
{
baseFolders
=
fsv
.
getRoots
();
}
directories
.
addAll
(
Arrays
.
asList
(
baseFolders
));
directories
.
addAll
(
Arrays
.
asList
(
baseFolders
));
// Get the canonical (full) path. This has the side
// Get the canonical (full) path. This has the side
...
...
src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java
浏览文件 @
ae2e7b82
...
@@ -941,16 +941,9 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
...
@@ -941,16 +941,9 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
directories
.
clear
();
directories
.
clear
();
File
[]
baseFolders
;
File
[]
baseFolders
=
(
useShellFolder
)
if
(
useShellFolder
)
{
?
(
File
[])
ShellFolder
.
get
(
"fileChooserComboBoxFolders"
)
baseFolders
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
File
[]>()
{
:
fsv
.
getRoots
();
public
File
[]
run
()
{
return
(
File
[])
ShellFolder
.
get
(
"fileChooserComboBoxFolders"
);
}
});
}
else
{
baseFolders
=
fsv
.
getRoots
();
}
directories
.
addAll
(
Arrays
.
asList
(
baseFolders
));
directories
.
addAll
(
Arrays
.
asList
(
baseFolders
));
// Get the canonical (full) path. This has the side
// Get the canonical (full) path. This has the side
...
...
src/share/classes/sun/swing/WindowsPlacesBar.java
浏览文件 @
ae2e7b82
...
@@ -81,11 +81,7 @@ public class WindowsPlacesBar extends JToolBar
...
@@ -81,11 +81,7 @@ public class WindowsPlacesBar extends JToolBar
setBackground
(
bgColor
);
setBackground
(
bgColor
);
FileSystemView
fsv
=
fc
.
getFileSystemView
();
FileSystemView
fsv
=
fc
.
getFileSystemView
();
files
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
File
[]>()
{
files
=
(
File
[])
ShellFolder
.
get
(
"fileChooserShortcutPanelFolders"
);
public
File
[]
run
()
{
return
(
File
[])
ShellFolder
.
get
(
"fileChooserShortcutPanelFolders"
);
}
});
buttons
=
new
JToggleButton
[
files
.
length
];
buttons
=
new
JToggleButton
[
files
.
length
];
buttonGroup
=
new
ButtonGroup
();
buttonGroup
=
new
ButtonGroup
();
...
...
src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java
浏览文件 @
ae2e7b82
...
@@ -769,16 +769,9 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI {
...
@@ -769,16 +769,9 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI {
fireIntervalRemoved
(
this
,
0
,
oldSize
);
fireIntervalRemoved
(
this
,
0
,
oldSize
);
}
}
File
[]
baseFolders
;
File
[]
baseFolders
=
(
useShellFolder
)
if
(
useShellFolder
)
{
?
(
File
[])
ShellFolder
.
get
(
"fileChooserComboBoxFolders"
)
baseFolders
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
File
[]>()
{
:
fsv
.
getRoots
();
public
File
[]
run
()
{
return
(
File
[])
ShellFolder
.
get
(
"fileChooserComboBoxFolders"
);
}
});
}
else
{
baseFolders
=
fsv
.
getRoots
();
}
directories
.
addAll
(
Arrays
.
asList
(
baseFolders
));
directories
.
addAll
(
Arrays
.
asList
(
baseFolders
));
// Get the canonical (full) path. This has the side
// Get the canonical (full) path. This has the side
...
...
src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
浏览文件 @
ae2e7b82
...
@@ -36,6 +36,7 @@ import java.security.PrivilegedAction;
...
@@ -36,6 +36,7 @@ import java.security.PrivilegedAction;
import
java.util.*
;
import
java.util.*
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.*
;
import
java.util.concurrent.*
;
import
java.util.stream.Stream
;
import
static
sun
.
awt
.
shell
.
Win32ShellFolder2
.*;
import
static
sun
.
awt
.
shell
.
Win32ShellFolder2
.*;
import
sun.awt.OSInfo
;
import
sun.awt.OSInfo
;
...
@@ -251,7 +252,7 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
...
@@ -251,7 +252,7 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
if
(
file
==
null
)
{
if
(
file
==
null
)
{
file
=
getDesktop
();
file
=
getDesktop
();
}
}
return
file
;
return
checkFile
(
file
)
;
}
else
if
(
key
.
equals
(
"roots"
))
{
}
else
if
(
key
.
equals
(
"roots"
))
{
// Should be "History" and "Desktop" ?
// Should be "History" and "Desktop" ?
if
(
roots
==
null
)
{
if
(
roots
==
null
)
{
...
@@ -262,11 +263,11 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
...
@@ -262,11 +263,11 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
roots
=
(
File
[])
super
.
get
(
key
);
roots
=
(
File
[])
super
.
get
(
key
);
}
}
}
}
return
roots
;
return
checkFiles
(
roots
)
;
}
else
if
(
key
.
equals
(
"fileChooserComboBoxFolders"
))
{
}
else
if
(
key
.
equals
(
"fileChooserComboBoxFolders"
))
{
Win32ShellFolder2
desktop
=
getDesktop
();
Win32ShellFolder2
desktop
=
getDesktop
();
if
(
desktop
!=
null
)
{
if
(
desktop
!=
null
&&
checkFile
(
desktop
)
!=
null
)
{
ArrayList
<
File
>
folders
=
new
ArrayList
<
File
>();
ArrayList
<
File
>
folders
=
new
ArrayList
<
File
>();
Win32ShellFolder2
drives
=
getDrives
();
Win32ShellFolder2
drives
=
getDrives
();
...
@@ -295,7 +296,7 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
...
@@ -295,7 +296,7 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
}
}
}
}
}
}
return
folders
.
toArray
(
new
File
[
folders
.
size
()]
);
return
checkFiles
(
folders
);
}
else
{
}
else
{
return
super
.
get
(
key
);
return
super
.
get
(
key
);
}
}
...
@@ -332,7 +333,7 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
...
@@ -332,7 +333,7 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
}
}
}
}
}
}
return
folders
.
toArray
(
new
File
[
folders
.
size
()]
);
return
checkFiles
(
folders
);
}
else
if
(
key
.
startsWith
(
"fileChooserIcon "
))
{
}
else
if
(
key
.
startsWith
(
"fileChooserIcon "
))
{
String
name
=
key
.
substring
(
key
.
indexOf
(
" "
)
+
1
);
String
name
=
key
.
substring
(
key
.
indexOf
(
" "
)
+
1
);
...
@@ -378,6 +379,41 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
...
@@ -378,6 +379,41 @@ public class Win32ShellFolderManager2 extends ShellFolderManager {
return
null
;
return
null
;
}
}
private
File
checkFile
(
File
file
)
{
SecurityManager
sm
=
System
.
getSecurityManager
();
return
(
sm
==
null
||
file
==
null
)
?
file
:
checkFile
(
file
,
sm
);
}
private
File
checkFile
(
File
file
,
SecurityManager
sm
)
{
try
{
sm
.
checkRead
(
file
.
getPath
());
return
file
;
}
catch
(
SecurityException
se
)
{
return
null
;
}
}
private
File
[]
checkFiles
(
File
[]
files
)
{
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
==
null
||
files
==
null
||
files
.
length
==
0
)
{
return
files
;
}
return
checkFiles
(
Arrays
.
stream
(
files
),
sm
);
}
private
File
[]
checkFiles
(
List
<
File
>
files
)
{
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
==
null
||
files
.
isEmpty
())
{
return
files
.
toArray
(
new
File
[
files
.
size
()]);
}
return
checkFiles
(
files
.
stream
(),
sm
);
}
private
File
[]
checkFiles
(
Stream
<
File
>
filesStream
,
SecurityManager
sm
)
{
return
filesStream
.
filter
((
file
)
->
checkFile
(
file
,
sm
)
!=
null
)
.
toArray
(
File
[]::
new
);
}
/**
/**
* Does <code>dir</code> represent a "computer" such as a node on the network, or
* Does <code>dir</code> represent a "computer" such as a node on the network, or
* "My Computer" on the desktop.
* "My Computer" on the desktop.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录