1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.impl.rest.panels.request;
14
15 import java.awt.Component;
16
17 import com.eviware.soapui.impl.EmptyPanelBuilder;
18 import com.eviware.soapui.impl.rest.RestRequest;
19 import com.eviware.soapui.support.components.JPropertiesTable;
20 import com.eviware.soapui.support.types.StringList;
21
22 /***
23 * PanelBuilder for WsdlInterface
24 *
25 * @author Ole.Matzura
26 */
27
28 public class RestRequestPanelBuilder extends EmptyPanelBuilder<RestRequest>
29 {
30 public RestRequestPanelBuilder()
31 {
32 }
33
34 public RestRequestDesktopPanel buildDesktopPanel( RestRequest request )
35 {
36 return new RestRequestDesktopPanel( request );
37 }
38
39 public boolean hasDesktopPanel()
40 {
41 return true;
42 }
43
44 public Component buildOverviewPanel( RestRequest request )
45 {
46 JPropertiesTable<RestRequest> table = new JPropertiesTable<RestRequest>( "Request Properties" );
47 table.addProperty( "Name", "name" );
48 table.addProperty( "Description", "description", true );
49
50
51
52 table.addProperty( "Encoding", "encoding", new String[] { null, "UTF-8", "iso-8859-1" } );
53 table.addProperty( "Endpoint", "endpoint", request.getOperation().getInterface().getEndpoints() );
54 table.addProperty( "Bind Address", "bindAddress", true );
55 table.addProperty( "Follow Redirects", "followRedirects", JPropertiesTable.BOOLEAN_OPTIONS );
56
57
58 table.addProperty( "Username", "username", true );
59 table.addPropertyShadow( "Password", "password", true );
60 table.addProperty( "Domain", "domain", true );
61
62 StringList keystores = new StringList( request.getOperation().getInterface().getProject().getWssContainer()
63 .getCryptoNames() );
64 keystores.add( "" );
65 table.addProperty( "SSL Keystore", "sslKeystore", keystores.toStringArray() );
66
67 table.addProperty( "Strip whitespaces", "stripWhitespaces", JPropertiesTable.BOOLEAN_OPTIONS );
68 table.addProperty( "Remove Empty Content", "removeEmptyContent", JPropertiesTable.BOOLEAN_OPTIONS );
69 table.addProperty( "Entitize Properties", "entitizeProperties", JPropertiesTable.BOOLEAN_OPTIONS );
70
71
72 table.addProperty( "Pretty Print", "prettyPrint", JPropertiesTable.BOOLEAN_OPTIONS );
73 table.addProperty( "Dump File", "dumpFile" ).setDescription( "Dumps response message to specified file" );
74 table.addProperty( "Max Size", "maxSize", true ).setDescription( "The maximum number of bytes to receive" );
75
76 table.setPropertyObject( request );
77
78 return table;
79 }
80
81 public boolean hasOverviewPanel()
82 {
83 return true;
84 }
85 }