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;
14  
15  import javax.swing.JButton;
16  import javax.swing.JComponent;
17  import javax.swing.JToolBar;
18  
19  import com.eviware.soapui.impl.wsdl.WsdlRequest;
20  import com.eviware.soapui.impl.wsdl.actions.request.AddRequestToTestCaseAction;
21  
22  public class WsdlRequestDesktopPanel extends AbstractWsdlRequestDesktopPanel<WsdlRequest,WsdlRequest>
23  {
24  	private JButton addToTestCaseButton;
25  	
26  	public WsdlRequestDesktopPanel(WsdlRequest request)
27  	{
28  		super(request);
29  		init( request );
30  	}
31  
32  	protected JComponent buildToolbar()
33  	{
34  		addToTestCaseButton = createActionButton(new AddRequestToTestCaseAction(getRequest()), true );
35  		return super.buildToolbar();
36  	}
37  
38  	public void setEnabled(boolean enabled)
39  	{
40  		super.setEnabled(enabled);
41  		addToTestCaseButton.setEnabled(enabled);
42  	}
43  
44  	protected void insertButtons(JToolBar toolbar)
45  	{
46  		toolbar.add(addToTestCaseButton);
47  	}
48  
49  	@Override
50  	public String getTitle()
51  	{
52  		WsdlRequest request = getModelItem();
53  		return request.getOperation().getName() + " - " + request.getName();
54  	}
55  }