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( "Timeout", "timeout", true );
55 table.addProperty( "Bind Address", "bindAddress", true );
56 table.addProperty( "Follow Redirects", "followRedirects", JPropertiesTable.BOOLEAN_OPTIONS );
57
58
59 table.addProperty( "Username", "username", true );
60 table.addPropertyShadow( "Password", "password", true );
61 table.addProperty( "Domain", "domain", true );
62
63 StringList keystores = new StringList( request.getOperation().getInterface().getProject().getWssContainer()
64 .getCryptoNames() );
65 keystores.add( "" );
66 table.addProperty( "SSL Keystore", "sslKeystore", keystores.toStringArray() );
67
68 table.addProperty( "Strip whitespaces", "stripWhitespaces", JPropertiesTable.BOOLEAN_OPTIONS );
69 table.addProperty( "Remove Empty Content", "removeEmptyContent", JPropertiesTable.BOOLEAN_OPTIONS );
70 table.addProperty( "Entitize Properties", "entitizeProperties", JPropertiesTable.BOOLEAN_OPTIONS );
71
72
73 table.addProperty( "Pretty Print", "prettyPrint", JPropertiesTable.BOOLEAN_OPTIONS );
74 table.addProperty( "Dump File", "dumpFile" ).setDescription( "Dumps response message to specified file" );
75 table.addProperty( "Max Size", "maxSize", true ).setDescription( "The maximum number of bytes to receive" );
76
77 table.setPropertyObject( request );
78
79 return table;
80 }
81
82 public boolean hasOverviewPanel()
83 {
84 return true;
85 }
86 }