View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2007 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.impl.wsdl.teststeps.registry;
14  
15  import javax.swing.ImageIcon;
16  
17  import com.eviware.soapui.config.TestStepConfig;
18  import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase;
19  import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestStep;
20  import com.eviware.soapui.support.UISupport;
21  
22  /***
23   * Abstract factory behaviour for WsdlTestStep factories 
24   * 
25   * @author Ole.Matzura
26   */
27  
28  public abstract class WsdlTestStepFactory
29  {
30  	private final String typeName;
31  	private final String name;
32  	private final String description;
33  	private ImageIcon icon;
34  
35  	public WsdlTestStepFactory( String typeName, String name, String description, String pathToIcon )
36  	{
37  		this.typeName = typeName;
38  		this.name = name;
39  		this.description = description;
40  		
41  		if( pathToIcon != null )
42  			icon = UISupport.createImageIcon( pathToIcon );
43  	}
44  
45  	public abstract WsdlTestStep buildTestStep( WsdlTestCase testCase, TestStepConfig config );
46  
47  	public String getType()
48  	{
49  		return typeName;
50  	}
51  
52  	public abstract TestStepConfig createNewTestStep(WsdlTestCase testCase, String name);
53  	
54  	public abstract boolean canCreate();
55  
56  	public String getTestStepName()
57  	{
58  		return name;
59  	}
60  	
61  	public String getTestStepDescription()
62  	{
63  		return description;
64  	}
65  
66  	public ImageIcon getTestStepIcon()
67  	{
68  		return icon;
69  	}
70  }