1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.impl.actions.multi;
14
15 import com.eviware.soapui.impl.wsdl.WsdlTestSuite;
16 import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase;
17 import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestStep;
18 import com.eviware.soapui.model.ModelItem;
19 import com.eviware.soapui.support.action.support.AbstractSoapUIMultiAction;
20
21 public class MultiTestStepEnableAction extends AbstractSoapUIMultiAction<ModelItem>
22 {
23 public static final String SOAPUI_ACTION_ID = "MultiTestStepEnableAction";
24
25 public MultiTestStepEnableAction()
26 {
27 super( SOAPUI_ACTION_ID, "Enable", "Enables the selected items" );
28 }
29
30 public void perform( ModelItem[] targets, Object param )
31 {
32 for( ModelItem target : targets )
33 {
34 if( target instanceof WsdlTestStep )
35 ( ( WsdlTestStep )target ).setDisabled( false );
36 else if( target instanceof WsdlTestCase )
37 ( ( WsdlTestCase )target ).setDisabled( false );
38 else if( target instanceof WsdlTestSuite )
39 ( ( WsdlTestSuite )target ).setDisabled( false );
40 }
41 }
42
43 public boolean applies( ModelItem target )
44 {
45 return ( ( target instanceof WsdlTestStep ) && ( ( WsdlTestStep )target ).isDisabled() )
46 || ( ( target instanceof WsdlTestCase ) && ( ( WsdlTestCase )target ).isDisabled() )
47 || ( ( target instanceof WsdlTestSuite ) && ( ( WsdlTestSuite )target ).isDisabled() );
48 }
49 }