* @param mode Run/debug mode
* @return Launch configuration
*/
protected ILaunchConfiguration chooseConfiguration(List configList, String mode) {
IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
dialog.setElements(configList.toArray());
dialog.setTitle("Launch Configuration Selection");
if (mode.equals(ILaunchManager.DEBUG_MODE)) {
dialog.setMessage("Choose a launch configuration to debug");
} else {
dialog.setMessage("Choose a launch configuration to run");
}
dialog.setMultipleSelection(false);
int result = dialog.open();
labelProvider.dispose();
if (result == Window.OK) { return (ILaunchConfiguration) dialog.getFirstResult(); }
return null;
}