1 18 19 package org.apache.jmeter.gui.action; 20 import java.awt.event.ActionEvent ; 21 import java.io.File ; 22 import java.io.IOException ; 23 import java.util.HashSet ; 24 import java.util.Set ; 25 26 import org.apache.jmeter.gui.util.FileDialoger; 27 import org.apache.jmeter.reporters.FileReporter; 28 import org.apache.jmeter.util.JMeterUtils; 29 30 34 public class Analyze implements Command 35 { 36 private static Set commands = new HashSet (); 37 38 static 39 { 40 commands.add("Analyze File"); 41 } 42 43 public Analyze() 44 { 45 } 46 47 public Set getActionNames() 48 { 49 return commands; 50 } 51 52 public void doAction(ActionEvent e) 53 { 54 FileReporter analyzer = new FileReporter(); 55 try 56 { 57 File f = 58 FileDialoger 59 .promptToOpenFile(new String [] { ".jtl" }) 60 .getSelectedFile(); 61 if (f != null) 62 { 63 try 64 { 65 analyzer.init(f.getPath()); 66 } 67 catch (IOException err) 68 { 69 JMeterUtils.reportErrorToUser( 70 "The file you selected could not be analyzed"); 71 } 72 } 73 } 74 catch (NullPointerException err) 75 { 76 } 77 } 78 } 79 | Popular Tags |