Examples of ILaunchConfigurationWorkingCopy


Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

        IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall();

        // Creating a new editable launch configuration
        ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager()
            .getLaunchConfigurationType( IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION );
        ILaunchConfigurationWorkingCopy workingCopy = type.newInstance( null,
            NLS.bind( Messages.getString( "ApacheDS200LdapServerAdapter.Starting" ), new String[] //$NON-NLS-1$
                { server.getName() } ) );

        // Setting the JRE container path attribute
        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, vmInstall
            .getInstallLocation().toString() );

        // Setting the main type attribute
        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
            "org.apache.directory.server.UberjarMain" ); //$NON-NLS-1$

        // Creating the classpath list
        List<String> classpath = new ArrayList<String>();
        for ( String library : libraries )
        {
            IRuntimeClasspathEntry libraryClasspathEntry = JavaRuntime
                .newArchiveRuntimeClasspathEntry( getServerLibrariesFolder().append( library ) );
            libraryClasspathEntry.setClasspathProperty( IRuntimeClasspathEntry.USER_CLASSES );

            classpath.add( libraryClasspathEntry.getMemento() );
        }

        // Setting the classpath type attribute
        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classpath );

        // Setting the default classpath type attribute to false
        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false );

        // The server folder path
        IPath serverFolderPath = LdapServersManager.getServerFolder( server );

        // Setting the program arguments attribute
        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "\"" //$NON-NLS-1$
            + serverFolderPath.toOSString() + "\"" ); //$NON-NLS-1$

        // Creating the VM arguments string
        StringBuffer vmArguments = new StringBuffer();
        vmArguments.append( "-Dlog4j.configuration=file:\"" //$NON-NLS-1$
            + serverFolderPath.append( CONF ).append( LOG4J_PROPERTIES ).toOSString() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        vmArguments.append( " " ); //$NON-NLS-1$
        vmArguments.append( "-Dapacheds.var.dir=\"" + serverFolderPath.toOSString() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$
        vmArguments.append( " " ); //$NON-NLS-1$
        vmArguments.append( "-Dapacheds.log.dir=\"" + serverFolderPath.append( "log" ).toOSString() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        vmArguments.append( " " ); //$NON-NLS-1$
        vmArguments.append( "-Dapacheds.instance=\"" + server.getName() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$
        vmArguments.append( " " ); //$NON-NLS-1$
        vmArguments
            .append( "-Ddefault.controls=org.apache.directory.api.ldap.codec.controls.cascade.CascadeFactory," + //$NON-NLS-1$
                "org.apache.directory.api.ldap.codec.controls.manageDsaIT.ManageDsaITFactory," + //$NON-NLS-1$
                "org.apache.directory.api.ldap.codec.controls.search.entryChange.EntryChangeFactory," + //$NON-NLS-1$
                "org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsFactory," + //$NON-NLS-1$
                "org.apache.directory.api.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory," + //$NON-NLS-1$
                "org.apache.directory.api.ldap.codec.controls.search.subentries.SubentriesFactory" ); //$NON-NLS-1$
        vmArguments.append( " " ); //$NON-NLS-1$
        vmArguments
            .append( "-Dextra.controls=org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory," + //$NON-NLS-1$
                "org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory," + //$NON-NLS-1$
                "org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory," + //$NON-NLS-1$
                "org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory," + //$NON-NLS-1$
                "org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory" ); //$NON-NLS-1$
        vmArguments.append( " " ); //$NON-NLS-1$
        vmArguments
            .append( "-Ddefault.extendedOperation.requests=org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory," + //$NON-NLS-1$
                "org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory," + //$NON-NLS-1$
                "org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory," + //$NON-NLS-1$
                "org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory" ); //$NON-NLS-1$
        vmArguments.append( " " ); //$NON-NLS-1$
        vmArguments
            .append( "-Ddefault.extendedOperation.responses=org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory" ); //$NON-NLS-1$

        // Setting the VM arguments attribute
        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArguments.toString() );

        // Setting the launch configuration as private
        workingCopy.setAttribute( IDebugUIConstants.ATTR_PRIVATE, true );

        // Indicating that we don't want any console to show up
        workingCopy.setAttribute( DebugPlugin.ATTR_CAPTURE_OUTPUT, false );

        // Saving the launch configuration
        ILaunchConfiguration configuration = workingCopy.doSave();

        // Launching the launch configuration
        ILaunch launch = configuration.launch( ILaunchManager.RUN_MODE, new NullProgressMonitor() );

        // Storing the launch configuration as a custom object in the LDAP Server for later use
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

    createJstdLaunchConfiguration(projectName, testCases);
  }

  private void runFromExistingLaunchConfiguration(
      ILaunchConfiguration launchConfiguration, final List<String> testCases) throws CoreException {
    final ILaunchConfigurationWorkingCopy workingCopy =
        launchConfiguration.copy("new run").getWorkingCopy();
    workingCopy.setAttribute(TESTS_TO_RUN, testCases);
    final ILaunchConfiguration configuration = workingCopy.doSave();

    Job job = new EclipseTestRunnerJob(configuration, testCases, ServiceLocator.getService(
        JstdTestRunner.class), ServiceLocator.getExtensionPoints(
        ILaunchValidator.class, ILaunchValidator.class.getName()));
    job.schedule();
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

    ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType type =
        launchManager.getLaunchConfigurationType(JSTD_LAUNCH_CONFIGURATION_TYPE);
    try {
      // create and initialize a new launch configuration
      ILaunchConfigurationWorkingCopy newLauchConfiguration = type.newInstance(
          null, launchManager.generateLaunchConfigurationName(projectName));
      newLauchConfiguration.setAttribute(PROJECT_NAME, projectName);
      newLauchConfiguration.setAttribute(LaunchConfigurationConstants.TESTS_TO_RUN, testCases);

      // let user edit/run/cancel the configuraion
      int result = DebugUITools.openLaunchConfigurationDialog(
          Display.getCurrent().getActiveShell(), newLauchConfiguration,
          "org.eclipse.debug.ui.launchGroup.run", null);
      if (result == Window.OK) {
        // we do not want to save tests subset into main launch configuration forever
        newLauchConfiguration.setAttribute(
            LaunchConfigurationConstants.TESTS_TO_RUN, new ArrayList<String>());
        newLauchConfiguration.doSave();
      }
    } catch (CoreException e) {
      logger.log(Level.SEVERE, "Could not create new launch configuration.", e);
    }
  }
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

      event.getDelta().accept(visitor);
      String projectName = visitor.getProjectName();
      ILaunchConfiguration launchConfiguration =
          configurationHelper.getLaunchConfiguration(projectName);
      if (launchConfiguration != null) {
        ILaunchConfigurationWorkingCopy workingCopy = launchConfiguration.getWorkingCopy();
        workingCopy.setAttribute(LaunchConfigurationConstants.RUN_ON_EVERY_SAVE, true);
        workingCopy.launch(ILaunchManager.RUN_MODE, null);
        Display.getDefault().asyncExec(new Runnable() {

            @Override
          public void run() {
            IEditorPart activeEditor = PlatformUI.getWorkbench()
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

  public ILaunch execute(IProgressMonitor monitor) throws CoreException {
    ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType type =
        launchManager.getLaunchConfigurationType("org.eclipse.ant.AntLaunchConfigurationType"/*IAntLaunchConfigurationConstants.ID_ANT_LAUNCH_CONFIGURATION_TYPE*/);
    String name = launchManager.generateUniqueLaunchConfigurationNameFrom(m_antFile.getName());
    ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(null, name);
    // initialize with default values
    {
      workingCopy.setAttribute(
          IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH_PROVIDER,
          "org.eclipse.ant.ui.AntClasspathProvider");
      workingCopy.setAttribute(
          "org.eclipse.ant.ui.DEFAULT_VM_INSTALL"/*IAntUIConstants.ATTR_DEFAULT_VM_INSTALL*/,
          true);
      applySeparateVMAttributes(workingCopy);
    }
    // set ANT file location and working directory
    workingCopy.setAttribute(
        "org.eclipse.ui.externaltools.ATTR_LOCATION"/*IExternalToolConstants.ATTR_LOCATION*/,
        m_antFile.getAbsolutePath());
    workingCopy.setAttribute(
        "org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY"/*IExternalToolConstants.ATTR_WORKING_DIRECTORY*/,
        m_workingDir.getAbsolutePath());
    // launch
    workingCopy.setAttribute(IDebugUIConstants.ATTR_PRIVATE, true);
    return workingCopy.launch(ILaunchManager.RUN_MODE, monitor);
  }
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

  /**
   * @return GWT runtime classpath for given {@link IProject}.
   */
  public static String[] getGWTProjectClasspath(IProject project) throws CoreException {
    // create new launch configuration just as container for parameters, we are not going to save it
    ILaunchConfigurationWorkingCopy launchConfiguration;
    {
      ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
      ILaunchConfigurationType launchConfigurationType =
          launchManager.getLaunchConfigurationType(Constants.LAUNCH_TYPE_ID_SHELL);
      launchConfiguration = launchConfigurationType.newInstance(null, "__GWTDesigner_tmp");
    }
    // set project name
    launchConfiguration.setAttribute(
        IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME,
        project.getName());
    // create delegate just for asking classpath
    GwtLaunchConfigurationDelegate delegate = new GwtLaunchConfigurationDelegate();
    return delegate.getClasspathAll(launchConfiguration);
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

                    .getLaunchManager()
                    .generateUniqueLaunchConfigurationNameFrom(
                        "Run Hadoop Jar"));
      }

      ILaunchConfigurationWorkingCopy copy =
          launchConfig
              .copy("Run " + jar.getName() + " on " + this.getName());

      // COMMENTED(jz) - perform the jarring in the launch delegate now
      // copy.setAttribute("hadoop.jar",
      // jar.buildJar(monitor).toString());

      copy.setAttribute("hadoop.jarrable", jar.toMemento());
      copy.setAttribute("hadoop.host", this.getEffectiveHostName());
      copy.setAttribute("hadoop.user", this.getUserName());
      copy.setAttribute("hadoop.serverid", this.id);
      copy.setAttribute("hadoop.path", this.getInstallPath());
      ILaunchConfiguration saved = copy.doSave();

      // NOTE(jz) became deprecated in 3.3, replaced with getDelegates
      // (plural) method,
      // as this new method is marked experimental leaving as-is for now
      ILaunchConfigurationDelegate delegate =
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

        return TestSearchEngine.findTests(PlatformUI.getWorkbench().getActiveWorkbenchWindow(), cu, testKind);
    }

    private void performLaunch(File element, String mode) throws InterruptedException, CoreException
    {
        ILaunchConfigurationWorkingCopy temparary = createLaunchConfiguration(element);
        ILaunchConfiguration config = temparary.doSave();
        //    if (config == null) {
        // no existing found: create a new one
        //      config=
        //    }
        DebugUITools.launch(config, mode);
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

        containerHandleId = EMPTY_STRING;
        testName = resource.getName();
        String resources = testName;

        ILaunchConfigurationType configType = getLaunchManager().getLaunchConfigurationType(getLaunchConfigurationTypeId());
        ILaunchConfigurationWorkingCopy wc = configType.newInstance(null, getLaunchManager().generateLaunchConfigurationName(testName));


        wc.setAttribute("resource", resources);
        wc.setAttribute("Mpath", resource.getFullPath().toString());
        //    wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, resource.getProject().getName());
        //    wc.setAttribute(JUnitLaunchConfigurationConstants.ATTR_KEEPRUNNING, false);
        //    wc.setAttribute(JUnitLaunchConfigurationConstants.ATTR_TEST_CONTAINER, containerHandleId);
        //    wc.setAttribute(JUnitLaunchConfigurationConstants.ATTR_TEST_RUNNER_KIND, testKindId);
        //    System.setProperty("munit.resource", resources);


        wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, resource.getProject().getName());
        JUnitMigrationDelegate.mapResources(wc);
        String userVm = AssertionVMArg.getEnableAssertionsPreference() ? "-ea" : "";
        wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, userVm + " -Dmunit.resource=" + resources);

        return wc;
    }
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.