Examples of ILaunchConfigurationWorkingCopy


Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

                }
                if (elementToLaunch == null)
                {
                    return null;
                }
                ILaunchConfigurationWorkingCopy workingCopy = createLaunchConfiguration(elementToLaunch);
                List list = findExistingLaunchConfigurations(workingCopy);
                return (ILaunchConfiguration[]) list.toArray(new ILaunchConfiguration[list.size()]);
            }
            catch (CoreException e)
            {
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

  /*
   * (non-Javadoc)
   * @see org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#setDefaultSourceLocator(org.eclipse.debug.core.ILaunch, org.eclipse.debug.core.ILaunchConfiguration)
   */
  protected void setDefaultSourceLocator(ILaunch launch, ILaunchConfiguration configuration) throws CoreException {
    ILaunchConfigurationWorkingCopy wc = null;
    if (configuration.isWorkingCopy())
      wc = (ILaunchConfigurationWorkingCopy) configuration;
    else
      wc = configuration.getWorkingCopy();
    String id = configuration.getAttribute(
        IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH_PROVIDER,
        (String) null);
    if (!PDESourcePathProvider.ID.equals(id)) {
      wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH_PROVIDER,
          PDESourcePathProvider.ID);
      wc.doSave();
    }

    manageLaunch(launch);
  }
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

            throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, MessageFormat.format("Error starting bundle \"{0}\". Cannot report JUnit results via the Workbench.", JDT_JUNIT_BSN), null));
        }

        // JUnit plugin ignores the launch unless attribute
        // "org.eclipse.jdt.launching.PROJECT_ATTR" is set.
        ILaunchConfigurationWorkingCopy modifiedConfig = configuration.getWorkingCopy();

        IResource launchResource = LaunchUtils.getTargetResource(configuration);
        if (launchResource != null) {
            modifiedConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, LaunchUtils.getLaunchProjectName(launchResource));
        }

        return super.getLaunch(modifiedConfig.doSave(), mode);
    }
View Full Code Here

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( "LaunchServerJob.StartingServer" ), new String[] { server.getName() } ) ); //$NON-NLS-1$

            // 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.studio.apacheds.Launcher" ); //$NON-NLS-1$

            // Creating the classpath list
            List<String> classpath = new ArrayList<String>();
            IPath apacheDsLibrariesFolder = ApacheDsPluginUtils.getApacheDsLibrariesFolder( server );
            for ( String library : ApacheDsPluginUtils.getApacheDsLibraries( server ) )
            {
                IRuntimeClasspathEntry libraryClasspathEntry = JavaRuntime
                    .newArchiveRuntimeClasspathEntry( apacheDsLibrariesFolder.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 = ApacheDsPluginUtils.getApacheDsServersFolder().append( server.getId() );

            // 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.run.dir=\"" + serverFolderPath.append( "run" ).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$

            // 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
            launch = configuration.launch( ILaunchManager.RUN_MODE, new NullProgressMonitor() );
        }
        catch ( CoreException e )
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

    return null;
  }
 
  protected ILaunchConfiguration createConfiguration(IResource launchable) {
    ILaunchConfiguration config = null;
    ILaunchConfigurationWorkingCopy wc = null;
    try {
      ILaunchConfigurationType configType = getConfigurationType();
      String suggestedName = launchable.getProject().getName();
      String launchName = getLaunchManager().generateLaunchConfigurationName(suggestedName);
      wc = configType.newInstance(null, launchName);
      wc.setAttribute(
        LaunchConstants.ATTR_PROJECT_NAME,
        suggestedName);
      wc.setAttribute(
        LaunchConstants.ATTR_PROGRAM_PATH,
        launchable.getProjectRelativePath().toPortableString());
     
      wc.setMappedResources(new IResource[] { launchable });
      config = wc.doSave();
    } catch (CoreException ce) {
      LangCore.logStatus(ce);
    }
    return config;
  }
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

                            .getStringVariableManager();
            String location = varManager.generateVariableExpression(GrinderConstants.WORKSPACE_LOC,
                            projName + File.separator
                                            + GrinderConstants.GRINDER_PROPERTIES_FILE_NAME);
            try {
                ILaunchConfigurationWorkingCopy workingCopy = conf.copy(conf.getName());
                workingCopy.setAttribute(GrinderConstants.ATTR_GRINDER_PROPERTIES_LOCATION,
                                location);
                conf.delete();
                conf = workingCopy.doSave();
            } catch (CoreException e) {
                reportError("The grinder.properties cannot be set for a run.", e);
            }
        }
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

        "projects" + Path.SEPARATOR + "JMX_EXAMPLE",
        null, true);
    project = projectProvider.getProject();
    project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());

    ILaunchConfigurationWorkingCopy wc = createLaunch();
    ILaunch launch = wc.launch("run", new NullProgressMonitor());
   
    Thread.sleep(10000);
   
    try {
      IConnectionProvider defProvider =
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

  @SuppressWarnings("unchecked")
  protected ILaunchConfigurationWorkingCopy createLaunch() throws Exception {
    ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType launchConfigType = launchManager.getLaunchConfigurationType("org.eclipse.jdt.launching.localJavaApplication");
    ILaunchConfigurationWorkingCopy wc = launchConfigType.newInstance(null, "Test1");

    wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "JMX_EXAMPLE");
    wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "com.example.Main");
    wc.setAttribute("org.eclipse.debug.core.MAPPED_RESOURCE_PATHS",
        new ArrayList(Arrays.asList(new String[] {
            "/JMX_EXAMPLE/src/com/example/Main.java"
        })));
    wc.setAttribute("org.eclipse.debug.core.MAPPED_RESOURCE_TYPES",
        new ArrayList(Arrays.asList(new String[] {"1"})));
    wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,
        "-Dcom.sun.management.jmxremote.port=9999 " +
        "-Dcom.sun.management.jmxremote.authenticate=false " +
        "-Dcom.sun.management.jmxremote.ssl=false");
    return wc;
  }
View Full Code Here

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy

 
    ConfigurationState state=new ConfigurationState();
    state.setProjectName(testProject.getProject().getName());
    state.setBehaviorClass("paket1.AClassBehaviour");
    state.setBehaviorMethod("shouldAddUp");
    ILaunchConfigurationWorkingCopy wc = configType.newInstance(
        null, lm.generateUniqueLaunchConfigurationNameFrom(state.getName()));

    state.setAttributes(wc);
    ILaunchConfiguration config = wc.doSave();
 
    IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
    final TextConsole[] console=new TextConsole[1];       
    manager.addConsoleListener(new IConsoleListener(){
      public void consolesAdded(IConsole[] consoles) {
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.