<commit_before>/*
 * Copyright 2005-2009 LAMP/EPFL
 * @author <NAME>
 */
// $Id$

package scala.tools.eclipse.wizards

import scala.collection.JavaConversions._

import org.eclipse.core.resources.IFile
import org.eclipse.debug.core.DebugPlugin
import org.eclipse.debug.ui.IDebugUIConstants
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants

import scala.tools.eclipse.{ ScalaPlugin, ScalaProject }

class NewApplicationWizard extends NewObjectWizard {
  override def adjective = "Application"
  override def body = """  def main(args : Array[String]) : Unit = {}"""
  override protected def postFinish(project : ScalaProject, file : IFile) = {
    super.postFinish(project, file)
    val toRun = this.pkg.getElementName + "." +this.name
    val launchName = DebugPlugin.getDefault.getLaunchManager().generateUniqueLaunchConfigurationNameFrom(toRun)
    val launchType = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(ScalaPlugin.plugin.launchTypeId)
    val wc = launchType.newInstance(null, name)
    wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.underlying.getName)
    wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, toRun)

    val groups = new scala.collection.mutable.ArrayBuffer[AnyRef]
    groups += IDebugUIConstants.ID_RUN_LAUNCH_GROUP
    wc.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, groups)
	      
    val config = wc.doSave
    assert(config != null)
    //config.launch(ILaunchManager.RUN_MODE, null)
  }<commit_msg>Fixed #2198 ... thanks to <NAME> for the patch.<commit_after>/*
 * Copyright 2005-2009 LAMP/EPFL
 * @author <NAME>
 */
// $Id$

package scala.tools.eclipse.wizards

import scala.collection.JavaConversions._

import org.eclipse.core.resources.IFile
import org.eclipse.debug.core.DebugPlugin
import org.eclipse.debug.ui.IDebugUIConstants
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants

import scala.tools.eclipse.{ ScalaPlugin, ScalaProject }

class NewApplicationWizard extends NewObjectWizard {
  override def adjective = "Application"
  override def body = """  def main(args : Array[String]) : Unit = {}"""
  override protected def postFinish(project : ScalaProject, file : IFile) = {
    super.postFinish(project, file)
    val pkgName = this.pkg.getElementName
    val pkgPrefix = if (pkgName == "") "" else pkgName + "." 
    val toRun =  pkgPrefix + this.name
    val launchName = DebugPlugin.getDefault.getLaunchManager().generateUniqueLaunchConfigurationNameFrom(toRun)
    val launchType = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(ScalaPlugin.plugin.launchTypeId)
    val wc = launchType.newInstance(null, name)
    wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.underlying.getName)
    wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, toRun)

    val groups = new scala.collection.mutable.ArrayBuffer[AnyRef]
    groups += IDebugUIConstants.ID_RUN_LAUNCH_GROUP
    wc.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, groups)
	      
    val config = wc.doSave
    assert(config != null)
    //config.launch(ILaunchManager.RUN_MODE, null)
  }
{'fraction_non_alphanumeric': 0.09987476518472135, 'fraction_numerical': 0.006261740763932373, 'mean_word_length': 5.0056390977443606, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6718024', 'n_tokens_mistral': 983, 'n_tokens_neox': 954, 'n_words': 176}