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.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( "PortType", "name" );
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", 
49     			new Object[]{ WsaVersionTypeConfig.NONE.toString(), 
50     			WsaVersionTypeConfig.X_200408.toString(), WsaVersionTypeConfig.X_200508.toString() } );
51     	table.addProperty( "WS-A anonymous", "anonymous", 
52     			new Object[]{ AnonymousTypeConfig.OPTIONAL.toString(), 
53     			AnonymousTypeConfig.REQUIRED.toString(), AnonymousTypeConfig.PROHIBITED.toString() } );
54     	
55     	table.setPropertyObject( iface );
56     	
57     	return table;
58     }
59  
60     public boolean hasOverviewPanel()
61     {
62        return true;
63     }
64  
65     public DesktopPanel buildDesktopPanel(WsdlInterface iface)
66     {
67        return new WsdlInterfaceDesktopPanel( iface );
68     }
69  
70     public boolean hasDesktopPanel()
71     {
72        return true;
73     }
74  }