1 18 19 package org.apache.jmeter.gui.action; 20 21 import java.awt.event.ActionEvent ; 22 import java.util.HashSet ; 23 import java.util.Set ; 24 25 import org.apache.jmeter.gui.GuiPackage; 26 import org.apache.jmeter.gui.tree.JMeterTreeNode; 27 28 32 public class Cut extends AbstractAction 33 { 34 public final static String CUT = "Cut"; 35 private static Set commands = new HashSet (); 36 static { 37 commands.add(CUT); 38 } 39 40 43 public Set getActionNames() 44 { 45 return commands; 46 } 47 48 51 public void doAction(ActionEvent e) 52 { 53 GuiPackage guiPack = GuiPackage.getInstance(); 54 JMeterTreeNode[] currentNodes = guiPack.getTreeListener().getSelectedNodes(); 55 56 Copy.setCopiedNodes(currentNodes); 57 for(int i=0;i<currentNodes.length;i++) { 58 guiPack.getTreeModel().removeNodeFromParent(currentNodes[i]); 59 } 60 guiPack.getMainFrame().repaint(); 61 } 62 } | Popular Tags |