本文整理汇总了Java中org.eclipse.debug.core.ILaunchConfigurationWorkingCopy.setMappedResources方法的典型用法代码示例。如果您正苦于以下问题:Java ILaunchConfigurationWorkingCopy.setMappedResources方法的具体用法?Java ILaunchConfigurationWorkingCopy.setMappedResources怎么用?Java ILaunchConfigurationWorkingCopy.setMappedResources使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.debug.core.ILaunchConfigurationWorkingCopy
的用法示例。
在下文中一共展示了ILaunchConfigurationWorkingCopy.setMappedResources方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performApply
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //导入方法依赖的package包/类
@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
String program = eiffelProgramText.getText().trim();
if (program.length() == 0)
program = null;
configuration.setAttribute(Constants.ATTR_LE_PROGRAM, program);
String seFullPath = this.seFullPathText.getText().trim();
configuration.setAttribute(Constants.ATTR_LEC_FULL_PATH, seFullPath);
//perform resource mapping for contextual launch
IResource[] resources = null;
if (program != null) {
IPath path = new Path(program);
IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
if (res != null) {
resources = new IResource[]{res};
}
}
configuration.setMappedResources(resources);
}
示例2: createLaunchConfiguration
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //导入方法依赖的package包/类
/**
* Creates a {@link ILaunchConfiguration}. If the <code>firstInstruction</code> is <code>null</code> the
* launch configuration dialog is opened.
*
* @param file
* the selected model {@link IFile}
* @param firstInstruction
* the first {@link EObject instruction} or <code>null</code> for interactive selection
* @param mode
* the {@link ILaunchConfiguration#getModes() mode}
* @return an array of possible {@link ILaunchConfiguration}, can be empty but not <code>null</code>
* @throws CoreException
* if {@link ILaunchConfiguration} initialization fails of models can't be loaded
*/
protected ILaunchConfiguration[] createLaunchConfiguration(final IResource file,
EObject firstInstruction, final String mode) throws CoreException {
final ILaunchConfiguration[] res;
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType type = manager.getLaunchConfigurationType(getLaunchConfigurationTypeID());
ILaunchConfigurationWorkingCopy configuration = type.newInstance(null, file.getName());
configuration.setMappedResources(new IResource[] {file, });
configuration.setAttribute(AbstractDSLLaunchConfigurationDelegate.RESOURCE_URI, file.getFullPath()
.toString());
if (firstInstruction == null) {
// open configuration for further editing
final ILaunchGroup group = DebugUITools.getLaunchGroup(configuration, mode);
if (group != null) {
configuration.doSave();
DebugUITools.openLaunchConfigurationDialog(PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell(), configuration, group.getIdentifier(), null);
}
res = new ILaunchConfiguration[] {};
} else {
configuration.setAttribute(AbstractDSLLaunchConfigurationDelegate.FIRST_INSTRUCTION_URI,
EcoreUtil.getURI(firstInstruction).toString());
// save and return new configuration
configuration.doSave();
res = new ILaunchConfiguration[] {configuration, };
}
return res;
}
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:44,代码来源:AbstractDSLLaunchConfigurationDelegateUI.java
示例3: createCustomConfiguration
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //导入方法依赖的package包/类
protected void createCustomConfiguration(IResource resource, Object additionalScope,
ILaunchConfigurationWorkingCopy wc, String projectName) {
createProjectNameConfiguration(wc, projectName);
createTaskConfiguration(wc);
wc.setMappedResources(new IResource[] { getResourceToMap(resource) });
}
示例4: setupLaunchConfiguration
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //导入方法依赖的package包/类
@Override
public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy,
IProgressMonitor monitor) throws CoreException {
super.setupLaunchConfiguration(workingCopy, monitor);
// it seems surprising that the Server class doesn't already do this
Collection<IProject> projects = new ArrayList<>();
for (IModule module : getServer().getModules()) {
IProject project = module.getProject();
if (project != null) {
projects.add(project);
}
}
workingCopy.setMappedResources(projects.toArray(new IResource[projects.size()]));
}