/* (non-Javadoc)
  * @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut#createConfiguration(org.eclipse.jdt.core.IType)
  */
 @Override
 protected ILaunchConfiguration createConfiguration(IType type) {
   ILaunchConfiguration config = null;
   ILaunchConfigurationWorkingCopy wc = null;
   try {
     ILaunchConfigurationType configType = getConfigurationType();
     wc =
         configType.newInstance(
             null,
             getLaunchManager().generateLaunchConfigurationName(type.getTypeQualifiedName('.')));
     //			wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
     // type.getFullyQualifiedName());
     wc.setAttribute(
         IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME,
         type.getJavaProject().getElementName());
     wc.setMappedResources(new IResource[] {type.getUnderlyingResource()});
     config = wc.doSave();
   } catch (CoreException exception) {
     MessageDialog.openError(
         JDIDebugUIPlugin.getActiveWorkbenchShell(),
         LauncherMessages.JavaLaunchShortcut_3,
         exception.getStatus().getMessage());
   }
   return config;
 }
Ejemplo n.º 2
0
 /** Overridden, copied and changed to alter the generated launch configuration name. */
 @Override
 public ILaunchConfiguration createConfiguration(IType type) {
   ILaunchConfiguration config = null;
   try {
     config = BootLaunchConfigurationDelegate.createConf(type);
   } catch (CoreException exception) {
     MessageDialog.openError(
         JDIDebugUIPlugin.getActiveWorkbenchShell(),
         LauncherMessages.JavaLaunchShortcut_3,
         exception.getStatus().getMessage());
   }
   return config;
 }