String[] names = ModelSupport.getNames( iface.getOperationList() );
dialog.setOptions( GenerateForm.OPERATIONS, names );
XFormOptionsField operationsFormField = ( XFormOptionsField )dialog.getFormField( GenerateForm.OPERATIONS );
operationsFormField.setSelectedOptions( names );
WsdlProject project = iface.getProject();
String[] testSuites = ModelSupport.getNames( new String[] { "<create>" }, project.getTestSuiteList() );
dialog.setOptions( GenerateForm.TESTSUITE, testSuites );
if( dialog.show() )
{
List<String> operations = StringUtils.toStringList( operationsFormField.getSelectedOptions() );
if( operations.size() == 0 )
{
UISupport.showErrorMessage( "No Operations selected.." );
return null;
}
String testSuiteName = dialog.getValue( GenerateForm.TESTSUITE );
if( testSuiteName.equals( "<create>" ) )
testSuiteName = UISupport.prompt( "Enter name of TestSuite to create", "Generate TestSuite",
iface.getName() + " TestSuite" );
if( testSuiteName != null && testSuiteName.trim().length() > 0 )
{
WsdlTestSuite testSuite = project.getTestSuiteByName( testSuiteName );
if( testSuite == null )
{
testSuite = project.addNewTestSuite( testSuiteName );
}
int style = dialog.getValueIndex( GenerateForm.STYLE );
boolean useExistingRequests = dialog.getValueIndex( GenerateForm.REQUEST_CONTENT ) == 0;
boolean generateLoadTest = dialog.getBooleanValue( GenerateForm.GENERATE_LOADTEST );