本文整理汇总了Java中sun.swing.FilePane类的典型用法代码示例。如果您正苦于以下问题:Java FilePane类的具体用法?Java FilePane怎么用?Java FilePane使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FilePane类属于sun.swing包,在下文中一共展示了FilePane类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateUI
import sun.swing.FilePane; //导入依赖的package包/类
public void updateUI(){
LookAndFeel old = UIManager.getLookAndFeel();
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (Throwable ex) {
old = null;
}
super.updateUI();
if(old != null){
FilePane filePane = findFilePane(this);
filePane.setViewType(FilePane.VIEWTYPE_DETAILS);
filePane.setViewType(FilePane.VIEWTYPE_LIST);
Color background = UIManager.getColor("Label.background");
setBackground(background);
setOpaque(true);
try {
UIManager.setLookAndFeel(old);
}
catch (UnsupportedLookAndFeelException ignored) {} // shouldn't get here
}
}
示例2: findFilePane
import sun.swing.FilePane; //导入依赖的package包/类
private static FilePane findFilePane(Container parent){
for(Component comp: parent.getComponents()){
if(FilePane.class.isInstance(comp)){
return (FilePane)comp;
}
if(comp instanceof Container){
Container cont = (Container)comp;
if(cont.getComponentCount() > 0){
FilePane found = findFilePane(cont);
if (found != null) {
return found;
}
}
}
}
return null;
}
示例3: initViewType
import sun.swing.FilePane; //导入依赖的package包/类
private void initViewType() {
FilePane filePane = findFilePane(this);
if(filePane != null) {
int viewType = snapPreferences.getInt(PREFERENCES_VIEW_TYPE, FilePane.VIEWTYPE_LIST);
filePane.setViewType(viewType);
}
}
示例4: findFilePane
import sun.swing.FilePane; //导入依赖的package包/类
private FilePane findFilePane(Container root) {
Component[] components = root.getComponents();
for (Component component : components) {
if (component instanceof FilePane) {
return (FilePane) component;
}
if(component instanceof Container) {
FilePane filePane = findFilePane((Container) component);
if (filePane != null) {
return filePane;
}
}
}
return null;
}
示例5: windowClosed
import sun.swing.FilePane; //导入依赖的package包/类
@Override
public void windowClosed(WindowEvent e) {
FilePane filePane = findFilePane(SnapFileChooser.this);
if (filePane != null) {
snapPreferences.putInt(PREFERENCES_VIEW_TYPE, filePane.getViewType());
flushPreferences();
}
}
示例6: changeDirectory
import sun.swing.FilePane; //导入依赖的package包/类
private void changeDirectory(File dir) {
JFileChooser fc = getFileChooser();
// Traverse shortcuts on Windows
if (null != dir && FilePane.usesShellFolder(fc)) {
try {
ShellFolder shellFolder = ShellFolder.getShellFolder(dir);
if (shellFolder.isLink()) {
File linkedTo = shellFolder.getLinkLocation();
// If linkedTo is null we try to use dir
if (linkedTo != null) {
if (fc.isTraversable(linkedTo)) {
dir = linkedTo;
} else {
return;
}
} else {
dir = shellFolder;
}
}
} catch (FileNotFoundException ex) {
return;
}
}
fc.setCurrentDirectory(dir);
if (fc.getFileSelectionMode() == JFileChooser.FILES_AND_DIRECTORIES
&& fc.getFileSystemView().isFileSystem(dir)) {
setFileName(dir.getAbsolutePath());
}
}
示例7: NewFolderAction
import sun.swing.FilePane; //导入依赖的package包/类
protected NewFolderAction() {
super(FilePane.ACTION_NEW_FOLDER);
}
示例8: RenameFileAction
import sun.swing.FilePane; //导入依赖的package包/类
protected RenameFileAction() {
super(FilePane.ACTION_EDIT_FILE_NAME);
}
示例9: ApproveSelectionAction
import sun.swing.FilePane; //导入依赖的package包/类
protected ApproveSelectionAction() {
super(FilePane.ACTION_APPROVE_SELECTION);
}