View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2010 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.iface;
14  
15  import java.awt.Component;
16  
17  import com.eviware.soapui.config.AnonymousTypeConfig;
18  import com.eviware.soapui.config.WsaVersionTypeConfig;
19  import com.eviware.soapui.impl.EmptyPanelBuilder;
20  import com.eviware.soapui.impl.wsdl.WsdlInterface;
21  import com.eviware.soapui.impl.wsdl.support.soap.SoapVersion;
22  import com.eviware.soapui.support.components.JPropertiesTable;
23  import com.eviware.soapui.ui.desktop.DesktopPanel;
24  
25  /***
26   * PanelBuilder for WsdlInterface
27   * 
28   * @author Ole.Matzura
29   */
30  
31  public class WsdlInterfacePanelBuilder extends EmptyPanelBuilder<WsdlInterface>
32  {
33  	public WsdlInterfacePanelBuilder()
34  	{
35  	}
36  
37  	public Component buildOverviewPanel( WsdlInterface iface )
38  	{
39  		JPropertiesTable<WsdlInterface> table = new JPropertiesTable<WsdlInterface>( "Interface Properties" );
40  		table.addProperty( "Name", "name", true );
41  		table.addProperty( "Description", "description", true );
42  		table.addProperty( "Definition URL", "definition", true );
43  		table.addProperty( "Binding", "bindingName" );
44  		table.addProperty( "SOAP Version", "soapVersion", new Object[] { SoapVersion.Soap11, SoapVersion.Soap12 } );
45  		table.addProperty( "Cached", "cached", false );
46  		table.addProperty( "Style", "style", false );
47  		// TODO extract info from wsdl if by default ws addresing is implemented
48  		table.addProperty( "WS-A version", "wsaVersion", new Object[] { WsaVersionTypeConfig.NONE.toString(),
49  				WsaVersionTypeConfig.X_200408.toString(), WsaVersionTypeConfig.X_200508.toString() } );
50  		table.addProperty( "WS-A anonymous", "anonymous", new Object[] { AnonymousTypeConfig.OPTIONAL.toString(),
51  				AnonymousTypeConfig.REQUIRED.toString(), AnonymousTypeConfig.PROHIBITED.toString() } );
52  
53  		table.setPropertyObject( iface );
54  
55  		return table;
56  	}
57  
58  	public boolean hasOverviewPanel()
59  	{
60  		return true;
61  	}
62  
63  	public DesktopPanel buildDesktopPanel( WsdlInterface iface )
64  	{
65  		return new WsdlInterfaceDesktopPanel( iface );
66  	}
67  
68  	public boolean hasDesktopPanel()
69  	{
70  		return true;
71  	}
72  }