Examples of ILaunchConfigurationWorkingCopy


Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

  private ILaunchConfiguration createConfiguration(ConfigurationState state) {
    ILaunchConfiguration config= null;
    try {
      ILaunchConfigurationType configType= getJBehaveLaunchConfigType();
      ILaunchConfigurationWorkingCopy wc = configType.newInstance(
          null, DebugPlugin.getDefault().getLaunchManager().generateUniqueLaunchConfigurationNameFrom(state.getName()));
      state.setAttributes(wc);
      config= wc.doSave();   
    } catch (CoreException ce) {
      JBehavePlugin.log(ce);
    }
    return config;
  }
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

      try {
        ILaunchManager mgr = DebugPlugin.getDefault().getLaunchManager();
        ILaunchConfigurationType type = mgr
                .getLaunchConfigurationType(RutaLaunchConfigurationConstants.ID_RUTA_SCRIPT);

        ILaunchConfigurationWorkingCopy copy = type.newInstance(null, scriptFile.getName()
                + ".Testing");
        // do not use RutaLaunchConstants.ARG_INPUT_FOLDER here
        copy.setAttribute(RutaLaunchConstants.INPUT_FOLDER, inputDirPath);
        // do not use RutaLaunchConstants.ARG_OUTPUT_FOLDER here
        copy.setAttribute(RutaLaunchConstants.OUTPUT_FOLDER, outputDirPath);
        copy.setAttribute(RutaLaunchConstants.ARG_DESCRIPTOR, descriptorAbsolutePath);
        copy.setAttribute(RutaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName());
        ILaunchConfiguration lc = copy.doSave();

        String mode = ILaunchManager.RUN_MODE;
        ILaunch launch = new Launch(lc, mode, null);

        ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration();
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

    }
   
    ILaunchConfigurationType type = manager.getLaunchConfigurationType(
        "tk.eclipse.plugin.jseditor.launch.JavaScriptLaunchConfigurationType");
   
    ILaunchConfigurationWorkingCopy wc = type.newInstance(null,
        manager.generateUniqueLaunchConfigurationNameFrom(file.getName()));
   
    wc.setAttribute(JavaScriptLaunchConstants.ATTR_JAVASCRIPT_FILE, fullPath);
   
    try {
      HTMLProjectParams params = new HTMLProjectParams(file.getProject());
      String[] javaScripts = params.getJavaScripts();
      List includes = new ArrayList();
      for(int i=0;i<javaScripts.length;i++){
        includes.add(javaScripts[i]);
      }
     
      wc.setAttribute(JavaScriptLaunchConstants.ATTR_JAVASCRIPT_INCLUDES, includes);
    } catch(Exception ex){
      HTMLPlugin.logException(ex);
    }
   
    return wc.doSave();
  }
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

  /* @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();
      IJavaProject project = (IJavaProject) resource.getProject().getNature(JavaCore.NATURE_ID);
      IRuntimeClasspathEntry cpEntry = JavaRuntime.newDefaultProjectClasspathEntry(project);
      classPath.add(0, cpEntry.getMemento());

      iConfWC.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classPath);

    } catch (CoreException e) {
      e.printStackTrace();
      // FIXME Error dialog
      return null;
    }

    /*
     * Update the selected configuration with a specific Hadoop location
     * target
     */
    IResource resource = type.getResource();
    if (!(resource instanceof IFile))
      return null;
    RunOnHadoopWizard wizard = new RunOnHadoopWizard((IFile) resource, iConfWC);
    WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);

    dialog.create();
    dialog.setBlockOnOpen(true);
    if (dialog.open() != WizardDialog.OK)
      return null;

    try {

      // Only save if some configuration is different.
      if (!iConfWC.contentsEqual(iConf))
        iConfWC.doSave();

    } catch (CoreException e) {
      e.printStackTrace();
      // FIXME Error dialog
      return null;
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

       
        // Configure the node
        String nodeName = configureNode(contributionURI, contributionLocation, compositeURI, progressMonitor);

        // Create a launch configuration
        ILaunchConfigurationWorkingCopy configuration = launchConfigurationType.newInstance(null,
                                    launchManager.generateUniqueLaunchConfigurationNameFrom(file.getFullPath().removeFileExtension().lastSegment()));

        // Set the project and type to launch
        configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.apache.tuscany.sca.node.launcher.NodeLauncher");
        configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, file.getProject().getName());

        // Pass the URL of the node install image to the launcher
        configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
                                   "http://localhost:9990/node-image/" + nodeName);

        // Save the configuration
        configuration.doSave();

        // Launch
        configuration.launch(mode, null);
    }
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

       
        // Get the SCA domain project
        IProject domainProject = domainProject(progressMonitor);

        // Create a launch configuration
        ILaunchConfigurationWorkingCopy configuration = launchConfigurationType.newInstance(null,
                                    launchManager.generateUniqueLaunchConfigurationNameFrom("Apache Tuscany SCA Domain Manager"));

        // Set the project and type to launch
        configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, file.getProject().getName());
        configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.apache.tuscany.sca.node.launcher.DomainManagerLauncher");
        configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, domainProject.getLocation().toString());

        // Save the configuration
        configuration.doSave();

        // Launch
        configuration.launch(mode, null);
    }
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

      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

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

  }

  private ILaunchConfiguration createConfiguration() throws CoreException {
    ILaunchConfigurationType configType = getWorkbenchLaunchConfigType();
    String computedName = getComputedName(this.planName);
    ILaunchConfigurationWorkingCopy wc = configType.newInstance(null, computedName);
    IProject project = this.plan.getProject();
    setAttributes(wc, project);
    return refreshConfiguration(wc);
  }
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

 
  private static ILaunchConfiguration createLaunch(String moduleName, String projectName) throws CoreException {
   
    ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType configType = launchManager.getLaunchConfigurationType(Constants.LAUNCH_CONFIG_TYPE);
    ILaunchConfigurationWorkingCopy copy = configType.newInstance(null, launchManager.generateUniqueLaunchConfigurationNameFrom(moduleName));
    copy.setAttribute(Constants.LAUNCH_ATTR_MODULE_NAME, moduleName);
    copy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
    copy.setAttribute(Constants.LAUNCH_ATTR_PROJECT_NAME, projectName);
   
    return copy.doSave();
  }
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

  private static ILaunchConfiguration createLaunch(String moduleName, String projectName) throws CoreException {

    ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType configType = launchManager.getLaunchConfigurationType(Constants.LAUNCH_CONFIG_TYPE);
    ILaunchConfigurationWorkingCopy copy = configType.newInstance(null, launchManager.generateUniqueLaunchConfigurationNameFrom(moduleName));
    copy.setAttribute(Constants.LAUNCH_ATTR_MODULE_NAME, moduleName);
    copy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
    copy.setAttribute(Constants.LAUNCH_ATTR_PROJECT_NAME, projectName);

    return copy.doSave();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.