View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2008 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.panels.mock;
14  
15  import com.eviware.soapui.impl.EmptyPanelBuilder;
16  import com.eviware.soapui.impl.wsdl.mock.WsdlMockService;
17  import com.eviware.soapui.support.components.JPropertiesTable;
18  import com.eviware.soapui.support.types.StringList;
19  import com.eviware.soapui.ui.desktop.DesktopPanel;
20  
21  import java.awt.*;
22  
23  /***
24   * PanelBuilder for WsdlMockServices
25   * 
26   * @author ole.matzura
27   */
28  
29  public class WsdlMockServicePanelBuilder extends EmptyPanelBuilder<WsdlMockService>
30  {
31  	public WsdlMockServicePanelBuilder()
32  	{
33  	}
34  
35  	public DesktopPanel buildDesktopPanel( WsdlMockService mockService )
36  	{
37  		return new WsdlMockServiceDesktopPanel( mockService );
38  	}
39  
40  	@Override
41  	public boolean hasDesktopPanel()
42  	{
43  		return true;
44  	}
45  	
46  	public Component buildOverviewPanel( WsdlMockService mockService )
47     {
48     	JPropertiesTable<WsdlMockService> table = new JPropertiesTable<WsdlMockService>( "MockService Properties" );
49     	table.addProperty( "Name", "name", true );
50     	table.addProperty( "Description", "description", true );
51     	table.addProperty( "Path", "path" );
52     	table.addProperty( "Port", "port" );
53     	table.addProperty( "Match SOAP Version", "requireSoapVersion", JPropertiesTable.BOOLEAN_OPTIONS ).setDescription(
54     			"Matches incoming SOAP Version against corresponding Interface");
55     	table.addProperty( "Require SOAP Action", "requireSoapAction", JPropertiesTable.BOOLEAN_OPTIONS );
56        table.addProperty( "Dispatch Responses", "dispatchResponseMessages", JPropertiesTable.BOOLEAN_OPTIONS );
57     	StringList incomingNames = new StringList( mockService.getProject().getWssContainer().getIncomingWssNames() );
58     	incomingNames.add( "" );
59  		table.addProperty( "Incoming WSS", "incomingWss", incomingNames.toStringArray() );
60  		StringList outgoingNames = new StringList( mockService.getProject().getWssContainer().getOutgoingWssNames() );
61  		outgoingNames.add( "" );
62  		table.addProperty( "Default Outgoing WSS", "outgoingWss", outgoingNames.toStringArray() );
63     	table.setPropertyObject( mockService );
64     	
65     	return table;
66     }
67  
68     public boolean hasOverviewPanel()
69     {
70        return true;
71     }
72  }