Package org.eclipse.debug.core

Examples of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy


            if (progressMonitor.isCanceled()) {
                return;
            }

            // Create a new launch configuration
            ILaunchConfigurationWorkingCopy newConfiguration = launchConfigurationType.newInstance(null,
                                        launchManager.generateUniqueLaunchConfigurationNameFrom(file.getName()));

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

            // Pass the URL of the node install image to the launcher
            newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
                                       "http://localhost:9990/node-config/" + nodeName);
           
            // Save the composite path in the launch configuration
            newConfiguration.setAttribute("COMPOSITE_PATH", file.getFullPath().toString());

            // Pass the runtime classpath as a system property
            newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "\"-DTUSCANY_PATH=" + ClasspathUtil.installedRuntimeClasspath() + "\"");

            // Save the configuration
            newConfiguration.doSave();

            configuration = newConfiguration;
        }

        // Launch
View Full Code Here


                if (progressMonitor.isCanceled()) {
                    return;
                }
   
                // Create a new launch configuration
                ILaunchConfigurationWorkingCopy newConfiguration = launchConfigurationType.newInstance(null, TUSCANY_DOMAIN_LAUNCH_CONFIGURATION);

                // Set the project and type to launch
                newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, domainProject.getProject().getName());
                newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.apache.tuscany.sca.node.launcher.DomainManagerLauncher");
                newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, domainProject.getLocation().toString());
               
                // Pass the runtime classpath as a system property
                newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "\"-DTUSCANY_PATH=" + ClasspathUtil.installedRuntimeClasspath() + "\"");

                // Save the configuration
                newConfiguration.doSave();

                configuration = newConfiguration;
            }

            // Launch
View Full Code Here

            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, "Starting " + 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.studio.apacheds.Launcher" );

            // Creating the classpath list
            List<String> classpath = new ArrayList<String>();
            IPath apacheDsLibrariesFolder = ApacheDsPluginUtils.getApacheDsLibrariesFolder();
            for ( String library : ApacheDsPluginUtils.apachedsLibraries )
            {
                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, "\""
                + serverFolderPath.toOSString() + "\"" );

            // Creating the VM arguments string
            StringBuffer vmArguments = new StringBuffer();
            vmArguments.append( "-Dlog4j.configuration=file:\""
                + serverFolderPath.append( "conf" ).append( "log4j.properties" ).toOSString() + "\"" );
            vmArguments.append( " " );
            vmArguments.append( "-Dapacheds.var.dir=\"" + serverFolderPath.toOSString() + "\"" );
            vmArguments.append( " " );
            vmArguments.append( "-Dapacheds.log.dir=\"" + serverFolderPath.append( "log" ).toOSString() + "\"" );
            vmArguments.append( " " );
            vmArguments.append( "-Dapacheds.run.dir=\"" + serverFolderPath.append( "run" ).toOSString() + "\"" );
            vmArguments.append( " " );
            vmArguments.append( "-Dapacheds.instance=\"" + server.getName() + "\"" );

            // 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

        } else {
          uncheckEntry(checked, (IRJRClasspathEntry) event.getElement());
        }

        try {
          ILaunchConfigurationWorkingCopy workingcopy = getWorkingCopy();

          workingcopy.setAttribute(getNonCheckedAttributeName(),
              checked);
          workingcopy.doSave();
        } catch (CoreException e) {
          logger.severe("CheckStateChangedEvent - exception: " + e);
        }
      }
    });
View Full Code Here

      return true;
    }
  }

  private ILaunchConfigurationWorkingCopy getWorkingCopy() throws CoreException{
    ILaunchConfigurationWorkingCopy workingcopy = null;

    if( fLaunchConfiguration instanceof ILaunchConfigurationWorkingCopy){
      workingcopy = (ILaunchConfigurationWorkingCopy) fLaunchConfiguration;
    }else{
      workingcopy = fLaunchConfiguration.getWorkingCopy();
View Full Code Here

   *         classpath for this configuration
   */
  private boolean isDefaultClasspath(IRuntimeClasspathEntry[] classpath,
      ILaunchConfiguration configuration) {
    try {
      ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
      wc.setAttribute(
          IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH,
          true);
      IRuntimeClasspathEntry[] entries = JavaRuntime
          .computeUnresolvedRuntimeClasspath(wc);
      if (classpath.length == entries.length) {
View Full Code Here

      if(projs.size() == 0 ){
        return ;
      }

      ISourceLookupDirector sourceDir = new JavaSourceLookupDirector();
      ILaunchConfigurationWorkingCopy workCopy = configuration.getWorkingCopy();
      String initMemento = workCopy.getAttribute(
          ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, "");
      if (initMemento != null && !initMemento.trim().equals("")) {
        sourceDir.initializeFromMemento(initMemento);
      }
      ISourceContainer[] existContainers = sourceDir
          .getSourceContainers();

      List<ISourceContainer> realContainers = new ArrayList<ISourceContainer>();
      //add exsits source containers
      for (ISourceContainer container : existContainers) {
        realContainers.add(container);
      }
      //check default source container
      ISourceContainer defaultContainer = new DefaultSourceContainer();
      if (!contains(existContainers, defaultContainer)) {
        realContainers.add(defaultContainer);
      }

      for (IProject dependency : projs) {
        // handle projects in current workspace
        ISourceContainer newContainer = new JavaProjectSourceContainer(
            JavaCore.create((IProject) dependency));
        if (!contains(existContainers, newContainer)) {
          realContainers.add(newContainer);
        }
      }

      sourceDir.setSourceContainers(realContainers
          .toArray(new ISourceContainer[realContainers.size()]));

      workCopy.setAttribute(
          ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO,
          sourceDir.getMemento());

      workCopy.doSave();
    } catch (Exception e) {
      // something wrong, skip add sources
    }
  }
View Full Code Here

            if (progressMonitor.isCanceled()) {
                return;
            }

            // Create a new launch configuration
            ILaunchConfigurationWorkingCopy newConfiguration = launchConfigurationType.newInstance(null,
                                        launchManager.generateUniqueLaunchConfigurationNameFrom(file.getName()));

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

            // Pass the URL of the node install image to the launcher
            newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
                                       "http://localhost:9990/node-config/" + nodeName);
           
            // Save the composite path in the launch configuration
            newConfiguration.setAttribute("COMPOSITE_PATH", file.getFullPath().toString());

            // Pass the runtime classpath as a system property
            newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "\"-DTUSCANY_PATH=" + RuntimeClasspathContainerInitializerExtensionPoint.installedRuntimeClasspath() + "\"");

            // Save the configuration
            newConfiguration.doSave();

            configuration = newConfiguration;
        }

        // Launch
View Full Code Here

                if (progressMonitor.isCanceled()) {
                    return;
                }
   
                // Create a new launch configuration
                ILaunchConfigurationWorkingCopy newConfiguration = launchConfigurationType.newInstance(null, TUSCANY_DOMAIN_LAUNCH_CONFIGURATION);

                // Set the project and type to launch
                newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, domainProject.getProject().getName());
                newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.apache.tuscany.sca.node.launcher.DomainManagerLauncher");
                newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, domainProject.getLocation().toString());
               
                // Pass the runtime classpath as a system property
                newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "\"-DTUSCANY_PATH=" + RuntimeClasspathContainerInitializerExtensionPoint.installedRuntimeClasspath() + "\"");

                // Save the configuration
                newConfiguration.doSave();

                configuration = newConfiguration;
            }

            // Launch
View Full Code Here

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

            ILaunchConfigurationWorkingCopy workingLaunchConfiguration = configurationType.newInstance(null, name);
            workingLaunchConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
                PivotPlugin.MAIN_TYPE_NAME);
            workingLaunchConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME,
                applicationProjectName);
            workingLaunchConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
                applicationTypeName);
            workingLaunchConfiguration.setMappedResources(new IResource[] {type.getUnderlyingResource()});

            launchConfiguration = workingLaunchConfiguration.doSave();
        } catch (CoreException exception) {
            MessageDialog.openError(PivotPlugin.getActiveWorkbenchShell(),
                exception.getMessage(),
                exception.getStatus().getMessage());
        }
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.