You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2005/05/28 12:33:54 UTC

cvs commit: jakarta-jmeter/src/core/org/apache/jmeter/gui/util FileDialoger.java

sebb        2005/05/28 03:33:54

  Modified:    xdocs    changes.xml
               src/core/org/apache/jmeter/gui/util FileDialoger.java
  Log:
  Bug 35065 - don't save old extensions in File Saver
  
  Revision  Changes    Path
  1.26      +2 -1      jakarta-jmeter/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/xdocs/changes.xml,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- changes.xml	28 May 2005 10:17:31 -0000	1.25
  +++ changes.xml	28 May 2005 10:33:54 -0000	1.26
  @@ -57,6 +57,7 @@
   <li>Fix Cookie Manager to use seconds; add debug</li>
   <li>Bug 35067 - set up filename when using -t option</li>
   <li>Don't substitute TestElement.* properties by UDVs in Proxy</li>
  +<li>Bug 35065 - don't save old extensions in File Saver</li>
   </ul>
   	
   <h3>Version 2.0.3</h3>
  
  
  
  1.10      +16 -18    jakarta-jmeter/src/core/org/apache/jmeter/gui/util/FileDialoger.java
  
  Index: FileDialoger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/util/FileDialoger.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- FileDialoger.java	17 Jun 2004 12:41:52 -0000	1.9
  +++ FileDialoger.java	28 May 2005 10:33:54 -0000	1.10
  @@ -1,6 +1,6 @@
   // $Header$
   /*
  - * Copyright 2001-2004 The Apache Software Foundation.
  + * Copyright 2001-2005 The Apache Software Foundation.
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
  @@ -38,7 +38,6 @@
        */
       private static String lastJFCDirectory = null;
       private static JFileChooser jfc = new JFileChooser();
  -    private static String[] extensions = null;
   
       /**
        * Prevent instantiation of utility class.
  @@ -101,18 +100,6 @@
           return promptToOpenFile(new String[0]);
       }
   
  -	/**
  -	 * Get a JFileChooser with a new FileFilter.
  -	 * @param filename
  -	 * @param filters
  -	 * @return
  -	 */
  -	public static JFileChooser promptToSaveFile(String filename, String[] filters){
  -		extensions = filters;
  -		JFileChooser chooser = promptToSaveFile(filename);
  -		return chooser;
  -	}
  -	
       /**
        * Prompts the user to choose a file from their filesystems for our own
        * devious uses. This method maintains the last directory the user visited
  @@ -125,7 +112,18 @@
        *           are finished using it (accept or otherwise).
        * @see             #promptToOpenFile
        */
  -    public static JFileChooser promptToSaveFile(String filename)
  +	public static JFileChooser promptToSaveFile(String filename)
  +	{
  +		return promptToSaveFile(filename, null);
  +	}
  +	
  +    /**
  +     * Get a JFileChooser with a new FileFilter.
  +     * @param filename
  +     * @param filters
  +     * @return
  +     */
  +    public static JFileChooser promptToSaveFile(String filename, String[] extensions)
       {
           if (lastJFCDirectory == null)
           {
  @@ -141,7 +139,7 @@
           {
               jfc.setSelectedFile(new File(lastJFCDirectory, filename));
               int i = -1;
  -            if ((i = filename.indexOf(".")) > -1)
  +            if ((i = filename.lastIndexOf(".")) > -1)
               {
                   ext = filename.substring(i);
               }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org