Examples of addChoosableFileFilter()


Examples of javax.swing.JFileChooser.addChoosableFileFilter()

    final JFileChooser chooser = new JFileChooser();
    if (filters != null)
    {
      for (int i = 0; i < filters.length; ++i)
      {
        chooser.addChoosableFileFilter(filters[i]);
      }
    }

    if (accessory != null)
    {
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

      filters.add(format.getFileFilter());
      if (formatName.equals(lastUsedFormat))
        defaultFilter = format.getFileFilter();
    }
    for (FileFilter ff : filters) {
      fc.addChoosableFileFilter(ff);
    }
    fc.setAcceptAllFileFilterUsed(false);
    if (defaultFilter != null)
      fc.setFileFilter(defaultFilter);
    return fc;
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

            filters.add(filter);
            if (format.getFormatName().equals(lastUsedFormat))
                defaultFilter = filter;
        }
        for (ImportFileFilter filter : filters){
            fc.addChoosableFileFilter(filter);
        }

        if (defaultFilter != null)
            fc.setFileFilter(defaultFilter);
        else
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setLocale(this.getLocale());
    fileChooser.updateUI();
    for(int i = 0; i < saveContributors.size(); i++)
    {
      fileChooser.addChoosableFileFilter((JRSaveContributor)saveContributors.get(i));
    }

    if (saveContributors.contains(lastSaveContributor))
    {
      fileChooser.setFileFilter(lastSaveContributor);
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

            return;
        }
        */
        JFileChooser fc = new JFileChooser(myDocumentManager.getWorkingDirectory());
        FileFilter ganttFilter = new GanttXMLFileFilter();
        fc.addChoosableFileFilter(ganttFilter);

        // Remove the possibility to use a file filter for all files
        FileFilter[] filefilters = fc.getChoosableFileFilters();
        for (int i = 0; i < filefilters.length; i++) {
            if (filefilters[i] != ganttFilter) {
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

        // Remove the possibility to use a file filter for all files
        FileFilter[] filefilters = fc.getChoosableFileFilters();
        for (int i = 0; i < filefilters.length; i++) {
            fc.removeChoosableFileFilter(filefilters[i]);
        }
        fc.addChoosableFileFilter(ganttFilter);

        int returnVal = fc.showOpenDialog(myWorkbenchFacade.getMainFrame());
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            final JFileChooser jfc = fc;
            Document document = getDocumentManager().getDocument(
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

        FileFilter[] filefilters = fc.getChoosableFileFilters();
        for (int i = 0; i < filefilters.length; i++) {
            fc.removeChoosableFileFilter(filefilters[i]);
        }

        fc.addChoosableFileFilter(myFileFilter);
        int returnVal = fc.showDialog(myParentComponent, GanttLanguage
                .getInstance().getText("ok"));
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            onFileChosen(fc.getSelectedFile());
        }
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

    /** Show the dialog box */
    public File show() {
        File result = null;
        JFileChooser fc = new JFileChooser(myStartDirectory);
        fc.addChoosableFileFilter(new GanttXMLFileFilter());

        int returnVal = fc.showOpenDialog(null);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            result = fc.getSelectedFile();
        }
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

  }

  private void onSave() {
    if(playlist.size() > 0) {
      JFileChooser fc = new JFileChooser();
      fc.addChoosableFileFilter(new MyFilter());

      int returnVal = fc.showSaveDialog(this);
      if (returnVal == JFileChooser.APPROVE_OPTION) {
        String url = fc.getSelectedFile().getAbsolutePath();
        if(url.endsWith(".m3u"))
View Full Code Here

Examples of javax.swing.JFileChooser.addChoosableFileFilter()

        JFileChooser fc = new JFileChooser(options.getWorkingDir());
        FileFilter[] filefilters = fc.getChoosableFileFilters();
        for (int i = 0; i < filefilters.length; i++) {
            fc.removeChoosableFileFilter(filefilters[i]);
        }
        fc.addChoosableFileFilter(ganFilter);
        fc.addChoosableFileFilter(mppFilter);
        fc.addChoosableFileFilter(txtFilter);
        // fc.addChoosableFileFilter(plannerFilter);

        return fc;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.