javax.swing.JFileChooser.resetChoosableFileFilters()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中javax.swing.JFileChooser.resetChoosableFileFilters()方法的一些代码示例,展示了JFileChooser.resetChoosableFileFilters()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFileChooser.resetChoosableFileFilters()方法的具体详情如下:
包路径:javax.swing.JFileChooser
类名称:JFileChooser
方法名:resetChoosableFileFilters

JFileChooser.resetChoosableFileFilters介绍

暂无

代码示例

代码示例来源:origin: apache/pdfbox

/**
 * Constructor.
 * @param parentUI the main UI (JFrame) on top of which File open/save dialog should open.
 * @param fileFilter file Filter, null is allowed when no filter is applicable.
 */
public FileOpenSaveDialog(Component parentUI, FileFilter fileFilter)
{
  mainUI = parentUI;
  fileChooser.resetChoosableFileFilters();
  fileChooser.setFileFilter(fileFilter);
}

代码示例来源:origin: cmu-phil/tetrad

private static JFileChooser getJFileChooser() {
  JFileChooser chooser = new JFileChooser();
  String sessionSaveLocation =
      Preferences.userRoot().get("fileSaveLocation", "");
  chooser.setCurrentDirectory(new File(sessionSaveLocation));
  chooser.resetChoosableFileFilters();
  chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
  return chooser;
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Resets the list of choosable file filters.
 */
public void resetFileFilters() {
 JFileChooser embeddedEditor = (JFileChooser) m_fileEditor.getCustomEditor();
 embeddedEditor.resetChoosableFileFilters();
}

代码示例来源:origin: cmu-phil/tetrad

private static JFileChooser getJFileChooser() {
  JFileChooser chooser = new JFileChooser();
  String sessionSaveLocation =
      Preferences.userRoot().get("fileSaveLocation", "");
  chooser.setCurrentDirectory(new File(sessionSaveLocation));
  chooser.resetChoosableFileFilters();
  chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
  return chooser;
}

代码示例来源:origin: cmu-phil/tetrad

private static JFileChooser getJFileChooser() {
    JFileChooser chooser = new JFileChooser();
    String sessionSaveLocation
        = Preferences.userRoot().get("fileSaveLocation", "");
    chooser.setCurrentDirectory(new File(sessionSaveLocation));
    chooser.resetChoosableFileFilters();
    chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    return chooser;
  }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Resets the list of choosable file filters.
 */
public void resetFileFilters() {
 JFileChooser embeddedEditor = (JFileChooser) m_fileEditor.getCustomEditor();
 embeddedEditor.resetChoosableFileFilters();
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Resets the list of choosable file filters.
 */
public void resetFileFilters() {
 JFileChooser embeddedEditor = (JFileChooser) m_fileEditor.getCustomEditor();
 embeddedEditor.resetChoosableFileFilters();
}

代码示例来源:origin: cmu-phil/tetrad

private static JFileChooser getJFileChooser() {
    JFileChooser chooser = new JFileChooser();
    String sessionSaveLocation =
        Preferences.userRoot().get("fileSaveLocation", "");
    chooser.setCurrentDirectory(new File(sessionSaveLocation));
    chooser.resetChoosableFileFilters();
    chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    return chooser;
  }
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Resets the list of choosable file filters.
 */
public void resetFileFilters() {
 JFileChooser embeddedEditor = (JFileChooser) m_fileEditor.getCustomEditor();
 embeddedEditor.resetChoosableFileFilters();
}

代码示例来源:origin: cmu-phil/tetrad

private static JFileChooser getJFileChooser() {
  JFileChooser chooser = new JFileChooser();
  String sessionSaveLocation =
      Preferences.userRoot().get("fileSaveLocation", "");
  chooser.setCurrentDirectory(new File(sessionSaveLocation));
  chooser.resetChoosableFileFilters();
  chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
  return chooser;
}

代码示例来源:origin: cpesch/RouteConverter

private void setFormatFileFilters(JFileChooser chooser, List<NavigationFormat> formats, String selectedFormat) {
  chooser.resetChoosableFileFilters();
  FileFilter fileFilter = chooser.getFileFilter();
  for (NavigationFormat format : formats) {
    NavigationFormatFileFilter navigationFormatFileFilter = new NavigationFormatFileFilter(format);
    if (format.getClass().getName().equals(selectedFormat))
      fileFilter = navigationFormatFileFilter;
    chooser.addChoosableFileFilter(navigationFormatFileFilter);
  }
  chooser.setFileFilter(fileFilter);
}

代码示例来源:origin: cmu-phil/tetrad

private static JFileChooser getJFileChooser() {
  JFileChooser chooser = new JFileChooser();
  String sessionSaveLocation = Preferences.userRoot().get(
      "fileSaveLocation", Preferences.userRoot().absolutePath());
  chooser.setCurrentDirectory(new File(sessionSaveLocation));
  chooser.resetChoosableFileFilters();
  chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
  return chooser;
}

代码示例来源:origin: cmu-phil/tetrad

private static JFileChooser getJFileChooser() {
  JFileChooser chooser = new JFileChooser();
  String sessionSaveLocation = Preferences.userRoot().get(
      "fileSaveLocation", Preferences.userRoot().absolutePath());
  chooser.setCurrentDirectory(new File(sessionSaveLocation));
  chooser.resetChoosableFileFilters();
  chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
  return chooser;
}

代码示例来源:origin: net.sf.taverna.t2.ui-impl/configuration-impl

public void actionPerformed(ActionEvent e) {
    System.setProperty("com.apple.macos.use-file-dialog-packages", "false");
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.putClientProperty("JFileChooser.appBundleIsTraversable", "always");
    fileChooser.putClientProperty("JFileChooser.packageIsTraversable", "always");
    
    fileChooser.setDialogTitle("Browse for dot");
    fileChooser.resetChoosableFileFilters();
    fileChooser.setAcceptAllFileFilterUsed(false);
    
    fileChooser.setMultiSelectionEnabled(false);
    
    int returnVal = fileChooser.showOpenDialog(WorkbenchConfigurationPanel.this);
    if (returnVal==JFileChooser.APPROVE_OPTION) {
      dotLocation.setText(fileChooser.getSelectedFile().getAbsolutePath());
    }
  }
});

代码示例来源:origin: cmu-phil/tetrad

private static JFileChooser getJFileChooser() {
  JFileChooser chooser = new JFileChooser();
  String sessionSaveLocation = Preferences.userRoot().get(
      "fileSaveLocation", Preferences.userRoot().absolutePath());
  chooser.setCurrentDirectory(new File(sessionSaveLocation));
  chooser.resetChoosableFileFilters();
  chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
  return chooser;
}

代码示例来源:origin: uk.org.mygrid.taverna.scufl/scufl-workflow

public void actionPerformed(ActionEvent e) {
  Preferences prefs = Preferences
      .userNodeForPackage(OpenNestedWorkflowFromFileAction.class);
  String curDir = prefs.get("currentDir", System
      .getProperty("user.home"));
  fileChooser.setDialogTitle("Open Nested Workflow");
  fileChooser.resetChoosableFileFilters();
  fileChooser.setFileFilter(new ExtensionFileFilter(
      new String[] { "xml" }));
  fileChooser.setCurrentDirectory(new File(curDir));
  int returnVal = fileChooser.showOpenDialog(null);
  if (returnVal == JFileChooser.APPROVE_OPTION) {
    prefs.put("currentDir", fileChooser.getCurrentDirectory()
        .toString());
    File file = fileChooser.getSelectedFile();
    createNestedWorkflow(file.toURI().toString(), (Component) e
        .getSource());
  }
}

代码示例来源:origin: sing-group/GC4S

/**
   * Applies the configuration to {@code fileChooser}.
   * 
   * @param fileChooser a {@code JFileChoose} to configure.
   */
  public void configure(JFileChooser fileChooser) {
    final File selectedFile = fileChooser.getSelectedFile();
    fileChooser.setSelectedFile(null);

    fileChooser.setAcceptAllFileFilterUsed(false);
    fileChooser.setFileSelectionMode(this.selectionMode);

    fileChooser.resetChoosableFileFilters();
    for (FileFilter filter : this.filters) {
      fileChooser.addChoosableFileFilter(filter);
    }
    fileChooser.setAcceptAllFileFilterUsed(this.allowAll);

    fileChooser.setSelectedFile(selectedFile);
  }
}

代码示例来源:origin: sdedit/sdedit

public void removeFileTypes(String... types) {
  for (String type : types) {
    fileTypes.remove(type.toLowerCase());
  }
  if (fileTypes.isEmpty()) {
    fileChooser().resetChoosableFileFilters();
    fileChooser().setFileFilter(fileChooser().getAcceptAllFileFilter());
  }
}

代码示例来源:origin: cmu-phil/tetrad

private JFileChooser getJFileChooser() {
    JFileChooser chooser = new JFileChooser();
    String sessionSaveLocation = Preferences.userRoot().get(
        "fileSaveLocation", Preferences.userRoot().absolutePath());
    chooser.setCurrentDirectory(new File(sessionSaveLocation));
    chooser.resetChoosableFileFilters();

    /*
    for (int i = 0; i < persistenceFormats.length; i++) {
      chooser.addChoosableFileFilter(persistenceFormats[i]);
    }

    chooser.setFileFilter(persistenceFormats[0]);
    */
    chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);

    return chooser;
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-profiler

private JFileChooser getFileChooser() {
  if (fileChooser == null) {
    // File chooser
    fileChooser = new JFileChooser();
    fileChooser.setDialogType(JFileChooser.SAVE_DIALOG);
    fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    fileChooser.setMultiSelectionEnabled(false);
    fileChooser.setDialogTitle(Bundle.ExportAction_ExportDialogTitle());
    fileChooser.setApproveButtonText(Bundle.ExportAction_ExportDialogButton());
  }
  fileChooser.resetChoosableFileFilters();
  setFilters();
  return fileChooser;
}

相关文章

JFileChooser类方法