Package javax.swing.filechooser

Examples of javax.swing.filechooser.FileFilter


    public SettingsDialog(Ide ide) throws HeadlessException {
        super("Settings");
        this.ide = ide;
        this.setResizable(false);

        pathChooser.setFileFilter( new FileFilter() {
            public boolean accept(File f) {
                return f.exists() && f.isDirectory();
            }
            public String getDescription() {
                return "All directories";
View Full Code Here


    super(originalDatastore, mutableDatastoreCatalog, windowContext, userPreferences);
  }

  @Override
  protected void setFileFilters(FilenameTextField filenameField) {
    FileFilter combinedFilter = FileFilters.combined("Any Excel Spreadsheet (.xls, .xlsx)", FileFilters.XLS,
        FileFilters.XLSX);
    filenameField.addChoosableFileFilter(combinedFilter);
    filenameField.addChoosableFileFilter(FileFilters.XLS);
    filenameField.addChoosableFileFilter(FileFilters.XLSX);
    filenameField.addChoosableFileFilter(FileFilters.ALL);
View Full Code Here

    return IconUtils.ACCESS_IMAGEPATH;
  }

  @Override
  protected void setFileFilters(FilenameTextField filenameField) {
    FileFilter combinedFilter = FileFilters.combined("Any Access database (.mdb, .accdb)", FileFilters.MDB,
        FileFilters.ACCDB);
    filenameField.addChoosableFileFilter(FileFilters.MDB);
    filenameField.addChoosableFileFilter(FileFilters.ACCDB);
    filenameField.addChoosableFileFilter(FileFilters.ALL);
    filenameField.setSelectedFileFilter(combinedFilter);
View Full Code Here

    return IconUtils.CSV_IMAGEPATH;
  }

  @Override
  protected void setFileFilters(final FilenameTextField filenameField) {
    FileFilter combinedFilter = FileFilters.combined("Any raw data file (.csv, .tsv, .dat, .txt)", FileFilters.CSV,
        FileFilters.TSV, FileFilters.DAT, FileFilters.TXT);
    filenameField.addChoosableFileFilter(combinedFilter);
    filenameField.addChoosableFileFilter(FileFilters.CSV);
    filenameField.addChoosableFileFilter(FileFilters.TSV);
    filenameField.addChoosableFileFilter(FileFilters.DAT);
View Full Code Here

    vo.setLargeImageITM01(null);
  }

  public byte[] loadImage() {
    JFileChooser f = new JFileChooser();
    f.setFileFilter(new FileFilter() {

      /**
       * Whether the given file is accepted by this filter.
       */
      public boolean accept(File f) {
View Full Code Here

  }


  void buttonLocalFile_actionPerformed(ActionEvent e) {
    JFileChooser f = new JFileChooser(System.getProperty("user.home"));
    f.setFileFilter(new FileFilter() {

      public boolean accept(File f) {
        if (f.isDirectory() ||
            f.getName().toLowerCase().endsWith(".xls") && XLS.equals(controlFormat.getValue()) ||
            f.getName().toLowerCase().endsWith(".csv") && CSV1.equals(controlFormat.getValue()) ||
View Full Code Here

  public static void main(String[] args) {
    CharasConverter converter = new CharasConverter();
    if (args.length == 0) {
      JFileChooser chooser = new JFileChooser(new File("."));
      FileFilter filter = new FileFilter() {
        @Override
        public boolean accept(File pathname) {
          return pathname != null && (pathname.isDirectory()
              || pathname.getAbsolutePath().toLowerCase()
                .endsWith(".png"));
View Full Code Here

  }


  public byte[] loadFile() {
    JFileChooser f = new JFileChooser();
    f.setFileFilter(new FileFilter() {

      /**
       * Whether the given file is accepted by this filter.
       */
      public boolean accept(File f) {
View Full Code Here

    private void jButtonFromLocalFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonFromLocalFileActionPerformed
        javax.swing.JFileChooser fileChooser = new javax.swing.JFileChooser();
        fileChooser.setMultiSelectionEnabled(true);
        fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        FileFilter filter = new FileFilter() {

            @Override
            public boolean accept(File f) {
                String extension = "";
                EmailFilesFilter[] filters =
                        Lookup.getDefault().lookupAll(EmailFilesFilter.class).toArray(new EmailFilesFilter[0]);
                for (EmailFilesFilter filter : filters) {
                    if (filter.getDisplayName().equals(jComboBoxFileFilters.getSelectedItem().toString())) {
                        extension = filter.getSupportedFileExtension();
                    }
                }
                if (f.isDirectory()) {
                    return true;
                } else if (f.getAbsolutePath().matches(".*" + extension)) {
View Full Code Here

        {
            JIfdData data = m_tableData.getRowData(row);
            File file = new File(data.getFilePath());
            JFileChooser fileChooser = new JFileChooser(bMove ? Main.m_settings.getMoveDirectory() : Main.m_settings.getCopyDirectory());
            fileChooser.setDialogTitle(Main.getString(bMove ? "caption_move" : "caption_copy"));
            FileFilter allFilter = fileChooser.getAcceptAllFileFilter();
            fileChooser.setAcceptAllFileFilterUsed(false);
            JMyFileFilter fileFilter = new JMyFileFilter();
            for (String item : Main.m_settings.m_jpgExtensions)
            {
                fileFilter.addExtension(item);
View Full Code Here

TOP

Related Classes of javax.swing.filechooser.FileFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.