本文整理了Java中javax.swing.JFileChooser.setFileSystemView()
方法的一些代码示例,展示了JFileChooser.setFileSystemView()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFileChooser.setFileSystemView()
方法的具体详情如下:
包路径:javax.swing.JFileChooser
类名称:JFileChooser
方法名:setFileSystemView
暂无
代码示例来源:origin: de.schlichtherle.truezip/truezip-file
/**
* {@inheritDoc}
* <p>
* @throws ClassCastException if {@code fileSystemView} is not an
* instance of {@link TFileSystemView}.
*/
@Override
public void setFileSystemView(FileSystemView fileSystemView) {
if (null == fileSystemView)
throw new NullPointerException();
super.setFileSystemView((TFileSystemView) fileSystemView);
}
代码示例来源:origin: de.schlichtherle.truezip/truezip-file
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException {
in.defaultReadObject();
super.setFileSystemView(new TFileSystemView());
}
代码示例来源:origin: igniterealtime/Spark
private void pickFile(String title, JTextField field) {
if (fc == null) {
fc = new JFileChooser();
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
if (Spark.isWindows()) {
fc.setFileSystemView(new WindowsFileSystemView());
}
}
fc.setDialogTitle(title);
int returnVal = fc.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile();
field.setText(file.getAbsolutePath());
}
}
代码示例来源:origin: igniterealtime/Spark
private void pickFile(String title, JTextField field) {
if (fc == null) {
fc = new JFileChooser();
if (Spark.isWindows()) {
fc.setFileSystemView(new WindowsFileSystemView());
}
}
fc.setDialogTitle(title);
int returnVal = fc.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile();
try {
field.setText(file.getCanonicalPath());
}
catch (IOException e) {
Log.error(e);
}
}
else {
}
}
代码示例来源:origin: igniterealtime/Spark
/**
* Returns a {@link JFileChooser} starting at the DownloadDirectory
*
* @return the filechooser
*/
public static JFileChooser getFileChooser() {
if (chooser == null) {
LocalPreferences _localPreferences = SettingsManager.getLocalPreferences();
downloadedDir = new File( _localPreferences.getDownloadDir());
chooser = new JFileChooser(downloadedDir);
if (Spark.isWindows()) {
chooser.setFileSystemView(new WindowsFileSystemView());
}
}
return chooser;
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
/**
* Make sure that a JFileChooser does not traverse symlinks on Unix.
* @param chooser a file chooser
* @param currentDirectory if not null, a file to set as the current directory
* using {@link JFileChooser#setCurrentDirectory} without canonicalizing
* @see <a href="http://www.netbeans.org/issues/show_bug.cgi?id=46459">Issue #46459</a>
* @see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4906607">JRE bug #4906607</a>
* @since org.openide/1 4.42
*/
public static void preventFileChooserSymlinkTraversal(JFileChooser chooser, File currentDirectory) {
if (!(Utilities.isWindows () || (Utilities.getOperatingSystem () == Utilities.OS_OS2))) {
chooser.setCurrentDirectory(wrapFileNoCanonicalize(currentDirectory));
chooser.setFileSystemView(new NonCanonicalizingFileSystemView());
} else {
chooser.setCurrentDirectory(currentDirectory);
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
/**
* Make sure that a JFileChooser does not traverse symlinks on Unix.
* @param chooser a file chooser
* @param currentDirectory if not null, a file to set as the current directory
* using {@link JFileChooser#setCurrentDirectory} without canonicalizing
* @see <a href="http://www.netbeans.org/issues/show_bug.cgi?id=46459">Issue #46459</a>
* @see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4906607">JRE bug #4906607</a>
* @since org.openide/1 4.42
*/
public static void preventFileChooserSymlinkTraversal(JFileChooser chooser, File currentDirectory) {
if (!(Utilities.isWindows () || (Utilities.getOperatingSystem () == Utilities.OS_OS2))) {
chooser.setCurrentDirectory(wrapFileNoCanonicalize(currentDirectory));
chooser.setFileSystemView(new NonCanonicalizingFileSystemView());
} else {
chooser.setCurrentDirectory(currentDirectory);
}
}
代码示例来源:origin: AliView/AliView
fileChooser.setFileSystemView(FileSystemView.getFileSystemView());
代码示例来源:origin: igniterealtime/Spark
if ( Spark.isWindows() )
fc.setFileSystemView( new WindowsFileSystemView() );
代码示例来源:origin: eu.mihosoft.vrl/vrl
fc.setFileSystemView(new RestrictedFileSystemView(directory));
代码示例来源:origin: eu.mihosoft.vrl/vrl
fc.setFileSystemView(new RestrictedFileSystemView(directory));
代码示例来源:origin: eu.mihosoft.vrl/vrl
fc.setFileSystemView(new RestrictedFileSystemView(directory));
代码示例来源:origin: eu.mihosoft.vrl/vrl
fc.setFileSystemView(new RestrictedFileSystemView(directory));
代码示例来源:origin: eu.mihosoft.vrl/vrl
fc.setFileSystemView(new RestrictedFileSystemView(directory));
代码示例来源:origin: eu.mihosoft.vrl/vrl
fc.setFileSystemView(new RestrictedFileSystemView(directory));
restrictNavigation(fc, directory);
代码示例来源:origin: eu.mihosoft.vrl/vrl
fc.setFileSystemView(new RestrictedFileSystemView(directory));
代码示例来源:origin: eu.mihosoft.vrl/vrl
fc.setFileSystemView(new RestrictedFileSystemView(directory));
代码示例来源:origin: eu.mihosoft.vrl/vrl
fc.setFileSystemView(new RestrictedFileSystemView(directory));
内容来源于网络,如有侵权,请联系作者删除!