View Javadoc

1   /*
2    *  soapui, copyright (C) 2005 Ole Matzura / 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.teststeps.WsdlTestRequest;
19  import com.eviware.soapui.model.DesktopPanel;
20  import com.eviware.soapui.support.PropertiesTable;
21  
22  /***
23   * PanelBuilder for WsdlTestRequest
24   * 
25   * @author Ole.Matzura
26   */
27  
28  public class WsdlTestRequestPanelBuilder extends EmptyPanelBuilder
29  {
30     private final WsdlTestRequest request;
31  
32     public WsdlTestRequestPanelBuilder(WsdlTestRequest request)
33     {
34        this.request = request;
35     }
36  
37     public String getDesktopPanelTitle()
38     {
39        return "Test-Step:" + request.getTestCase().getTestSuite().getName() + "." + 
40           request.getTestCase().getName() + "." + request.getName();
41     }
42  
43     public DesktopPanel buildDesktopPanel()
44     {
45        return new WsdlTestRequestDesktopPanel(request.getRequestStep());
46     }
47  
48     public boolean canBuildDesktopPanel()
49     {
50        return true;
51     }
52     
53     public JPanel buildOverviewPanel()
54     {
55     	PropertiesTable table = new PropertiesTable( "TestRequest Properties", request );
56     	request.addPropertyChangeListener( table.getTableModel() );
57     	
58     	table.addProperty( "Name", "name" );
59     	table.addProperty( "Encoding", "encoding" );
60     	table.addProperty( "Endpoint", "endpoint" );
61     	table.addProperty( "Username", "username", true );
62     	table.addProperty( "Password", "password", true );
63     	table.addProperty( "Domain", "domain", true );
64     	
65     	return table;
66     }
67  
68     public boolean hasOverviewPanel()
69     {
70        return true;
71     }
72  }