View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2007 eviware.com 
3    *
4    *  soapUI is free software; you can redistribute it and/or modify it under the 
5    *  terms of version 2.1 of the GNU Lesser General Public License as published by 
6    *  the Free Software Foundation.
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.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().getOutgoingNames() );
58  			outgoingNames.add( "" );
59  			StringList incomingNames = new StringList( request.getOperation().getInterface().getProject()
60  						.getWssContainer().getIncomingNames() );
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  
76  			form.appendComboBox( "wssPasswordType", "WSS-Password Type", new String[] { WsdlRequest.PW_TYPE_NONE,
77  						WsdlRequest.PW_TYPE_TEXT, WsdlRequest.PW_TYPE_DIGEST }, "The WSS" );
78  			form.appendTextField( "wssTimeToLive", "WSS TimeToLive", "" );
79  			form.addSpace( 5 );
80  
81  			mainPanel.add( new JScrollPane( form.getPanel() ), BorderLayout.CENTER );
82  		}
83  
84  		return mainPanel;
85  	}
86  }