View Javadoc

1   /*
2    * @(#)$Id: AddSampleAction.java 589 2008-10-28 18:55:50Z kurmannu $
3    *
4    * Author   : Ueli Kurmann, igesture@uelikurmann.ch
5    *                                   
6    *                                   
7    * Purpose  : 
8    *
9    * -----------------------------------------------------------------------
10   *
11   * Revision Information:
12   *
13   * Date       Who     Reason
14   *
15   * 23.03.2008 ukurmann  Initial Release
16   *
17   * -----------------------------------------------------------------------
18   *
19   * Copyright 1999-2009 ETH Zurich. All Rights Reserved.
20   *
21   * This software is the proprietary information of ETH Zurich.
22   * Use is subject to license terms.
23   * 
24   */
25  
26  
27  package org.ximtec.igesture.tool.view.testset.action;
28  
29  import java.awt.event.ActionEvent;
30  
31  import javax.swing.tree.TreePath;
32  
33  import org.ximtec.igesture.core.TestClass;
34  import org.ximtec.igesture.core.TestSet;
35  import org.ximtec.igesture.tool.GestureConstants;
36  import org.ximtec.igesture.tool.core.Controller;
37  import org.ximtec.igesture.tool.core.TreePathAction;
38  
39  
40  public class AddTestClassAction extends TreePathAction {
41  
42     public AddTestClassAction(Controller controller, TreePath treePath) {
43        super(GestureConstants.TESTSET_ADD_CLASS, controller, treePath);
44     }
45  
46  
47     @Override
48     public void actionPerformed(ActionEvent action) {
49        TestSet testSet = (TestSet)getTreePath().getLastPathComponent();
50        TestClass testClass = new TestClass("unnamed test class");
51        testSet.addTestClass(testClass);
52     }
53  
54  }