1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.impl.wsdl.panels.request.components.editor.inspectors.aut;
14
15 import java.awt.BorderLayout;
16
17 import javax.swing.JComponent;
18 import javax.swing.JPanel;
19 import javax.swing.JScrollPane;
20
21 import com.eviware.soapui.impl.wsdl.WsdlRequest;
22 import com.eviware.soapui.impl.wsdl.panels.request.components.editor.XmlLocation;
23 import com.eviware.soapui.impl.wsdl.panels.request.components.editor.inspectors.AbstractXmlInspector;
24 import com.eviware.soapui.support.components.SimpleBindingForm;
25 import com.eviware.soapui.support.types.StringList;
26 import com.jgoodies.binding.PresentationModel;
27
28 public class RequestAutInspector extends AbstractXmlInspector
29 {
30 private JPanel mainPanel;
31 private final WsdlRequest request;
32 private SimpleBindingForm form;
33
34 protected RequestAutInspector( WsdlRequest request )
35 {
36 super( "Aut", "Authentication and Security-related settings", true, AutInspectorFactory.INSPECTOR_ID );
37 this.request = request;
38 }
39
40 @Override
41 public void release()
42 {
43 super.release();
44 }
45
46 public void locationChanged( XmlLocation location )
47 {
48 }
49
50 public JComponent getComponent()
51 {
52 if( mainPanel == null )
53 {
54 mainPanel = new JPanel( new BorderLayout() );
55
56 StringList outgoingNames = new StringList( request.getOperation().getInterface().getProject()
57 .getWssContainer().getOutgoingWssNames() );
58 outgoingNames.add( "" );
59 StringList incomingNames = new StringList( request.getOperation().getInterface().getProject()
60 .getWssContainer().getIncomingWssNames() );
61 incomingNames.add( "" );
62
63 form = new SimpleBindingForm( new PresentationModel<WsdlRequest>( request ) );
64 form.addSpace( 5 );
65 form.appendTextField( "username", "Username", "The username to use for HTTP Authentication" );
66 form.appendTextField( "password", "Password", "The password to use for HTTP Authentication" );
67 form.appendTextField( "domain", "Domain", "The domain to use for HTTP Authentication" );
68
69 form.addSpace( 5 );
70 form.appendComboBox( "outgoingWss", "Outgoing WSS", outgoingNames.toStringArray(),
71 "The outgoing WS-Security configuration to use" );
72 form.appendComboBox( "incomingWss", "Incoming WSS", incomingNames.toStringArray(),
73 "The incoming WS-Security configuration to use" );
74 form.addSpace( 5 );
75 mainPanel.add( new JScrollPane( form.getPanel() ), BorderLayout.CENTER );
76 }
77
78 return mainPanel;
79 }
80 }