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  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 AbstractWsdlRequestDesktopPanel<WsdlRequest,WsdlRequest>
    30  {
    31  	private JButton addToTestCaseButton;
    32
    33  	public WsdlRequestDesktopPanel(WsdlRequest request)
    34  	{
    35  		super(request);
    36  		init( request );
    37  	}
    38
    39  	protected JComponent buildToolbar()
    40  	{
    41  		addToTestCaseButton = createActionButton(
    42  					SwingActionDelegate.createDelegate( AddRequestToTestCaseAction.SOAPUI_ACTION_ID, getRequest(),
    43  								null, "/addToTestCase.gif"), true );
    44  		return super.buildToolbar();
    45  	}
    46
    47  	public void setEnabled(boolean enabled)
    48  	{
    49  		super.setEnabled(enabled);
    50  		addToTestCaseButton.setEnabled(enabled);
    51  	}
    52
    53  	protected void insertButtons(JToolBar toolbar)
    54  	{
    55  		toolbar.add(addToTestCaseButton);
    56  	}
    57  }