01: /*
02: * soapUI, copyright (C) 2004-2007 eviware.com
03: *
04: * soapUI is free software; you can redistribute it and/or modify it under the
05: * terms of version 2.1 of the GNU Lesser General Public License as published by
06: * the Free Software Foundation.
07: *
08: * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
09: * 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: import com.eviware.soapui.support.action.swing.SwingActionDelegate;
22:
23: /**
24: * DesktopPanel for standard WsdlRequests
25: *
26: * @author ole.matzura
27: */
28:
29: public class WsdlRequestDesktopPanel extends
30: AbstractWsdlRequestDesktopPanel<WsdlRequest, WsdlRequest> {
31: private JButton addToTestCaseButton;
32:
33: public WsdlRequestDesktopPanel(WsdlRequest request) {
34: super (request);
35: init(request);
36: }
37:
38: protected JComponent buildToolbar() {
39: addToTestCaseButton = createActionButton(SwingActionDelegate
40: .createDelegate(
41: AddRequestToTestCaseAction.SOAPUI_ACTION_ID,
42: getRequest(), null, "/addToTestCase.gif"), true);
43: return super .buildToolbar();
44: }
45:
46: public void setEnabled(boolean enabled) {
47: super .setEnabled(enabled);
48: addToTestCaseButton.setEnabled(enabled);
49: }
50:
51: protected void insertButtons(JToolBar toolbar) {
52: toolbar.add(addToTestCaseButton);
53: }
54:
55: @Override
56: public String getTitle() {
57: WsdlRequest request = getModelItem();
58: return request.getOperation().getName() + " - "
59: + request.getName();
60: }
61: }
|