當前位置: 首頁>>代碼示例>>Java>>正文


Java ILaunchConfigurationWorkingCopy.setMappedResources方法代碼示例

本文整理匯總了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);
}
 
開發者ID:Imhotup,項目名稱:LibertyEiffel-Eclipse-Plugin,代碼行數:23,代碼來源:LibertyEiffelMainTab.java

示例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) });
}
 
開發者ID:de-jcup,項目名稱:egradle,代碼行數:8,代碼來源:EGradleLaunchShortCut.java

示例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()]));
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:16,代碼來源:LocalAppEngineServerBehaviour.java


注:本文中的org.eclipse.debug.core.ILaunchConfigurationWorkingCopy.setMappedResources方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。