Apache JMeter
1.9

org.apache.jmeter.config
Class ExtensionsFileFilter

java.lang.Object
  |
  +--javax.swing.filechooser.FileFilter
        |
        +--org.apache.jmeter.config.ExtensionsFileFilter

public class ExtensionsFileFilter
extends FileFilter

This FileFilter allows for a list of file extensions to be set that it will filter on. This design was taken from the ExampleFileFilter used in How to Use File Choosers, a section in The Java Tutorial. Here is an example of how to use the file filter for JMX files, that have the .jmx extension.

      ExtensionsFileFilter filter = new ExtensionsFileFilter();
      filter.addExtension("jmx");
      filter.setDescription("JMeter (*.jmx)");
      FileChooser fileChooser = new FileChooser();
      fileChooser.setFileFilter(fileFilter);
 


Constructor Summary
ExtensionsFileFilter()
          Default Constructor.
 
Method Summary
 boolean accept(File pFile)
          Determines whether to accept the passed File or not.
 void addExtension(String pExtension)
          Add an extension to the list of extensions to filter on.
 String getDescription()
          Returns a descriptive string detailing the file extensions being filtered.
 void removeExtension(String pExtension)
          Removes an extension from the list of extensions to filter on.
 void setDescription(String pDescription)
          Set the description of the extensions being filtered on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensionsFileFilter

public ExtensionsFileFilter()
Default Constructor.

Method Detail

addExtension

public void addExtension(String pExtension)
Add an extension to the list of extensions to filter on.

Parameters:
pExtension - The extension to add.

removeExtension

public void removeExtension(String pExtension)
Removes an extension from the list of extensions to filter on.

Parameters:
pExtension - The extension to remove.

setDescription

public void setDescription(String pDescription)
Set the description of the extensions being filtered on.

Parameters:
pDescription - the detailed description of the extensions being filtered on.

getDescription

public String getDescription()
Returns a descriptive string detailing the file extensions being filtered.

Specified by:
getDescription in class FileFilter
Returns:
The description of the extensions being filtered.
See Also:
FileFilter.getDescription()

accept

public boolean accept(File pFile)
Determines whether to accept the passed File or not.

Specified by:
accept in class FileFilter
Parameters:
pFile - The file to check whether we should accept or not.
Returns:
true if the file is accepted, false if not.

Apache JMeter
1.9

Copyright © 1998-2003 Apache Software Foundation. All Rights Reserved.