当前位置: 首页>>代码示例>>Java>>正文


Java ILaunchConfigurationType.newInstance方法代码示例

本文整理汇总了Java中org.eclipse.debug.core.ILaunchConfigurationType.newInstance方法的典型用法代码示例。如果您正苦于以下问题:Java ILaunchConfigurationType.newInstance方法的具体用法?Java ILaunchConfigurationType.newInstance怎么用?Java ILaunchConfigurationType.newInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.debug.core.ILaunchConfigurationType的用法示例。


在下文中一共展示了ILaunchConfigurationType.newInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toLaunchConfiguration

import org.eclipse.debug.core.ILaunchConfigurationType; //导入方法依赖的package包/类
/**
 * Converts a {@link TestConfiguration} to an {@link ILaunchConfiguration}. Will throw a {@link WrappedException} in
 * case of error.
 *
 * @see TestConfiguration#readPersistentValues()
 */
public ILaunchConfiguration toLaunchConfiguration(ILaunchConfigurationType type, TestConfiguration testConfig) {
	try {
		final ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager()
				.getLaunchConfigurations(type);

		for (ILaunchConfiguration config : configs) {
			if (equals(testConfig, config))
				return config;
		}

		final IContainer container = null;
		final ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(container, testConfig.getName());

		workingCopy.setAttributes(testConfig.readPersistentValues());

		return workingCopy.doSave();
	} catch (Exception e) {
		throw new WrappedException("could not convert N4JS TestConfiguration to Eclipse ILaunchConfiguration", e);
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:27,代码来源:TestConfigurationConverter.java

示例2: toLaunchConfiguration

import org.eclipse.debug.core.ILaunchConfigurationType; //导入方法依赖的package包/类
/**
 * Converts a {@link RunConfiguration} to an {@link ILaunchConfiguration}. Will throw a {@link WrappedException} in
 * case of error.
 *
 * @see RunConfiguration#readPersistentValues()
 */
public ILaunchConfiguration toLaunchConfiguration(ILaunchConfigurationType type, RunConfiguration runConfig) {
	try {
		final ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager()
				.getLaunchConfigurations(type);

		for (ILaunchConfiguration config : configs) {
			if (equals(runConfig, config))
				return config;
		}

		final IContainer container = null;
		final ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(container, runConfig.getName());

		workingCopy.setAttributes(runConfig.readPersistentValues());

		return workingCopy.doSave();
	} catch (Exception e) {
		throw new WrappedException("could not convert N4JS RunConfiguration to Eclipse ILaunchConfiguration", e);
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:27,代码来源:RunConfigurationConverter.java

示例3: createConfiguration

import org.eclipse.debug.core.ILaunchConfigurationType; //导入方法依赖的package包/类
/**
 * Creates and returns a new configuration based on the specified type.
 * 
 * @param additionalScope additional scope which can be given
 * @param type
 *            type to create a launch configuration for
 * 
 * @return launch configuration configured to launch the specified type
 */
protected ILaunchConfiguration createConfiguration(IResource resource, Object additionalScope) {
	ILaunchConfiguration config = null;
	ILaunchConfigurationWorkingCopy wc = null;
	try {
		String projectName = createGradleProjectName(resource);
		String proposal = createLaunchConfigurationNameProposal(projectName, resource, additionalScope);

		ILaunchConfigurationType configType = getConfigurationType();
		wc = configType.newInstance(null, getLaunchManager().generateLaunchConfigurationName(proposal));
		createCustomConfiguration(resource, additionalScope, wc, projectName);

		config = wc.doSave();
	} catch (CoreException exception) {
		MessageDialog.openError(EclipseUtil.getActiveWorkbenchShell(), "EGradle create configuration failed",
				exception.getStatus().getMessage());
	}
	return config;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:28,代码来源:EGradleLaunchShortCut.java

示例4: createMavenPackagingLaunchConfiguration

import org.eclipse.debug.core.ILaunchConfigurationType; //导入方法依赖的package包/类
@VisibleForTesting
static ILaunchConfiguration createMavenPackagingLaunchConfiguration(IProject project)
    throws CoreException {
  ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
  ILaunchConfigurationType launchConfigurationType = launchManager
      .getLaunchConfigurationType(MavenLaunchConstants.LAUNCH_CONFIGURATION_TYPE_ID);

  String launchConfigName = "CT4E App Engine flexible Maven deploy artifact packaging "
      + project.getLocation().toString().replaceAll("[^a-zA-Z0-9]", "_");

  ILaunchConfigurationWorkingCopy workingCopy = launchConfigurationType.newInstance(
      null /*container*/, launchConfigName);
  workingCopy.setAttribute(ILaunchManager.ATTR_PRIVATE, true);
  // IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND;
  workingCopy.setAttribute("org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND", true);
  workingCopy.setAttribute(MavenLaunchConstants.ATTR_POM_DIR, project.getLocation().toString());
  workingCopy.setAttribute(MavenLaunchConstants.ATTR_GOALS, "package");
  workingCopy.setAttribute(RefreshUtil.ATTR_REFRESH_SCOPE, "${project}");
  workingCopy.setAttribute(RefreshUtil.ATTR_REFRESH_RECURSIVE, true);

  IPath jreContainerPath = getJreContainerPath(project);
  workingCopy.setAttribute(
      IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, jreContainerPath.toString());

  return workingCopy;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:27,代码来源:FlexMavenPackagedProjectStagingDelegate.java

示例5: createAntBuildConfig

import org.eclipse.debug.core.ILaunchConfigurationType; //导入方法依赖的package包/类
/**
 * Creates an ant build configuration {@link ILaunchConfiguration}
 * 
 * @param configName
 *            name of the configuration to be created
 * @param targets
 *            ant targets to be called
 * @param buildPath
 *            path to build.xml file
 * @param projectName
 *            name of the projects
 * @return ant build configuration
 */
private static ILaunchConfiguration createAntBuildConfig(String configName, String targets, String buildPath,
		String projectName) throws CoreException {
	ILaunchConfiguration launchCfg;
	ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager()
			.getLaunchConfigurationType("org.eclipse.ant.AntLaunchConfigurationType");
	ILaunchConfigurationWorkingCopy config = null;
	config = type.newInstance(null, configName);
	config.setAttribute("org.eclipse.ui.externaltools.ATTR_ANT_TARGETS", targets);
	config.setAttribute("org.eclipse.ui.externaltools.ATTR_CAPTURE_OUTPUT", true);
	config.setAttribute("org.eclipse.ui.externaltools.ATTR_LOCATION", buildPath);
	config.setAttribute("org.eclipse.ui.externaltools.ATTR_SHOW_CONSOLE", true);
	config.setAttribute("org.eclipse.ui.externaltools.ATTR_ANT_PROPERTIES", Collections.<String, String>emptyMap());
	config.setAttribute("org.eclipse.ant.ui.DEFAULT_VM_INSTALL", true);
	config.setAttribute("org.eclipse.jdt.launching.MAIN_TYPE",
			"org.eclipse.ant.internal.launching.remote.InternalAntRunner");
	config.setAttribute("org.eclipse.jdt.launching.PROJECT_ATTR", projectName);
	config.setAttribute("org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER",
			"org.eclipse.ant.ui.AntClasspathProvider");
	config.setAttribute("process_factory_id", "org.eclipse.ant.ui.remoteAntProcessFactory");
	if (configName.equals(PLATFORM_BUILD_CONFIG) || configName.equals(PLATFORM_CLEAN_BUILD_CONFIG)) {
		config.setAttribute("org.eclipse.debug.core.ATTR_REFRESH_SCOPE", "${workspace}");
	}
	launchCfg = config.doSave();
	return launchCfg;
}
 
开发者ID:SAP,项目名称:hybris-commerce-eclipse-plugin,代码行数:39,代码来源:BuildUtils.java

示例6: getRemoteDebugConfig

import org.eclipse.debug.core.ILaunchConfigurationType; //导入方法依赖的package包/类
private ILaunchConfigurationWorkingCopy getRemoteDebugConfig(IProject activeProj) throws CoreException {
	ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
	ILaunchConfigurationType type = manager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_REMOTE_JAVA_APPLICATION);
	ILaunchConfigurationWorkingCopy config = type.newInstance(null, "Debug "+activeProj.getName());
	config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, activeProj.getName());
	config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_ALLOW_TERMINATE, true);
	config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_CONNECTOR, IJavaLaunchConfigurationConstants.ID_SOCKET_ATTACH_VM_CONNECTOR);
	IVMConnector connector = JavaRuntime.getVMConnector(IJavaLaunchConfigurationConstants.ID_SOCKET_ATTACH_VM_CONNECTOR);
	Map<String, Argument> def = connector.getDefaultArguments();
	Map<String, String> argMap = new HashMap<String, String>(def.size());
	argMap.put("hostname", getHostname(activeProj));
	argMap.put("port", "8348");
	WPILibJavaPlugin.logInfo(argMap.toString());
	config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CONNECT_MAP, argMap);
	return config;
}
 
开发者ID:wpilibsuite,项目名称:EclipsePlugins,代码行数:17,代码来源:JavaLaunchShortcut.java

示例7: createConfiguration

import org.eclipse.debug.core.ILaunchConfigurationType; //导入方法依赖的package包/类
protected ILaunchConfiguration createConfiguration(IType type)
		throws CoreException {

	ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();

	ILaunchConfigurationType configType = manager
			.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);

	ILaunchConfigurationWorkingCopy workingCopy = configType.newInstance(
			null, manager.generateLaunchConfigurationName(type
					.getTypeQualifiedName('.')));
	workingCopy.setAttribute(
			IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
			type.getFullyQualifiedName());
	workingCopy.setAttribute(
			IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, type
					.getJavaProject().getElementName());
	workingCopy.setMappedResources(new IResource[] { type
			.getUnderlyingResource() });
	return workingCopy.doSave();
}
 
开发者ID:eclipse,项目名称:cft,代码行数:22,代码来源:JavaPackageFragmentRootHandler.java

示例8: newConfiguration

import org.eclipse.debug.core.ILaunchConfigurationType; //导入方法依赖的package包/类
/**
 * Creates and returns a new simulation launch configuration for the
 * given resource.
 *
 * @param res The resource
 * @return The new launch configuration
 */
private ILaunchConfiguration newConfiguration(IResource res) {
        ILaunchConfigurationType type = getLaunchType();
        try {
                ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(null,
                		getLaunchManager().generateLaunchConfigurationName(
                			"Simulate [" + res.getProject().getName() + "] " + res.getName())); //$NON-NLS-1$ //$NON-NLS-2$
                workingCopy.setAttribute(SimulationLaunchConfigurationConstants.ATTR_PROJECT_NAME,
    					res.getProject().getName());
                workingCopy.setAttribute(SimulationLaunchConfigurationConstants.ATTR_PATH,
    					res.getProjectRelativePath().toString());
                workingCopy.setMappedResources(new IResource[]{res});
                return workingCopy.doSave();
        } catch (CoreException e) {
                e.printStackTrace();
        }
        return null;
}
 
开发者ID:scribble,项目名称:scribble-eclipse,代码行数:25,代码来源:SimulationLauncherShortcut.java

示例9: createLaunchConfig

import org.eclipse.debug.core.ILaunchConfigurationType; //导入方法依赖的package包/类
/**
 * Create a new GWT SDM Code Server Configuration. This will occur when running the debug
 * configuration from shortcut.
 */
public static ILaunchConfiguration createLaunchConfig(String launchConfigName, final IProject project)
    throws CoreException, OperationCanceledException {
  ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
  ILaunchConfigurationType type = manager.getLaunchConfigurationType(GwtSuperDevModeLaunchConfiguration.TYPE_ID);
  ILaunchConfigurationWorkingCopy launchConfig = type.newInstance(null, launchConfigName);

  // Project name
  LaunchConfigurationUtilities.setProjectName(launchConfig, project.getName());

  launchConfig.setMappedResources(new IResource[] {project});

  setDefaults(launchConfig, project);

  // Save the new launch configuration
  ILaunchConfiguration ilaunchConfig = launchConfig.doSave();

  return ilaunchConfig;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:23,代码来源:GwtSuperDevModeCodeServerLaunchUtil.java

示例10: createLaunchConfigWorkingCopy

import org.eclipse.debug.core.ILaunchConfigurationType; //导入方法依赖的package包/类
private ILaunchConfigurationWorkingCopy createLaunchConfigWorkingCopy(String launchConfigName, IProject project)
    throws CoreException {
  ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
  ILaunchConfigurationType type = manager.getLaunchConfigurationType(CompilerLaunchConfiguration.TYPE_ID);

  final ILaunchConfigurationWorkingCopy config = type.newInstance(null, launchConfigName);

  // Main type
  GWTLaunchConfigurationWorkingCopy.setMainType(config, GwtLaunchConfigurationProcessorUtilities.GWT_COMPILER);

  // project name
  LaunchConfigurationUtilities.setProjectName(config, project.getName());

  // classpath
  config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER,
      ModuleClasspathProvider.computeProviderId(project));

  // Link the launch configuration to the project.
  // This will cause the launch config to be deleted automatically if the project is deleted.
  config.setMappedResources(new IResource[] { project });

  // Modules
  LaunchConfigurationProcessorUtilities.updateViaProcessor(new ModuleArgumentProcessor(), config);

  return config;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:27,代码来源:CompilerLaunchShortcut.java

示例11: getLaunchConfiguration

import org.eclipse.debug.core.ILaunchConfigurationType; //导入方法依赖的package包/类
protected ILaunchConfiguration getLaunchConfiguration(String label){
	ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
	ILaunchConfigurationType type = manager.getLaunchConfigurationType(IExternalToolConstants.ID_PROGRAM_LAUNCH_CONFIGURATION_TYPE);
	try {
		ILaunchConfiguration cfg = type.newInstance(null, "cordova");
		ILaunchConfigurationWorkingCopy wc = cfg.getWorkingCopy();
		wc.setAttribute(IProcess.ATTR_PROCESS_LABEL, label);
		if(additionalEnvProps != null && !additionalEnvProps.isEmpty()){
			wc.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES,additionalEnvProps);
		}
		cfg = wc.doSave();
		return cfg;
	} catch (CoreException e) {
		e.printStackTrace();
	}
	return null;
}
 
开发者ID:eclipse,项目名称:thym,代码行数:18,代码来源:CordovaCLI.java

示例12: createConfiguration

import org.eclipse.debug.core.ILaunchConfigurationType; //导入方法依赖的package包/类
public ILaunchConfiguration createConfiguration() {
  try {
    ILaunchConfiguration _xblockexpression = null;
    {
      DebugPlugin _default = DebugPlugin.getDefault();
      final ILaunchManager launchManager = _default.getLaunchManager();
      final ILaunchConfigurationType configType = launchManager.getLaunchConfigurationType("org.xtext.builddsl.ui.BuildLaunchConfigurationType");
      String _name = this.getName();
      String _generateUniqueLaunchConfigurationNameFrom = launchManager.generateUniqueLaunchConfigurationNameFrom(_name);
      final ILaunchConfigurationWorkingCopy wc = configType.newInstance(null, _generateUniqueLaunchConfigurationNameFrom);
      String _project = this.getProject();
      wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, _project);
      String _clazz = this.getClazz();
      wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, _clazz);
      wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_STOP_IN_MAIN, false);
      String _task = this.getTask();
      wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, _task);
      wc.setAttribute(RefreshTab.ATTR_REFRESH_SCOPE, "${workspace}");
      wc.setAttribute(RefreshTab.ATTR_REFRESH_RECURSIVE, true);
      _xblockexpression = wc.doSave();
    }
    return _xblockexpression;
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
 
开发者ID:oehme,项目名称:xtext-maven-example,代码行数:27,代码来源:LaunchConfigurationInfo.java

示例13: launch

import org.eclipse.debug.core.ILaunchConfigurationType; //导入方法依赖的package包/类
private void launch(IProject project, String mode) {
    ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType configType = manager.getLaunchConfigurationType(getConfigurationTypeId());
    ILaunchConfiguration config = findConfig(manager, configType, project);
    
    if (config == null) {
        ILaunchConfigurationWorkingCopy wc = null;
        try {
            wc = configType.newInstance(null, manager.generateLaunchConfigurationName(project.getName()));
            wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName());
            customizeConfiguration(wc);
            config = wc.doSave();
        } catch (CoreException e) {
            RoboVMPlugin.log(e);
        }
    }

    if (config != null) {
        DebugUITools.launch(config, mode);
    }
}
 
开发者ID:robovm,项目名称:robovm-eclipse,代码行数:22,代码来源:AbstractProjectLaunchShortcut.java

示例14: createLaunchConfiguration

import org.eclipse.debug.core.ILaunchConfigurationType; //导入方法依赖的package包/类
private ILaunchConfiguration createLaunchConfiguration(IProject project)
{
	ILaunchConfiguration config = null;
	ILaunchConfigurationWorkingCopy wc = null;
	try
	{
		ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
		ILaunchConfigurationType configType = manager.getLaunchConfigurationType(CuinaLaunch.CONFIGURATION_TYPE);
		wc = configType.newInstance(null, manager.generateLaunchConfigurationName(CuinaLaunch.CONFIGURATION_NAME));
		wc.setAttribute(CuinaLaunch.PROJECT_NAME, project.getName());
		
		EngineReference eRef = CuinaCore.getCuinaProject(project).getService(EngineReference.class);
		wc.setAttribute(CuinaLaunch.ENGINE_PATH, eRef.getEnginePath());
		wc.setAttribute(CuinaLaunch.PLUGIN_PATH, eRef.getPluginPath());
		wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, CuinaLaunch.getDefaultArgs());
		wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, CuinaLaunch.getDefaultVMArgs());
		config = wc.doSave();
	}
	catch (CoreException e)
	{
		e.printStackTrace();
	}
	return config;
}
 
开发者ID:TheWhiteShadow3,项目名称:cuina,代码行数:25,代码来源:CuinaLaunchShortcut.java

示例15: createConfiguration

import org.eclipse.debug.core.ILaunchConfigurationType; //导入方法依赖的package包/类
/**
 * Create a new configuration based on the Mule project.
 * 
 * @param project
 * @return
 */
protected ILaunchConfiguration createConfiguration(IProject project) {
    try {
        ILaunchConfigurationType configType = getConfigurationType();
        String projectName = project.getName();
        ILaunchConfigurationWorkingCopy wc = configType.newInstance(null, getLaunchManager().generateLaunchConfigurationName(projectName));
        wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);

        // needed for some examples to run
        wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "-XX:PermSize=128M -XX:MaxPermSize=256M");

        return wc.doSave();

    } catch (CoreException e) {
        MuleUIPlugin.openError(getShell(), e.getStatus());
        return null;
    }
}
 
开发者ID:mulesoft,项目名称:mule-tooling-incubator,代码行数:24,代码来源:MavenLaunchShortcut.java


注:本文中的org.eclipse.debug.core.ILaunchConfigurationType.newInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。