1 18 19 package org.apache.jmeter.gui.action; 20 import java.awt.event.ActionEvent ; 21 import java.util.HashSet ; 22 import java.util.Set ; 23 24 import org.apache.jmeter.gui.GuiPackage; 25 import org.apache.jmeter.gui.NamePanel; 26 27 31 public class EditCommand implements Command 32 { 33 private static Set commands = new HashSet (); 34 static 35 { 36 commands.add("edit"); 37 } 38 39 public EditCommand() 40 { 41 } 42 43 public void doAction(ActionEvent e) 44 { 45 GuiPackage guiPackage = GuiPackage.getInstance(); 46 guiPackage.getMainFrame().setMainPanel( 47 (javax.swing.JComponent ) guiPackage.getCurrentGui()); 48 guiPackage.getMainFrame().setEditMenu(guiPackage.getTreeListener() 49 .getCurrentNode().createPopupMenu()); 50 if (!(guiPackage.getCurrentGui() instanceof NamePanel)) 53 { 54 guiPackage.getMainFrame().setFileLoadEnabled(true); 55 guiPackage.getMainFrame().setFileSaveEnabled(true); 56 } 57 else 58 { 59 guiPackage.getMainFrame().setFileLoadEnabled(false); 60 guiPackage.getMainFrame().setFileSaveEnabled(false); 61 } 62 } 63 64 public Set getActionNames() 65 { 66 return commands; 67 } 68 } 69 | Popular Tags |