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.actions.project;
    14
    15  import java.util.List;
    16
    17  import com.eviware.soapui.SoapUI;
    18  import com.eviware.soapui.impl.wsdl.WsdlProject;
    19  import com.eviware.soapui.support.action.SoapUIActionGroup;
    20  import com.eviware.soapui.support.action.SoapUIActionMapping;
    21  import com.eviware.soapui.support.action.support.AbstractSoapUIActionGroup;
    22
    23  /***
    24   * SoapUIActionGroup for WsdlProjects, returns different actions depending on if the project is
    25   * disabled or not.
    26   *
    27   * @author ole.matzura
    28   */
    29
    30  public class WsdlProjectSoapUIActionGroup extends AbstractSoapUIActionGroup<WsdlProject>
    31  {
    32  	public WsdlProjectSoapUIActionGroup( String id, String name )
    33  	{
    34  		super( id, name );
    35  	}
    36
    37  	public List<SoapUIActionMapping<WsdlProject>> getActionMappings( WsdlProject modelItem )
    38  	{
    39  		if( modelItem.isDisabled() )
    40  		{
    41  			SoapUIActionGroup<WsdlProject> actionGroup = SoapUI.getActionRegistry().getActionGroup( "DisabledWsdlProjectActions" );
    42  			return actionGroup.getActionMappings( modelItem );
    43  		}
    44  		else
    45  		{
    46  			SoapUIActionGroup<WsdlProject> actionGroup = SoapUI.getActionRegistry().getActionGroup( "EnabledWsdlProjectActions" );
    47  			return actionGroup.getActionMappings( modelItem );
    48  		}
    49  	}
    50  }