本文整理汇总了Java中org.eclipse.debug.core.ILaunchManager.generateUniqueLaunchConfigurationNameFrom方法的典型用法代码示例。如果您正苦于以下问题:Java ILaunchManager.generateUniqueLaunchConfigurationNameFrom方法的具体用法?Java ILaunchManager.generateUniqueLaunchConfigurationNameFrom怎么用?Java ILaunchManager.generateUniqueLaunchConfigurationNameFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.debug.core.ILaunchManager
的用法示例。
在下文中一共展示了ILaunchManager.generateUniqueLaunchConfigurationNameFrom方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createConfiguration
import org.eclipse.debug.core.ILaunchManager; //导入方法依赖的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);
}
}
示例2: getLaunchConfiguration
import org.eclipse.debug.core.ILaunchManager; //导入方法依赖的package包/类
private static ILaunchConfigurationWorkingCopy getLaunchConfiguration(IFile resource, String programArguments)
throws CoreException, MisconfigurationException, PythonNatureWithoutProjectException {
String vmargs = ""; // Not sure if it should be a parameter or not
IProject project = resource.getProject();
PythonNature nature = PythonNature.getPythonNature(project);
ILaunchManager manager = org.eclipse.debug.core.DebugPlugin.getDefault().getLaunchManager();
String launchConfigurationType = configurationFor(nature.getInterpreterType());
ILaunchConfigurationType type = manager.getLaunchConfigurationType(launchConfigurationType);
if (type == null) {
throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR, "Python launch configuration not found",
null));
}
String location = resource.getRawLocation().toString();
String name = manager.generateUniqueLaunchConfigurationNameFrom(resource.getName());
String baseDirectory = new File(location).getParent();
int resourceType = IResource.FILE;
ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(null, name);
// Python Main Tab Arguments
workingCopy.setAttribute(Constants.ATTR_PROJECT, project.getName());
workingCopy.setAttribute(Constants.ATTR_RESOURCE_TYPE, resourceType);
workingCopy.setAttribute(Constants.ATTR_INTERPRETER, nature.getProjectInterpreter().getExecutableOrJar());
workingCopy.setAttribute(Constants.ATTR_LOCATION, location);
workingCopy.setAttribute(Constants.ATTR_WORKING_DIRECTORY, baseDirectory);
workingCopy.setAttribute(Constants.ATTR_PROGRAM_ARGUMENTS, programArguments);
workingCopy.setAttribute(Constants.ATTR_VM_ARGUMENTS, vmargs);
workingCopy.setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, true);
workingCopy.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, true);
workingCopy.setMappedResources(new IResource[] { resource });
return workingCopy;
}