1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.impl.rest.panels.request;
14
15 import javax.swing.JButton;
16
17 import com.eviware.soapui.impl.rest.RestRequestInterface;
18 import com.eviware.soapui.impl.rest.actions.request.AddRestRequestToTestCaseAction;
19 import com.eviware.soapui.impl.wsdl.support.HelpUrls;
20 import com.eviware.soapui.support.action.swing.SwingActionDelegate;
21 import com.eviware.soapui.support.components.JXToolBar;
22
23 public class RestRequestDesktopPanel extends
24 AbstractRestRequestDesktopPanel<RestRequestInterface, RestRequestInterface>
25 {
26 private JButton addToTestCaseButton;
27
28 public RestRequestDesktopPanel( RestRequestInterface modelItem )
29 {
30 super( modelItem, modelItem );
31 }
32
33 @Override
34 protected void init( RestRequestInterface request )
35 {
36 addToTestCaseButton = createActionButton( SwingActionDelegate.createDelegate(
37 AddRestRequestToTestCaseAction.SOAPUI_ACTION_ID, getRequest(), null, "/addToTestCase.gif" ), true );
38
39 super.init( request );
40 }
41
42 protected String getHelpUrl()
43 {
44 return HelpUrls.RESTREQUESTEDITOR_HELP_URL;
45 }
46
47 public void setEnabled( boolean enabled )
48 {
49 super.setEnabled( enabled );
50 addToTestCaseButton.setEnabled( enabled );
51 }
52
53 protected void insertButtons( JXToolBar toolbar )
54 {
55 toolbar.add( addToTestCaseButton );
56 }
57 }