Package org.eclipse.debug.core

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy


            ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
            ILaunchConfigurationType configurationType =
                launchManager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
            String name = launchManager.generateUniqueLaunchConfigurationNameFrom(fileName);

            ILaunchConfigurationWorkingCopy workingLaunchConfiguration = configurationType.newInstance(null, name);
            workingLaunchConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
                PivotPlugin.MAIN_TYPE_NAME);
            workingLaunchConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME,
                fileProjectName);
            workingLaunchConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
                getProgramArguments(file));
            workingLaunchConfiguration.setMappedResources(new IResource[] {file});

            launchConfiguration = workingLaunchConfiguration.doSave();
        } catch (CoreException exception) {
            MessageDialog.openError(PivotPlugin.getActiveWorkbenchShell(),
                exception.getMessage(),
                exception.getStatus().getMessage());
        }
View Full Code Here


    // Find an existing or create a launch configuration (Standard way)
    ILaunchConfiguration iConf =
        super.findLaunchConfiguration(type, configType);
    if (iConf == null) 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

        hasInplaceInstrumentation(configuration));
    if (monitor.isCanceled()) {
      return;
    }
    createPropertiesJAR(configuration, info);
    ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
    modifyConfiguration(wc, info);
    InstrumentedClasspathProvider.enable(provider, info);
    try {
      launchdelegate.launch(wc, DELEGATELAUNCHMODE, launch,
          new SubProgressMonitor(monitor, 1));
View Full Code Here

  public void testProjectWithSourceFolders() throws Exception {
    IPackageFragmentRoot rootSrc1 = javaProject1.createSourceFolder("src");
    IPackageFragmentRoot rootSrc2 = javaProject1.createSourceFolder("test");
    JavaProjectKit.waitForBuild();

    ILaunchConfigurationWorkingCopy configuration = getJavaApplicationType()
        .newInstance(javaProject1.project, "test.launch");
    configuration.setAttribute(
        IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "project1");

    final Collection<IPackageFragmentRoot> scope = launcher
        .getOverallScope(configuration);
View Full Code Here

  @Test
  public void testProjectWithRootSourceFolder() throws Exception {
    IPackageFragmentRoot rootSrc1 = javaProject1.createSourceFolder();
    JavaProjectKit.waitForBuild();

    ILaunchConfigurationWorkingCopy configuration = getJavaApplicationType()
        .newInstance(javaProject1.project, "test.launch");
    configuration.setAttribute(
        IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "project1");

    final Collection<IPackageFragmentRoot> scope = launcher
        .getOverallScope(configuration);
View Full Code Here

    IPackageFragmentRoot rootBin1 = javaProject1.createJAR(
        "testdata/bin/signatureresolver.jar", "/sample.jar", new Path(
            "/UnitTestProject/sample.jar"), null);
    JavaProjectKit.waitForBuild();

    ILaunchConfigurationWorkingCopy configuration = getJavaApplicationType()
        .newInstance(javaProject1.project, "test.launch");
    configuration.setAttribute(
        IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "project1");

    final Collection<IPackageFragmentRoot> scope = launcher
        .getOverallScope(configuration);
View Full Code Here

    IPackageFragmentRoot rootSrc1 = javaProject1.createSourceFolder("src");
    IPackageFragmentRoot rootSrc2 = javaProject2.createSourceFolder("src");
    javaProject1.addProjectReference(javaProject2);
    JavaProjectKit.waitForBuild();

    ILaunchConfigurationWorkingCopy configuration = getJavaApplicationType()
        .newInstance(javaProject1.project, "test.launch");
    configuration.setAttribute(
        IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "project1");

    final Collection<IPackageFragmentRoot> scope = launcher
        .getOverallScope(configuration);
View Full Code Here

        hasInplaceInstrumentation(configuration));
    if (monitor.isCanceled()) {
      return;
    }
    createPropertiesJAR(configuration, info);
    ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
    modifyConfiguration(wc, info);
    InstrumentedClasspathProvider.enable(provider, info);
    try {
      launchdelegate.launch(wc, DELEGATELAUNCHMODE, launch,
          new SubProgressMonitor(monitor, 1));
View Full Code Here

    info.instrument(new SubProgressMonitor(monitor, 1), hasInplaceInstrumentation(configuration));
    if (monitor.isCanceled()) {
      return;
    }
    createPropertiesJAR(configuration, info);
    ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
    modifyConfiguration(wc, info);
    InstrumentedClasspathProvider.enable(provider, info);
    try {
      launchdelegate.launch(wc, DELEGATELAUNCHMODE, launch,
          new SubProgressMonitor(monitor, 1));
View Full Code Here

        hasInplaceInstrumentation(configuration));
    if (monitor.isCanceled()) {
      return;
    }
    createPropertiesJAR(configuration, info);
    ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
    modifyConfiguration(wc, info);
    InstrumentedClasspathProvider.enable(provider, info);
    try {
      launchdelegate.launch(wc, DELEGATELAUNCHMODE, launch,
          new SubProgressMonitor(monitor, 1));
View Full Code Here

TOP

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

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.