Examples of JMeterFileFilter


Examples of org.apache.jmeter.gui.JMeterFileFilter

     */
    protected String getRandomFileName() {
        if (this.getXmlPathLoc() != null) {
            File src = new File(this.getXmlPathLoc());
            if (src.isDirectory() && src.list() != null) {
                File [] fileList = src.listFiles(new JMeterFileFilter(new String[] { ".xml" }, false));
                File one = fileList[RANDOM.nextInt(fileList.length)];
                // return the absolutePath of the file
                return one.getAbsolutePath();
            }
            return getXmlFile();
View Full Code Here

Examples of org.apache.jmeter.gui.JMeterFileFilter

    public File getRandomFile(String basedir, String[] extensions) {
        File input = null;
        if (basedir != null) {
            File src = new File(basedir);
            if (src.isDirectory() && src.list() != null) {
                File[] lfiles = src.listFiles(new JMeterFileFilter(extensions));
                int count = lfiles.length;
                input = lfiles[random.nextInt(count)];
            }
        }
        return input;
View Full Code Here

Examples of org.apache.jmeter.gui.JMeterFileFilter

            {
                jfc.setCurrentDirectory(new File(start));
            }
        }
        clearFileFilters();
        jfc.addChoosableFileFilter(new JMeterFileFilter(exts));
        int retVal =
            jfc.showOpenDialog(GuiPackage.getInstance().getMainFrame());
        lastJFCDirectory = jfc.getCurrentDirectory().getAbsolutePath();

        if (retVal == JFileChooser.APPROVE_OPTION)
View Full Code Here

Examples of org.apache.jmeter.gui.JMeterFileFilter

            {
                ext = filename.substring(i);
            }
        }
        clearFileFilters();
        jfc.addChoosableFileFilter(new JMeterFileFilter(new String[] { ext }));

        int retVal =
            jfc.showSaveDialog(GuiPackage.getInstance().getMainFrame());
        lastJFCDirectory = jfc.getCurrentDirectory().getAbsolutePath();
        if (retVal == JFileChooser.APPROVE_OPTION)
View Full Code Here

Examples of org.apache.jmeter.gui.JMeterFileFilter

            File src = new File(this.getXmlPathLoc());
            if (src.isDirectory() && src.list() != null)
            {
                FILE_LIST =
                    src.listFiles(
                        new JMeterFileFilter(new String[] { ".xml" }));
                this.FILE_COUNT = FILE_LIST.length;
                File one = FILE_LIST[RANDOM.nextInt(FILE_COUNT)];
                // return the absolutePath of the file
                return one.getAbsolutePath();
            }
View Full Code Here

Examples of org.apache.jmeter.gui.JMeterFileFilter

      {
        jfc.setCurrentDirectory(new File(start));
      }
    }
    clearFileFilters();
    jfc.addChoosableFileFilter(new JMeterFileFilter(exts));
    int retVal = jfc.showOpenDialog(GuiPackage.getInstance().getMainFrame());
    lastJFCDirectory = jfc.getCurrentDirectory().getAbsolutePath();

    if(retVal == jfc.APPROVE_OPTION)
    {
View Full Code Here

Examples of org.apache.jmeter.gui.JMeterFileFilter

      {
        ext = filename.substring(i);
      }
    }   
    clearFileFilters();
    jfc.addChoosableFileFilter(new JMeterFileFilter(new String[]{ext}));


    int retVal = jfc.showSaveDialog(GuiPackage.getInstance().getMainFrame());
    lastJFCDirectory = jfc.getCurrentDirectory().getAbsolutePath();
    if(retVal == jfc.APPROVE_OPTION)
View Full Code Here

Examples of org.apache.jmeter.gui.JMeterFileFilter

            this.clearFiles();
        } else if (e.getActionCommand().equals(ACTION_BROWSE)) {
            JFileChooser chooser = new JFileChooser();
            String start = System.getProperty("user.dir", ""); // $NON-NLS-1$ // $NON-NLS-2$
            chooser.setCurrentDirectory(new File(start));
            chooser.setFileFilter(new JMeterFileFilter(new String[] { filetype }));
            chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
            chooser.setMultiSelectionEnabled(true);
            chooser.showOpenDialog(GuiPackage.getInstance().getMainFrame());
            File[] cfiles = chooser.getSelectedFiles();
            if (cfiles != null) {
View Full Code Here

Examples of org.apache.jmeter.gui.JMeterFileFilter

                jfc.setCurrentDirectory(new File(start));
            }
        }
        clearFileFilters();
        if(exts != null && exts.length > 0) {
            JMeterFileFilter currentFilter = new JMeterFileFilter(exts);
            jfc.addChoosableFileFilter(currentFilter);
            jfc.setAcceptAllFileFilterUsed(true);
            jfc.setFileFilter(currentFilter);
        }
        int retVal = jfc.showOpenDialog(GuiPackage.getInstance().getMainFrame());
View Full Code Here

Examples of org.apache.jmeter.gui.JMeterFileFilter

                ext = filename.substring(i);
            }
        }
        clearFileFilters();
        if (extensions != null) {
            jfc.addChoosableFileFilter(new JMeterFileFilter(extensions));
        } else {
            jfc.addChoosableFileFilter(new JMeterFileFilter(new String[] { ext }));
        }

        int retVal = jfc.showSaveDialog(GuiPackage.getInstance().getMainFrame());
        jfc.setDialogTitle(null);
        lastJFCDirectory = jfc.getCurrentDirectory().getAbsolutePath();
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.