/** * @deprecated */ public BuFileChooser(File _file) { this(); setCurrentDirectory(_file); }
private String popFileChooser() { final BuFileChooser chooser = new CtuluFileChooser(false); if (filtre_ != null) { chooser.setFileFilter(filtre_); } if (dirOpen_ == null) { dirOpen_ = System.getProperty("user.dir") + File.separator + "exemples"; } if (dirOpen_ != null) { chooser.setCurrentDirectory(new File(dirOpen_)); } final int returnVal = chooser.showOpenDialog(this); dirOpen_ = chooser.getCurrentDirectory().getAbsolutePath(); String filename = null; if (returnVal == JFileChooser.APPROVE_OPTION) { filename = chooser.getSelectedFile().getAbsolutePath(); } return filename; } }
public void actionPerformed(final ActionEvent _ae) { final BuFileChooser bf = new CtuluFileChooser(false); if (iconURL_ == null) { bf.setCurrentDirectory(CtuluFavoriteFiles.getLastDir()); } else { bf.setCurrentDirectory(FuLib.getParentFile(new File(iconURL_))); } bf.setDialogTitle((fudaaExec_ == null ? CtuluLibString.EMPTY_STRING : fudaaExec_.getViewedName()) + s + BuResource.BU.getString("Icne")); bf.setMultiSelectionEnabled(false); final int r = bf.showOpenDialog(FudaaExecPanel.this); if (r == JFileChooser.APPROVE_OPTION) { setIconUrl(bf.getSelectedFile().getAbsolutePath()); } } });
bfc_.setCurrentDirectory(CtuluLibFile.getAbsolutePath(baseDir_, value_).getParentFile());
private String getDirectory(String _default) { String r=FuLib.expandedPath(_default); // System.err.println("### FD begin"); BuFileChooser chooser=new BuFileChooser(); chooser.setDialogTitle(getS("Repertoire")); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setFileHidingEnabled(true); chooser.setMultiSelectionEnabled(false); chooser.resetChoosableFileFilters(); File f=new File(r); if(f.exists()) chooser.setCurrentDirectory(f); int returnVal=chooser.showDialog(this,getS("Slectionner")); // System.err.println("### FD end"); if(returnVal == JFileChooser.APPROVE_OPTION) { f=chooser.getSelectedFile(); // System.err.println("### f="+f); if(f!=null) r=f.getPath(); } return FuLib.reducedPath(r); } }
private String getDirectory(String _default) { String r=FuLib.expandedPath(_default); // System.err.println("### FD begin"); BuFileChooser chooser=new BuFileChooser(); chooser.setDialogTitle(getS("Repertoire")); chooser.setFileSelectionMode(BuFileChooser.DIRECTORIES_ONLY); chooser.setFileHidingEnabled(true); chooser.setMultiSelectionEnabled(false); chooser.resetChoosableFileFilters(); File f=new File(r); if(f.exists()) chooser.setCurrentDirectory(f); int returnVal=chooser.showDialog(this,getS("Slectionner")); // System.err.println("### FD end"); if(returnVal == BuFileChooser.APPROVE_OPTION) { f=chooser.getSelectedFile(); // System.err.println("### f="+f); if(f!=null) r=f.getPath(); } return FuLib.reducedPath(r); } }
if (openDirectory_ != null) chooser.setCurrentDirectory(openDirectory_);
if (saveDirectory_ != null) chooser.setCurrentDirectory(saveDirectory_);