throw e;
}
}
protected static ILaunch launch(IProject proj, String name, String mainClass, String args, String vmargs, String app) throws CoreException {
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType type=null;
if(app.equalsIgnoreCase(CommonNames.START_DERBY_SERVER)){
//type= manager.getLaunchConfigurationType("org.apache.derby.ui.startDerbyServerLaunchConfigurationType");
type= manager.getLaunchConfigurationType(CommonNames.START_SERVER_LAUNCH_CONFIG_TYPE);
}else if(app.equalsIgnoreCase(CommonNames.SHUTDOWN_DERBY_SERVER)){
//type= manager.getLaunchConfigurationType("org.apache.derby.ui.stopDerbyServerLaunchConfigurationType");
type= manager.getLaunchConfigurationType(CommonNames.STOP_SERVER_LAUNCH_CONFIG_TYPE);
}else if(app.equalsIgnoreCase(CommonNames.IJ)){
//type= manager.getLaunchConfigurationType("org.apache.derby.ui.ijDerbyLaunchConfigurationType");
type= manager.getLaunchConfigurationType(CommonNames.IJ_LAUNCH_CONFIG_TYPE);
}else if(app.equalsIgnoreCase(CommonNames.SYSINFO)){
//type= manager.getLaunchConfigurationType("org.apache.derby.ui.sysinfoDerbyLaunchConfigurationType");
type= manager.getLaunchConfigurationType(CommonNames.SYSINFO_LAUNCH_CONFIG_TYPE);
}else{
type = manager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
}
ILaunchConfiguration config = null;
// if the configuration already exists, delete it
ILaunchConfiguration[] configurations = manager.getLaunchConfigurations(type);
for (int i = 0; i < configurations.length; i++) {
if (configurations[i].getName().equals(name))
configurations[i].delete();
}
// else create a new one