Package javax.swing.filechooser

Examples of javax.swing.filechooser.FileFilter


      if (returnVal == JFileChooser.APPROVE_OPTION) {
  Instances inst = new Instances(m_Instances);
  inst.setClassIndex(m_AttVisualizePanel.getColoringIndex());
  saveInstancesToFile(m_FileChooser.getSaver(), inst);
      }
      FileFilter temp = m_FileChooser.getFileFilter();
      m_FileChooser.setAcceptAllFileFilterUsed(true);
      m_FileChooser.setFileFilter(temp);
    }
    else {
      JOptionPane.showMessageDialog(this,
View Full Code Here


  /** Sets up dialog for saving instances in a file */ 
  public void setUpFile() {
    removeAll();
   
    m_fileChooser.setFileFilter(new FileFilter() {
      public boolean accept(File f) {
        return f.isDirectory();
      }
      public String getDescription() {
        return "Directory";
View Full Code Here

            String baseuri = StaticContext.SYSTEM_BASE_URI;
            String dirpath = baseuri.substring(baseuri.indexOf('/') + 1, baseuri.lastIndexOf('/'));
            fc = new JFileChooser(dirpath);
            // file chooser
            fc.addChoosableFileFilter(new FileFilter() {
                public boolean accept(File f) {
                    if(f.getName().endsWith(".xq")) {
                        fc.setCurrentDirectory(f.getParentFile());
                        return true;
                    } else {
View Full Code Here

    }

    protected void openClass()
    {
        JFileChooser chooser = new JFileChooser();
        chooser.setFileFilter(new FileFilter() {

            public boolean accept(File pathname)
            {
                return pathname.getName().endsWith(".class") || pathname.isDirectory();
            }
View Full Code Here

     * Query the user for a shape file, and add the contents to the region list
     * or line list if a valid file is selected.
     */
    public void addShapeFileFromUser() {
        String shpFileName = FileUtils.getFilePathToOpenFromUser("Pick Shape File",
                new FileFilter() {

                    public boolean accept(File f) {
                        return f.isDirectory() || f.getName().endsWith("shp");
                    }

View Full Code Here

    }
   
    int retValue = fileChooser.showSaveDialog(this);
    if (retValue == JFileChooser.APPROVE_OPTION)
    {
      FileFilter fileFilter = fileChooser.getFileFilter();
      File file = fileChooser.getSelectedFile();
     
      lastFolder = file.getParentFile();

      JRSaveContributor contributor = null;
View Full Code Here

    if(JSynoptic.gui!=null){
      File currentDirectory = CurrentPathProvider.currentPathProvider.getCurrentPath();
      printFileChooser = new JFileChooser(currentDirectory);
     
      Iterator it=formatsMap.keySet().iterator();
      FileFilter preferredFilter=null;
      while(it.hasNext()){
        String v=(String)it.next();
        FileFilter ff=new ImageWriterFileFilter(v);
        if(v.equals("png")){
          preferredFilter=ff;
        }
        printFileChooser.addChoosableFileFilter(ff);
      }
View Full Code Here

    String format;
    File f;
   
    if(JSynoptic.gui!=null){
      printFileChooser.setDialogTitle(d.getName());
      FileFilter ff=printFileChooser.getFileFilter();
      if(ff==null){
        return;
      }
      String defaultExt="."+((ImageWriterFileFilter)printFileChooser.getFileFilter()).suffix;
      f=new File(printFileChooser.getCurrentDirectory(),d.getName()+defaultExt);
View Full Code Here

    String format;
    File f;
   
    if(JSynoptic.gui!=null){
      printFileChooser.setDialogTitle(imageName);
      FileFilter ff=printFileChooser.getFileFilter();
      if(ff==null){
        return;
      }
      String defaultExt="."+((ImageWriterFileFilter)printFileChooser.getFileFilter()).suffix;
      f=new File(printFileChooser.getCurrentDirectory(),imageName+defaultExt);
View Full Code Here

    if(chooser==null||filters==null
        ||chooser.showOpenDialog(null)!=JFileChooser.APPROVE_OPTION){
      return false;
    }
    File f=chooser.getSelectedFile();
    FileFilter ff=chooser.getFileFilter();
    if(ff==aggregateFilter){
      ff=aggregateFilter.getFilterForFile(null, f);
    }
    String ext=(String)filters.get(ff);
    if(ext==null){
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.