1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 package org.ximtec.igesture.tool.view.admin.action;
27
28 import java.awt.event.ActionEvent;
29 import java.util.logging.Logger;
30
31 import javax.swing.tree.TreePath;
32
33 import org.ximtec.igesture.core.GestureClass;
34 import org.ximtec.igesture.core.GestureSet;
35 import org.ximtec.igesture.core.TestClass;
36 import org.ximtec.igesture.core.TestSet;
37 import org.ximtec.igesture.tool.GestureConstants;
38 import org.ximtec.igesture.tool.core.Controller;
39 import org.ximtec.igesture.tool.core.TreePathAction;
40 import org.ximtec.igesture.tool.view.MainModel;
41
42
43 public class CreateTestSetStructureAction extends TreePathAction {
44
45 private static final Logger LOG = Logger
46 .getLogger(CreateTestSetStructureAction.class.getName());
47
48
49 public CreateTestSetStructureAction(Controller controller, TreePath treePath) {
50 super(GestureConstants.GESTURE_SET_TEST_SET, controller, treePath);
51 }
52
53
54 public void actionPerformed(ActionEvent event) {
55 LOG.info("Create Test Set structure.");
56 GestureSet gestureSet = (GestureSet)getTreePath().getLastPathComponent();
57
58
59 TestSet testSet = new TestSet(gestureSet.getName());
60 for(GestureClass gestureClass:gestureSet.getGestureClasses()){
61 testSet.addTestClass(new TestClass(gestureClass.getName()));
62 }
63
64 MainModel mainModel = getLocator().getService(MainModel.IDENTIFIER, MainModel.class);
65 mainModel.getTestSetList().addTestSet(testSet);
66
67
68 }
69
70 }