@SuppressWarnings("rawtypes")
private static ILaunchConfiguration createLaunchConfiguration(LaunchStoreConfig conf)
{
ILaunchConfiguration config = null;
ILaunchConfigurationWorkingCopy wc = null;
try
{
ILaunchConfigurationType configType = getConfigurationType(conf.type);
wc = configType.newInstance(null, getLaunchManager().generateLaunchConfigurationName("Generated_"+conf.name));
for ( Object attKey : conf.attributes.keySet())
{
Object value = conf.attributes.get(attKey.toString());
if(value instanceof String)
{
wc.setAttribute(attKey.toString(), value.toString());
}else if(value instanceof Integer)
{
wc.setAttribute(attKey.toString(), (Integer)value);
}else if(value instanceof Boolean)
{
wc.setAttribute(attKey.toString(), (Boolean)value);
}else if(value instanceof Map)
{
wc.setAttribute(attKey.toString(), (Map)value);
}else if(value instanceof List)
{
wc.setAttribute(attKey.toString(), (List)value);
}else if(value instanceof Set)
{
wc.setAttribute(attKey.toString(), (Set)value);
}
}
config = wc.doSave();
} catch (CoreException exception)
{
MessageDialog.openError(DestecsDebugPlugin.getActiveWorkbenchShell(), "Failed to create launch", exception.getStatus().getMessage());
}
return config;