Package org.apache.jmeter.gui

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_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();
      } else {
View Full Code Here


      if (!start.equals("")) {
        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) {
      return jfc;
View Full Code Here

        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());
    lastJFCDirectory = jfc.getCurrentDirectory().getAbsolutePath();
    if (retVal == JFileChooser.APPROVE_OPTION) {
View Full Code Here

            this.clearFiles();
        } else if (e.getActionCommand().equals("browse")) {
      JFileChooser chooser = new JFileChooser();
            String start = JMeterUtils.getPropDefault("user.dir", "");
            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 (chooser != null && cfiles != null) {
View Full Code Here

  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

TOP

Related Classes of org.apache.jmeter.gui.JMeterFileFilter

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.