本文整理了Java中javax.swing.JFileChooser.getFileSystemView()
方法的一些代码示例,展示了JFileChooser.getFileSystemView()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFileChooser.getFileSystemView()
方法的具体详情如下:
包路径:javax.swing.JFileChooser
类名称:JFileChooser
方法名:getFileSystemView
暂无
代码示例来源:origin: MovingBlocks/Terasology
rawPath = Paths.get(savedGamesPath);
} else {
rawPath = new JFileChooser().getFileSystemView().getDefaultDirectory().toPath();
代码示例来源:origin: org.netbeans.api/org-openide-filesystems
chooser.getFileSystemView()));
代码示例来源:origin: stackoverflow.com
import javax.swing.JFileChooser;
javax.swing.filechooser.FileSystemView;
public class GetMyDocuments {
public static void main(String args[]) {
JFileChooser fr = new JFileChooser();
FileSystemView fw = fr.getFileSystemView();
System.out.println(fw.getDefaultDirectory());
}
}
代码示例来源:origin: de.schlichtherle.truezip/truezip-file
@Override
public TFileSystemView getFileSystemView() {
return (TFileSystemView) super.getFileSystemView();
}
代码示例来源:origin: stackoverflow.com
import javax.swing.JFileChooser;
import javax.swing.filechooser.FileSystemView;
....
JFileChooser fc = new JFileChooser();
FileSystemView fsv = fc.getFileSystemView();
if (fsv.isFloppyDrive(new File("A:"))) // is A: a floppy drive?
代码示例来源:origin: SKCraft/Launcher
private static File getFileChooseDefaultDir() {
JFileChooser chooser = new JFileChooser();
FileSystemView fsv = chooser.getFileSystemView();
return fsv.getDefaultDirectory();
}
代码示例来源:origin: SKCraft/Launcher
private static File getFileChooseDefaultDir() {
JFileChooser chooser = new JFileChooser();
FileSystemView fsv = chooser.getFileSystemView();
return fsv.getDefaultDirectory();
}
代码示例来源:origin: stackoverflow.com
import javax.swing.JFileChooser;
javax.swing.filechooser.FileSystemView;
public class GetMyDocuments {
public static void main(String args[]) {
JFileChooser fr = new JFileChooser();
FileSystemView fw = fr.getFileSystemView();
System.out.println(fw.getDefaultDirectory());
}
}
代码示例来源:origin: SKCraft/SKMCLauncher
private static File getFileChooseDefaultDir() {
JFileChooser chooser = new JFileChooser();
FileSystemView fsv = chooser.getFileSystemView();
return fsv.getDefaultDirectory();
}
代码示例来源:origin: org.gephi/directory-chooser
private File[] getSelectedNodes(TreePath[] paths) {
Vector<File> files = new Vector<>();
for(int i = 0; i < paths.length; i++) {
File file = ((DirectoryNode)paths[i].getLastPathComponent()).getFile();
if(file.isDirectory()
&& fileChooser.isTraversable(file)
&& !fileChooser.getFileSystemView().isFileSystem(file)) {
continue;
}
files.add(file);
}
return files.toArray(new File[files.size()]);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-api-remote-ui
@Override
public Icon getIcon(File f) {
if (f.isDirectory() && // #173958: do not call ProjectManager.isProject now, could block
!f.toString().matches("/[^/]+") && // Unix: /net, /proc, etc. //NOI18N
f.getParentFile() != null) { // do not consider drive roots
synchronized (this) {
Icon icon = knownProjectIcons.get(f);
if (icon != null) {
return icon;
} else if (lookingForIcon == null) {
lookingForIcon = f;
task.schedule(20);
// Only calculate one at a time.
// When the view refreshes, the next unknown icon
// should trigger the task to be reloaded.
}
}
}
return chooser.getFileSystemView().getSystemIcon(f);
}
代码示例来源:origin: com.l2fprod.common/l2fprod-common-directorychooser
public String toString() {
return chooser.getFileSystemView().getSystemDisplayName(
(File)getUserObject());
}
代码示例来源:origin: com.l2fprod.common/l2fprod-common-directorychooser
public boolean canEnqueue() {
return !isLoaded()
&& !chooser.getFileSystemView().isFloppyDrive(getFile())
&& !chooser.getFileSystemView().isFileSystemRoot(getFile());
}
代码示例来源:origin: org.java.net.substance/substance
/**
* Returns the default file icon.
*
* @param f
* File.
* @return File icon.
*/
public Icon getDefaultIcon(File f) {
JFileChooser fileChooser = getFileChooser();
Icon icon = fileChooser.getFileSystemView().getSystemIcon(f);
if (SubstanceCoreUtilities.useThemedDefaultIcon(null)) {
icon = SubstanceCoreUtilities.getThemedIcon(fileChooser, icon);
}
return icon;
}
}
代码示例来源:origin: com.github.insubstantial/substance
/**
* Returns the default file icon.
*
* @param f
* File.
* @return File icon.
*/
public Icon getDefaultIcon(File f) {
JFileChooser fileChooser = getFileChooser();
Icon icon = fileChooser.getFileSystemView().getSystemIcon(f);
if (SubstanceCoreUtilities.useThemedDefaultIcon(null)) {
icon = SubstanceCoreUtilities.getThemedIcon(fileChooser, icon);
}
return icon;
}
}
代码示例来源:origin: com.l2fprod.common/l2fprod-common-directorychooser
public Icon getIcon(File f) {
Icon icon = getCachedIcon(f);
if (icon != null) { return icon; }
if (f != null) {
icon = getFileChooser().getFileSystemView().getSystemIcon(f);
}
if (icon == null) {
icon = super.getIcon(f);
}
cacheIcon(f, icon);
return icon;
}
}
代码示例来源:origin: com.jtattoo/JTattoo
public Icon getIcon(File f) {
Icon icon = getCachedIcon(f);
if (icon != null) {
return icon;
}
if (f != null) {
icon = getFileChooser().getFileSystemView().getSystemIcon(f);
}
if (icon == null) {
icon = super.getIcon(f);
}
cacheIcon(f, icon);
return icon;
}
}
代码示例来源:origin: org.gephi/directory-chooser
private void fireFileSelectionModeChanged(PropertyChangeEvent e) {
clearIconCache();
JFileChooser fc = getFileChooser();
File currentDirectory = fc.getCurrentDirectory();
if (currentDirectory != null
&& fc.isDirectorySelectionEnabled()
&& !fc.isFileSelectionEnabled()
&& fc.getFileSystemView().isFileSystem(currentDirectory)) {
setFileName(currentDirectory.getPath());
} else {
setFileName(null);
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/skinlf
public Icon getIcon(File f) {
Icon icon = getCachedIcon(f);
if (icon != null) { return icon; }
if (OS.isOneDotFourOrMore() && f != null) {
icon = getFileChooser().getFileSystemView().getSystemIcon(f);
}
if (icon == null) {
icon = super.getIcon(f);
}
cacheIcon(f, icon);
return icon;
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/napkinlaf
public Icon getDefaultIcon(File f) {
FileSystemView fsv = getFileChooser().getFileSystemView();
Icon icon;
if (fsv.isFloppyDrive(f)) {
icon = UIManager.getIcon("FileView.floppyDriveIcon");
} else if (fsv.isDrive(f)) {
icon = UIManager.getIcon("FileView.hardDriveIcon");
} else if (fsv.isComputerNode(f)) {
icon = UIManager.getIcon("FileView.computerIcon");
} else if (f.isDirectory()) {
icon = UIManager.getIcon("FileView.directoryIcon");
} else {
icon = fsv.getSystemIcon(f);
if (icon == null) {
icon = UIManager.getIcon("FileView.fileIcon");
}
}
return icon;
}
}
内容来源于网络,如有侵权,请联系作者删除!