View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2009 eviware.com
3    *
4    *  soapUI is free software; you can redistribute it and/or modify it under the
5    *  terms of version 2.1 of the GNU Lesser General Public License as published by
6    *  the Free Software Foundation.
7    *
8    *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
9    *  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.support.resolver;
14  
15  import com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfer;
16  import com.eviware.soapui.support.UISupport;
17  import com.eviware.soapui.support.resolver.ResolveContext.Resolver;
18  
19  public class DisablePropertyTransferResolver implements Resolver
20  {
21  	PropertyTransfer transfer = null;
22  	private boolean resolved;
23  
24  	public DisablePropertyTransferResolver( PropertyTransfer transfer )
25  	{
26  		this.transfer = transfer;
27  	}
28  
29  	public String toString()
30  	{
31  		return getDescription();
32  	}
33  
34  	public String getDescription()
35  	{
36  		return "Disable Property Transfer";
37  	}
38  
39  	public String getResolvedPath()
40  	{
41  		return null;
42  	}
43  
44  	public boolean isResolved()
45  	{
46  		return resolved;
47  	}
48  
49  	public boolean resolve()
50  	{
51  		if( UISupport.confirm( "Are you sure you want to disable property?", "Property Disable" ) && transfer != null )
52  		{
53  			transfer.setDisabled( true );
54  			resolved = true;
55  		}
56  		return resolved;
57  	}
58  
59  }