View Javadoc

1   /*
2    *  soapUI, copyright (C) 2006 eviware.com 
3    *
4    *  soapUI is free software; you can redistribute it and/or modify it under the 
5    *  terms of the GNU Lesser General Public License as published by the Free Software Foundation; 
6    *  either version 2.1 of the License, or (at your option) any later version.
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.request;
14  
15  import javax.swing.JPanel;
16  
17  import com.eviware.soapui.impl.EmptyPanelBuilder;
18  import com.eviware.soapui.impl.wsdl.WsdlRequest;
19  import com.eviware.soapui.support.components.JPropertiesTable;
20  import com.eviware.soapui.ui.desktop.DesktopPanel;
21  
22  /***
23   * PanelBuilder for WsdlRequest
24   * 
25   * @author Ole.Matzura
26   */
27  
28  public class WsdlRequestPanelBuilder extends EmptyPanelBuilder<WsdlRequest>
29  {
30     public WsdlRequestPanelBuilder()
31     {
32     }
33  
34     public DesktopPanel buildDesktopPanel(WsdlRequest request)
35     {
36        return new WsdlRequestDesktopPanel(request);
37     }
38  
39     public boolean hasDesktopPanel()
40     {
41        return true;
42     }
43  
44     public JPanel buildOverviewPanel(WsdlRequest request)
45     {
46     	JPropertiesTable<WsdlRequest> table = new JPropertiesTable<WsdlRequest>( "Request Properties", request );
47     	request.addPropertyChangeListener( table.getTableModel() );
48  
49     	table.addProperty( "Name", "name", true );
50     	table.addProperty( "Encoding", "encoding", new String[] {null, "UTF-8", "iso-8859-1" });
51     	table.addProperty( "Endpoint", "endpoint" );
52     	table.addProperty( "Enable MTOM/Inline", "mtomEnabled", JPropertiesTable.BOOLEAN_OPTIONS  );
53     	table.addProperty( "Username", "username", true );
54     	table.addProperty( "Password", "password", true );
55     	table.addProperty( "Domain", "domain", true );
56     	table.addProperty( "WSS-Password Type", "wssPasswordType", new String[] 
57              {WsdlRequest.PW_TYPE_NONE, WsdlRequest.PW_TYPE_TEXT, WsdlRequest.PW_TYPE_DIGEST});
58     	table.addProperty( "Inline Attachments", "inlineResponseAttachments", 
59     			JPropertiesTable.BOOLEAN_OPTIONS );
60     	table.addProperty( "Expand MTOM Attachments", "expandMtomResponseAttachments", 
61  	   			JPropertiesTable.BOOLEAN_OPTIONS );
62     	table.addProperty( "Strip whitspaces", "stripWhitespaces", JPropertiesTable.BOOLEAN_OPTIONS );
63     	table.addProperty( "Enable multiparts", "multipartEnabled", JPropertiesTable.BOOLEAN_OPTIONS );
64     	
65     	table.setPropertyObject( request );
66     	
67     	return table;
68     }
69  
70     public boolean hasOverviewPanel()
71     {
72        return true;
73     }
74  }