Package org.eclipse.debug.core

Examples of org.eclipse.debug.core.ILaunchConfiguration


  /* @inheritDoc */
  @Override
  protected ILaunchConfiguration createConfiguration(IType type) {

    ILaunchConfiguration iConf = super.createConfiguration(type);
    ILaunchConfigurationWorkingCopy iConfWC;
    try {
      /*
       * Tune the default launch configuration: setup run-time classpath
       * manually
       */
      iConfWC = iConf.getWorkingCopy();

      iConfWC.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);

      List<String> classPath = new ArrayList<String>();
      IResource resource = type.getResource();
View Full Code Here


      //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
    if (config == null) {
      ILaunchConfigurationWorkingCopy wc = type.newInstance(null, name);
      wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME,
        proj.getProject().getName());
      // current directory should be the project root
      wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY,
        proj.getProject().getLocation().toString());
      // use the suplied args
      if((vmargs!=null)&&!(vmargs.equals(""))){
        wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmargs);
      }
      wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
        mainClass);
      wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
        args);
      // saves the new config
      config = wc.doSave();
    }
    ILaunch launch=config.launch(ILaunchManager.RUN_MODE, null);
    config.delete();
    return launch;
  }
View Full Code Here

        }
  }

    protected void launch(IErrorReporter plan, String mode) {
      try {
            ILaunchConfiguration config = findLaunchConfiguration();
            if (config != null) {
             config.launch(mode, null);
            }
        } catch (CoreException e) {
            /* Handle exceptions*/
        }
    }
View Full Code Here

    ILaunchConfiguration[] configs = getLaunchConfigurations();

    if (configs.length == 0)
      return createConfiguration();

    ILaunchConfiguration config = null;
    if (configs.length == 1) {
      config = configs[0];
    } else {
      // Prompt the user to choose a config.
      config = chooseConfiguration(configs);
    }

    if (config != null) {
      config = refreshConfiguration(config.getWorkingCopy());
    }
    return config;
  }
View Full Code Here

  public static final String []logLevels= {"ERROR", "WARN", "INFO", "TRACE", "DEBUG", "SPAM"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
  public static final String []styles= {"PRETTY", "DETAILED", "OBFUSCATED"}//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 
  public static ILaunchConfiguration findOrCreateLaunch(String moduleName, String projectName, boolean shouldSave) throws CoreException {
   
    ILaunchConfiguration toLaunch = findLaunch(moduleName, projectName);

    if(toLaunch == null) {
      toLaunch = createLaunch(moduleName, projectName);
    }
View Full Code Here

  public static ILaunchConfiguration findLaunch(String moduleName, String projectName) throws CoreException {
   
    ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType configType = launchManager.getLaunchConfigurationType(Constants.LAUNCH_CONFIG_TYPE);
    ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(configType);
    ILaunchConfiguration toLaunch = null;

    for (int i = 0; i < launchConfigurations.length; i++) {
      ILaunchConfiguration configuration = launchConfigurations[i];

      if(moduleName.equals(configuration.getAttribute(Constants.LAUNCH_ATTR_MODULE_NAME, "")) //$NON-NLS-1$
          && projectName.equals(configuration.getAttribute(Constants.LAUNCH_ATTR_PROJECT_NAME, ""))){//$NON-NLS-1$
        toLaunch = configuration;
        break;
      }
    }
    return toLaunch;
View Full Code Here

  private void compileModule(IFile moduleFile) throws CoreException {
   
    String moduleName = Util.getQualifiedName(moduleFile);
    String projectName = project.getName();
   
    ILaunchConfiguration launchConfig = Helper.findOrCreateLaunch(moduleName, projectName, true);
   
    launch(launchConfig);
   
  }
View Full Code Here

    try {

      String moduleName = Util.getQualifiedName(moduleFile);
      String projectName = moduleFile.getProject().getName();

      ILaunchConfiguration toLaunch = Helper.findOrCreateLaunch(moduleName, projectName, true);

      // we need to save, if its a working copy
      if (toLaunch instanceof ILaunchConfigurationWorkingCopy)
        toLaunch = ((ILaunchConfigurationWorkingCopy) toLaunch).doSave();
View Full Code Here

    try {
     
      String moduleName = Util.getQualifiedName(moduleFile);
      String projectName = moduleFile.getProject().getName();
     
      ILaunchConfiguration toLaunch = Helper.findOrCreateLaunch(moduleName, projectName, true);
     
      // we need to save, if its a working copy
      if(toLaunch instanceof ILaunchConfigurationWorkingCopy)
        toLaunch = ((ILaunchConfigurationWorkingCopy)toLaunch).doSave();
View Full Code Here

  public static final String[] logLevels = { "ERROR", "WARN", "INFO", "TRACE", "DEBUG", "SPAM" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
  public static final String[] styles = { "PRETTY", "DETAILED", "OBFUSCATED" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

  public static ILaunchConfiguration findOrCreateLaunch(String moduleName, String projectName, boolean shouldSave) throws CoreException {

    ILaunchConfiguration toLaunch = findLaunch(moduleName, projectName);

    if (toLaunch == null) {
      toLaunch = createLaunch(moduleName, projectName);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.debug.core.ILaunchConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.