* @return ILaunchConfiguration
* @throws LaunchCancelledByUserException
*/
protected ILaunchConfiguration chooseConfiguration(List configList, String mode) throws LaunchCancelledByUserException {
IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
ElementListSelectionDialog dialog= new ElementListSelectionDialog(JBehavePlugin.getActiveWorkbenchShell(), labelProvider);
dialog.setElements(configList.toArray());
dialog.setTitle("Select JBehave Configuration");
if (mode.equals(ILaunchManager.DEBUG_MODE)) {
dialog.setMessage("Select JBehave debug configuration");
} else {
dialog.setMessage("Select JBehave run configuration");
}
dialog.setMultipleSelection(false);
int result= dialog.open();
labelProvider.dispose();
if (result == Window.OK) {
return (ILaunchConfiguration)dialog.getFirstResult();
}
throw new LaunchCancelledByUserException();
}