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.WsdlRequest;
19  import com.eviware.soapui.model.DesktopPanel;
20  import com.eviware.soapui.model.iface.Operation;
21  import com.eviware.soapui.support.PropertiesTable;
22  
23  /***
24   * PanelBuilder for WsdlRequest
25   * 
26   * @author Ole.Matzura
27   */
28  
29  public class WsdlRequestPanelBuilder extends EmptyPanelBuilder
30  {
31     private final WsdlRequest request;
32  
33     public WsdlRequestPanelBuilder(WsdlRequest request)
34     {
35        this.request = request;
36     }
37  
38     public DesktopPanel buildDesktopPanel()
39     {
40        return new WsdlRequestDesktopPanel(request);
41     }
42  
43     public WsdlRequest getRequest()
44     {
45        return request;
46     }
47  
48     public boolean canBuildDesktopPanel()
49     {
50        return true;
51     }
52  
53     public String getDesktopPanelTitle()
54     {
55        Operation operation = request.getOperation();
56        return operation.getInterface().getProject().getName() + "." + operation.getInterface().getName() + "." + 
57           operation.getName() + ": " + request.getName();
58     }
59     
60     public JPanel buildOverviewPanel()
61     {
62     	PropertiesTable table = new PropertiesTable( "Request Properties", request );
63     	request.addPropertyChangeListener( table.getTableModel() );
64     	
65     	table.addProperty( "Name", "name" );
66     	table.addProperty( "Encoding", "encoding" );
67     	table.addProperty( "Endpoint", "endpoint" );
68     	table.addProperty( "Username", "username", true );
69     	table.addProperty( "Password", "password", true );
70     	table.addProperty( "Domain", "domain", true );
71     	
72     	return table;
73     }
74  
75     public boolean hasOverviewPanel()
76     {
77        return true;
78     }
79  }