01: /*
02: * soapUI, copyright (C) 2004-2007 eviware.com
03: *
04: * soapUI is free software; you can redistribute it and/or modify it under the
05: * terms of version 2.1 of the GNU Lesser General Public License as published by
06: * the Free Software Foundation.
07: *
08: * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
09: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: * See the GNU Lesser General Public License for more details at gnu.org.
11: */
12:
13: package com.eviware.soapui.impl.wsdl.actions.testsuite;
14:
15: import com.eviware.soapui.SoapUI;
16: import com.eviware.soapui.impl.wsdl.WsdlProject;
17: import com.eviware.soapui.impl.wsdl.WsdlTestSuite;
18: import com.eviware.soapui.support.UISupport;
19: import com.eviware.soapui.support.action.support.AbstractSoapUIAction;
20:
21: /**
22: * Removes a WsdlTestSuite from its WsdlProject
23: *
24: * @author Ole.Matzura
25: */
26:
27: public class DeleteTestSuiteAction extends
28: AbstractSoapUIAction<WsdlTestSuite> {
29: public DeleteTestSuiteAction() {
30: super ("Remove", "Removes this TestSuite from the project");
31: // putValue( Action.ACCELERATOR_KEY, UISupport.getKeyStroke( "DELETE" ));
32: }
33:
34: public void perform(WsdlTestSuite testSuite, Object param) {
35: for (int c = 0; c < testSuite.getTestCaseCount(); c++) {
36: if (SoapUI.getTestMonitor().hasRunningTest(
37: testSuite.getTestCaseAt(c))) {
38: UISupport
39: .showErrorMessage("Cannot remove testSuite due to running tests");
40: return;
41: }
42: }
43:
44: if (UISupport.confirm("Remove TestSuite ["
45: + testSuite.getName() + "] from project",
46: "Remove TestSuite")) {
47: ((WsdlProject) testSuite.getProject())
48: .removeTestSuite(testSuite);
49: }
50: }
51: }
|