package _VisualDVM.Visual.Windows;
import Common.Utils.Utils_;
import Common.Visual.Windows.Dialog.VFileChooser_;
import _VisualDVM.Constants;

import javax.swing.*;
import javax.swing.filechooser.FileFilter;
import java.io.File;
public class ProjectsChooser extends VFileChooser_ {
    public ProjectsChooser(String title) {
        super(title, new FileFilter() {
            @Override
            public boolean accept(File f) {
                return
                        !Utils_.ContainsCyrillic(f.getAbsolutePath()) &&
                                !f.getName().equalsIgnoreCase(Constants.data)
                        ;
            }
            @Override
            public String getDescription() {
                return "Все папки";
            }
        });
        fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    }
}
