Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
8325c78b
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看板
提交
8325c78b
编写于
11月 26, 2008
作者:
R
rupashka
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6776856: Code with useShellFolder field shuold be simplify
Reviewed-by: peterz
上级
10bec5ff
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
9 addition
and
60 deletion
+9
-60
src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java
...com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java
+3
-13
src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java
...re/classes/javax/swing/plaf/metal/MetalFileChooserUI.java
+2
-22
src/share/classes/sun/swing/FilePane.java
src/share/classes/sun/swing/FilePane.java
+2
-3
src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java
.../classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java
+2
-22
未找到文件。
src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java
浏览文件 @
8325c78b
...
@@ -70,7 +70,6 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
...
@@ -70,7 +70,6 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
private
JTextField
filenameTextField
;
private
JTextField
filenameTextField
;
private
FilePane
filePane
;
private
FilePane
filePane
;
private
WindowsPlacesBar
placesBar
;
private
WindowsPlacesBar
placesBar
;
private
boolean
useShellFolder
;
private
JButton
approveButton
;
private
JButton
approveButton
;
private
JButton
cancelButton
;
private
JButton
cancelButton
;
...
@@ -210,10 +209,6 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
...
@@ -210,10 +209,6 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
public
ListSelectionListener
createListSelectionListener
()
{
public
ListSelectionListener
createListSelectionListener
()
{
return
WindowsFileChooserUI
.
this
.
createListSelectionListener
(
getFileChooser
());
return
WindowsFileChooserUI
.
this
.
createListSelectionListener
(
getFileChooser
());
}
}
public
boolean
usesShellFolder
()
{
return
useShellFolder
;
}
}
}
public
void
installComponents
(
JFileChooser
fc
)
{
public
void
installComponents
(
JFileChooser
fc
)
{
...
@@ -625,15 +620,8 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
...
@@ -625,15 +620,8 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
// Decide whether to use the ShellFolder class to populate shortcut
// Decide whether to use the ShellFolder class to populate shortcut
// panel and combobox.
// panel and combobox.
JFileChooser
fc
=
getFileChooser
();
JFileChooser
fc
=
getFileChooser
();
Boolean
prop
=
(
Boolean
)
fc
.
getClientProperty
(
"FileChooser.useShellFolder"
);
if
(
prop
!=
null
)
{
useShellFolder
=
prop
.
booleanValue
();
}
else
{
useShellFolder
=
fc
.
getFileSystemView
().
equals
(
FileSystemView
.
getFileSystemView
());
}
if
(
OS_VERSION
.
compareTo
(
OSInfo
.
WINDOWS_ME
)
>=
0
)
{
if
(
OS_VERSION
.
compareTo
(
OSInfo
.
WINDOWS_ME
)
>=
0
)
{
if
(
useShellFolder
)
{
if
(
FilePane
.
usesShellFolder
(
fc
)
)
{
if
(
placesBar
==
null
&&
!
UIManager
.
getBoolean
(
"FileChooser.noPlacesBar"
))
{
if
(
placesBar
==
null
&&
!
UIManager
.
getBoolean
(
"FileChooser.noPlacesBar"
))
{
placesBar
=
new
WindowsPlacesBar
(
fc
,
XPStyle
.
getXP
()
!=
null
);
placesBar
=
new
WindowsPlacesBar
(
fc
,
XPStyle
.
getXP
()
!=
null
);
fc
.
add
(
placesBar
,
BorderLayout
.
BEFORE_LINE_BEGINS
);
fc
.
add
(
placesBar
,
BorderLayout
.
BEFORE_LINE_BEGINS
);
...
@@ -1149,6 +1137,8 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
...
@@ -1149,6 +1137,8 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
return
;
return
;
}
}
boolean
useShellFolder
=
FilePane
.
usesShellFolder
(
chooser
);
directories
.
clear
();
directories
.
clear
();
File
[]
baseFolders
;
File
[]
baseFolders
;
...
...
src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java
浏览文件 @
8325c78b
...
@@ -68,8 +68,6 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
...
@@ -68,8 +68,6 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
private
JToggleButton
listViewButton
;
private
JToggleButton
listViewButton
;
private
JToggleButton
detailsViewButton
;
private
JToggleButton
detailsViewButton
;
private
boolean
useShellFolder
;
private
JButton
approveButton
;
private
JButton
approveButton
;
private
JButton
cancelButton
;
private
JButton
cancelButton
;
...
@@ -204,10 +202,6 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
...
@@ -204,10 +202,6 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
public
ListSelectionListener
createListSelectionListener
()
{
public
ListSelectionListener
createListSelectionListener
()
{
return
MetalFileChooserUI
.
this
.
createListSelectionListener
(
getFileChooser
());
return
MetalFileChooserUI
.
this
.
createListSelectionListener
(
getFileChooser
());
}
}
public
boolean
usesShellFolder
()
{
return
useShellFolder
;
}
}
}
public
void
installComponents
(
JFileChooser
fc
)
{
public
void
installComponents
(
JFileChooser
fc
)
{
...
@@ -219,8 +213,6 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
...
@@ -219,8 +213,6 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
filePane
=
new
FilePane
(
new
MetalFileChooserUIAccessor
());
filePane
=
new
FilePane
(
new
MetalFileChooserUIAccessor
());
fc
.
addPropertyChangeListener
(
filePane
);
fc
.
addPropertyChangeListener
(
filePane
);
updateUseShellFolder
();
// ********************************* //
// ********************************* //
// **** Construct the top panel **** //
// **** Construct the top panel **** //
// ********************************* //
// ********************************* //
...
@@ -448,19 +440,6 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
...
@@ -448,19 +440,6 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
groupLabels
(
new
AlignedLabel
[]
{
fileNameLabel
,
filesOfTypeLabel
});
groupLabels
(
new
AlignedLabel
[]
{
fileNameLabel
,
filesOfTypeLabel
});
}
}
private
void
updateUseShellFolder
()
{
// Decide whether to use the ShellFolder class to populate shortcut
// panel and combobox.
JFileChooser
fc
=
getFileChooser
();
Boolean
prop
=
(
Boolean
)
fc
.
getClientProperty
(
"FileChooser.useShellFolder"
);
if
(
prop
!=
null
)
{
useShellFolder
=
prop
.
booleanValue
();
}
else
{
useShellFolder
=
fc
.
getFileSystemView
().
equals
(
FileSystemView
.
getFileSystemView
());
}
}
protected
JPanel
getButtonPanel
()
{
protected
JPanel
getButtonPanel
()
{
if
(
buttonPanel
==
null
)
{
if
(
buttonPanel
==
null
)
{
buttonPanel
=
new
JPanel
();
buttonPanel
=
new
JPanel
();
...
@@ -786,7 +765,6 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
...
@@ -786,7 +765,6 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
cc
.
applyComponentOrientation
(
o
);
cc
.
applyComponentOrientation
(
o
);
}
}
}
else
if
(
s
==
"FileChooser.useShellFolder"
)
{
}
else
if
(
s
==
"FileChooser.useShellFolder"
)
{
updateUseShellFolder
();
doDirectoryChanged
(
e
);
doDirectoryChanged
(
e
);
}
else
if
(
s
.
equals
(
"ancestor"
))
{
}
else
if
(
s
.
equals
(
"ancestor"
))
{
if
(
e
.
getOldValue
()
==
null
&&
e
.
getNewValue
()
!=
null
)
{
if
(
e
.
getOldValue
()
==
null
&&
e
.
getNewValue
()
!=
null
)
{
...
@@ -953,6 +931,8 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
...
@@ -953,6 +931,8 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
return
;
return
;
}
}
boolean
useShellFolder
=
FilePane
.
usesShellFolder
(
chooser
);
directories
.
clear
();
directories
.
clear
();
File
[]
baseFolders
;
File
[]
baseFolders
;
...
...
src/share/classes/sun/swing/FilePane.java
浏览文件 @
8325c78b
...
@@ -689,7 +689,7 @@ public class FilePane extends JPanel implements PropertyChangeListener {
...
@@ -689,7 +689,7 @@ public class FilePane extends JPanel implements PropertyChangeListener {
void
updateColumnInfo
()
{
void
updateColumnInfo
()
{
File
dir
=
chooser
.
getCurrentDirectory
();
File
dir
=
chooser
.
getCurrentDirectory
();
if
(
dir
!=
null
&&
fileChooserUIAccessor
.
usesShellFolder
(
))
{
if
(
dir
!=
null
&&
usesShellFolder
(
chooser
))
{
try
{
try
{
dir
=
ShellFolder
.
getShellFolder
(
dir
);
dir
=
ShellFolder
.
getShellFolder
(
dir
);
}
catch
(
FileNotFoundException
e
)
{
}
catch
(
FileNotFoundException
e
)
{
...
@@ -1947,7 +1947,7 @@ public class FilePane extends JPanel implements PropertyChangeListener {
...
@@ -1947,7 +1947,7 @@ public class FilePane extends JPanel implements PropertyChangeListener {
if
(
f
instanceof
ShellFolder
)
{
if
(
f
instanceof
ShellFolder
)
{
return
((
ShellFolder
)
f
).
isFileSystem
();
return
((
ShellFolder
)
f
).
isFileSystem
();
}
else
{
}
else
{
if
(
fileChooserUIAccessor
.
usesShellFolder
(
))
{
if
(
usesShellFolder
(
getFileChooser
()
))
{
try
{
try
{
return
ShellFolder
.
getShellFolder
(
f
).
isFileSystem
();
return
ShellFolder
.
getShellFolder
(
f
).
isFileSystem
();
}
catch
(
FileNotFoundException
ex
)
{
}
catch
(
FileNotFoundException
ex
)
{
...
@@ -1985,6 +1985,5 @@ public class FilePane extends JPanel implements PropertyChangeListener {
...
@@ -1985,6 +1985,5 @@ public class FilePane extends JPanel implements PropertyChangeListener {
public
Action
getNewFolderAction
();
public
Action
getNewFolderAction
();
public
MouseListener
createDoubleClickListener
(
JList
list
);
public
MouseListener
createDoubleClickListener
(
JList
list
);
public
ListSelectionListener
createListSelectionListener
();
public
ListSelectionListener
createListSelectionListener
();
public
boolean
usesShellFolder
();
}
}
}
}
src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java
浏览文件 @
8325c78b
...
@@ -71,8 +71,6 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI {
...
@@ -71,8 +71,6 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI {
private
JToggleButton
listViewButton
;
private
JToggleButton
listViewButton
;
private
JToggleButton
detailsViewButton
;
private
JToggleButton
detailsViewButton
;
private
boolean
useShellFolder
;
private
boolean
readOnly
;
private
boolean
readOnly
;
private
JPanel
buttonPanel
;
private
JPanel
buttonPanel
;
...
@@ -185,10 +183,6 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI {
...
@@ -185,10 +183,6 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI {
public
ListSelectionListener
createListSelectionListener
()
{
public
ListSelectionListener
createListSelectionListener
()
{
return
SynthFileChooserUIImpl
.
this
.
createListSelectionListener
(
getFileChooser
());
return
SynthFileChooserUIImpl
.
this
.
createListSelectionListener
(
getFileChooser
());
}
}
public
boolean
usesShellFolder
()
{
return
useShellFolder
;
}
}
}
protected
void
installDefaults
(
JFileChooser
fc
)
{
protected
void
installDefaults
(
JFileChooser
fc
)
{
...
@@ -201,8 +195,6 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI {
...
@@ -201,8 +195,6 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI {
SynthContext
context
=
getContext
(
fc
,
ENABLED
);
SynthContext
context
=
getContext
(
fc
,
ENABLED
);
updateUseShellFolder
();
fc
.
setLayout
(
new
BorderLayout
(
0
,
11
));
fc
.
setLayout
(
new
BorderLayout
(
0
,
11
));
// ********************************* //
// ********************************* //
...
@@ -432,20 +424,6 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI {
...
@@ -432,20 +424,6 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI {
super
.
uninstallListeners
(
fc
);
super
.
uninstallListeners
(
fc
);
}
}
private
void
updateUseShellFolder
()
{
// Decide whether to use the ShellFolder class to populate shortcut
// panel and combobox.
JFileChooser
fc
=
getFileChooser
();
Boolean
prop
=
(
Boolean
)
fc
.
getClientProperty
(
"FileChooser.useShellFolder"
);
if
(
prop
!=
null
)
{
useShellFolder
=
prop
.
booleanValue
();
}
else
{
useShellFolder
=
fc
.
getFileSystemView
().
equals
(
FileSystemView
.
getFileSystemView
());
}
}
private
String
fileNameString
(
File
file
)
{
private
String
fileNameString
(
File
file
)
{
if
(
file
==
null
)
{
if
(
file
==
null
)
{
return
null
;
return
null
;
...
@@ -761,6 +739,8 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI {
...
@@ -761,6 +739,8 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI {
return
;
return
;
}
}
boolean
useShellFolder
=
FilePane
.
usesShellFolder
(
chooser
);
int
oldSize
=
directories
.
size
();
int
oldSize
=
directories
.
size
();
directories
.
clear
();
directories
.
clear
();
if
(
oldSize
>
0
)
{
if
(
oldSize
>
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录