public BuFileChooser() { super(); setDialogTitle(BuResource.BU.getString("Fichier")); Dimension e=getToolkit().getScreenSize(); setPreferredSize(new Dimension(Math.min(480,e.width-60), Math.max(480,e.height-360))); }
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()); } } });
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); } }