/** * Verifie que le chemin saisi contient bien un jar sinon demande correction a l'utilisateur. * @param pathPresumePourJar * @return */ public String verifPathForJarIsCorrect(String pathPresumePourJar){ File test=new File(pathPresumePourJar); if(test==null || !test.exists() || test.isDirectory()){ ui_.error(FudaaResource.FUDAA.getString("Erreur, Il n'y a pas de fichier jar de document l'adresse suivante: "+pathPresumePourJar)); BuFileChooser chooser=new BuFileChooser(); int rep=chooser.showOpenDialog(ui_.getParentComponent()); if(rep==BuFileChooser.APPROVE_OPTION){ pathPresumePourJar=chooser.getSelectedFile().getAbsolutePath(); } } return pathPresumePourJar; }
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; } }
/** * Methode qui sauvegarde le fichier en cours de lecture sur l'emplacement voulu. */ public void sauvegarderFichierPdf(){ JarEntry fichierJar=getCurrentJarEntry(); if(fichierJar==null) return; File fichierDest=null; BuFileChooser chooser=new BuFileChooser(); int rep=chooser.showOpenDialog(ui_.getParentComponent()); if(rep==BuFileChooser.APPROVE_OPTION){ fichierDest=chooser.getSelectedFile(); } if(fichierDest!=null){ generateFileFromJar(fichierJar, fichierDest); } }
final int returnVal = chooser.showOpenDialog(parent); String filename = null; if (returnVal == JFileChooser.APPROVE_OPTION) {
public synchronized void ouvrir() { Frame parent = null; if (appli_ instanceof Frame) { parent = (Frame) appli_; } final BuFileChooser chooser = new CtuluFileChooser(true); 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(parent); String filename = null; if (returnVal == JFileChooser.APPROVE_OPTION) { filename = chooser.getSelectedFile().getAbsolutePath(); if ((filename != null)) { // dirOpen_= new File(filename).getAbsolutePath(); // dirOpen_= // dirOpen_.substring(0, dirOpen_.lastIndexOf(File.separatorChar)); actualiseMenu(IN_DISABLE, OUT_ENABLE); ouvre(filename); fireStatusChanged(new FudaaProjetEvent(this, FudaaProjetEvent.PROJECT_OPENED)); } } }
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()); final int r = bfc_.showOpenDialog(CtuluCellFileEditor.this); if (r == JFileChooser.APPROVE_OPTION) { if (onlyName_) {
int returnVal = chooser.showOpenDialog((BuApplication) getApp());