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


Java ILaunchManager.getLaunchConfigurationType方法代碼示例

本文整理匯總了Java中org.eclipse.debug.core.ILaunchManager.getLaunchConfigurationType方法的典型用法代碼示例。如果您正苦於以下問題:Java ILaunchManager.getLaunchConfigurationType方法的具體用法?Java ILaunchManager.getLaunchConfigurationType怎麽用?Java ILaunchManager.getLaunchConfigurationType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.debug.core.ILaunchManager的用法示例。


在下文中一共展示了ILaunchManager.getLaunchConfigurationType方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: launchFile

import org.eclipse.debug.core.ILaunchManager; //導入方法依賴的package包/類
/**
 * Launch a file, using the file information, which means using default launch configurations.
 */
protected void launchFile(IFile originalFileToRun, String mode) {
	final String runnerId = getRunnerId();
	final String path = originalFileToRun.getFullPath().toOSString();
	final URI moduleToRun = URI.createPlatformResourceURI(path, true);

	final String implementationId = chooseImplHelper.chooseImplementationIfRequired(runnerId, moduleToRun);
	if (implementationId == ChooseImplementationHelper.CANCEL)
		return;

	RunConfiguration runConfig = runnerFrontEnd.createConfiguration(runnerId, implementationId, moduleToRun);

	ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
	ILaunchConfigurationType type = launchManager.getLaunchConfigurationType(getLaunchConfigTypeID());
	DebugUITools.launch(runConfigConverter.toLaunchConfiguration(type, runConfig), mode);
	// execution dispatched to proper delegate LaunchConfigurationDelegate
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:20,代碼來源:AbstractRunnerLaunchShortcut.java

示例2: getLaunchConfiguration

import org.eclipse.debug.core.ILaunchManager; //導入方法依賴的package包/類
public ILaunchConfiguration getLaunchConfiguration(String projectName) {
  try {
    ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType type = launchManager
        .getLaunchConfigurationType(JSTD_LAUNCH_CONFIGURATION_TYPE);
    ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(type);
    for (ILaunchConfiguration launchConfiguration : launchConfigurations) {
      String configProjectName =
          launchConfiguration.getAttribute(LaunchConfigurationConstants.PROJECT_NAME,
              "");
      if (configProjectName.equals(projectName)
          && isValidToRun(projectName, launchConfiguration)) {
        return launchConfiguration;
      }
    }
  } catch (CoreException e) {
    //logger.logException(e);
  }
  return null;
}
 
開發者ID:BladeRunnerJS,項目名稱:brjs-JsTestDriver,代碼行數:21,代碼來源:JavascriptLaunchConfigurationHelper.java

示例3: addLaunchCfg

import org.eclipse.debug.core.ILaunchManager; //導入方法依賴的package包/類
private void addLaunchCfg() {
	try {
		ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
		ILaunchConfigurationType type = manager
				.getLaunchConfigurationType("org.eclipse.pde.ui.RuntimeWorkbench");
		ILaunchConfiguration[] lcs = manager.getLaunchConfigurations(type);
		List<ILaunchConfiguration> configList = Arrays.asList(lcs);
		List<String> configs = configList.stream().map(config -> config.getName()).collect(Collectors.toList());
		ComboDialog dialog = new ComboDialog(getShell(), true);
		dialog.setTitle("Choose launch config");
		dialog.setInfoText("Choose Eclipse launch conguration to edit it's configuration settings");
		dialog.setAllowedValues(configs);
		if (dialog.open() == OK) {
			String selectedName = dialog.getValue();
			ILaunchConfiguration selectedConfig = configList.stream().filter(config -> selectedName.equals(config.getName())).findFirst().get();
			String configLocation = getConfigLocation(selectedConfig);
			valueAdded(new File(configLocation, ".settings").getAbsolutePath());
			buttonPressed(IDialogConstants.OK_ID);
		}
	} catch (CoreException e) {
		PrefEditorPlugin.log(e);
	}
}
 
開發者ID:32kda,項目名稱:com.onpositive.prefeditor,代碼行數:24,代碼來源:FolderSelectionDialog.java

示例4: createMavenPackagingLaunchConfiguration

import org.eclipse.debug.core.ILaunchManager; //導入方法依賴的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: getConfigurations

import org.eclipse.debug.core.ILaunchManager; //導入方法依賴的package包/類
private ILaunchConfiguration[] getConfigurations(IFile file) {
	ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
	ILaunchConfigurationType type = manager.getLaunchConfigurationType(LAUNCH_CONFIG_TYPE_CODE_ANALYSIS);
	try {
		// configurations that match the given resource
		List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();

		// candidates
		ILaunchConfiguration[] candidates = manager.getLaunchConfigurations(type);
		String name = FileUtils.getRelativePath(file);
		for (ILaunchConfiguration config : candidates) {
			String fileName = config.getAttribute(CAL_XDF.longName(), "");
			if (fileName.equals(name)) {
				configs.add(config);
			}
		}

		return configs.toArray(new ILaunchConfiguration[] {});
	} catch (Exception e) {
		e.printStackTrace();
		return null;
	}
}
 
開發者ID:turnus,項目名稱:turnus.orcc,代碼行數:24,代碼來源:OrccCodeAnalysisLaunchShortcut.java

示例6: getConfigurations

import org.eclipse.debug.core.ILaunchManager; //導入方法依賴的package包/類
private ILaunchConfiguration[] getConfigurations(IFile file) {
	ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
	ILaunchConfigurationType type = manager.getLaunchConfigurationType(LAUNCH_CONFIG_TYPE_NUMA_EXECUTION_ANALYSIS);
	try {
		// configurations that match the given resource
		List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();

		// candidates
		ILaunchConfiguration[] candidates = manager.getLaunchConfigurations(type);
		String name = FileUtils.getRelativePath(file);
		for (ILaunchConfiguration config : candidates) {
			String fileName = config.getAttribute(CAL_XDF.longName(), "");
			if (fileName.equals(name)) {
				configs.add(config);
			}
		}

		return configs.toArray(new ILaunchConfiguration[] {});
	} catch (Exception e) {
		e.printStackTrace();
		return null;
	}
}
 
開發者ID:turnus,項目名稱:turnus.orcc,代碼行數:24,代碼來源:OrccNumaExecutionLaunchShortcut.java

示例7: getConfigurations

import org.eclipse.debug.core.ILaunchManager; //導入方法依賴的package包/類
private ILaunchConfiguration[] getConfigurations(IFile file) {
	ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
	ILaunchConfigurationType type = manager.getLaunchConfigurationType(LAUNCH_CONFIG_TYPE_TABU_PERFORMANCE_ESTMATION_ANALYSIS);
	try {
		// configurations that match the given resource
		List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();

		// candidates
		ILaunchConfiguration[] candidates = manager.getLaunchConfigurations(type);
		String name = FileUtils.getRelativePath(file);
		for (ILaunchConfiguration config : candidates) {
			String fileName = config.getAttribute(CAL_XDF.longName(), "");
			if (fileName.equals(name)) {
				configs.add(config);
			}
		}

		return configs.toArray(new ILaunchConfiguration[] {});
	} catch (Exception e) {
		e.printStackTrace();
		return null;
	}
}
 
開發者ID:turnus,項目名稱:turnus.orcc,代碼行數:24,代碼來源:TabuSearchPerformanceEstimationLaunchShortcut.java

示例8: getConfigurations

import org.eclipse.debug.core.ILaunchManager; //導入方法依賴的package包/類
private ILaunchConfiguration[] getConfigurations(IFile file) {
	ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
	ILaunchConfigurationType type = manager
			.getLaunchConfigurationType(LAUNCH_CONFIG_TYPE_DYNAMIC_EXECUTION_ANALYSIS);
	try {
		// configurations that match the given resource
		List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();

		// candidates
		ILaunchConfiguration[] candidates = manager.getLaunchConfigurations(type);
		String name = FileUtils.getRelativePath(file);
		for (ILaunchConfiguration config : candidates) {
			String fileName = config.getAttribute(CAL_XDF.longName(), "");
			if (fileName.equals(name)) {
				configs.add(config);
			}
		}

		return configs.toArray(new ILaunchConfiguration[] {});
	} catch (Exception e) {
		e.printStackTrace();
		return null;
	}
}
 
開發者ID:turnus,項目名稱:turnus.orcc,代碼行數:25,代碼來源:OrccDynamicExecutionLaunchShortcut.java

示例9: getConfigurations

import org.eclipse.debug.core.ILaunchManager; //導入方法依賴的package包/類
private ILaunchConfiguration[] getConfigurations(IFile file) {
	ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
	ILaunchConfigurationType type = manager.getLaunchConfigurationType(LAUNCH_CONFIG_TYPE_DYNAMIC_INTERPRETER_ANALYSIS);
	try {
		// configurations that match the given resource
		List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();

		// candidates
		ILaunchConfiguration[] candidates = manager.getLaunchConfigurations(type);
		String name = FileUtils.getRelativePath(file);
		for (ILaunchConfiguration config : candidates) {
			String fileName = config.getAttribute(CAL_XDF.longName(), "");
			if (fileName.equals(name)) {
				configs.add(config);
			}
		}

		return configs.toArray(new ILaunchConfiguration[] {});
	} catch (Exception e) {
		e.printStackTrace();
		return null;
	}
}
 
開發者ID:turnus,項目名稱:turnus.orcc,代碼行數:24,代碼來源:OrccDynamicInterpreterLaunchShortcut.java

示例10: getRemoteDebugConfig

import org.eclipse.debug.core.ILaunchManager; //導入方法依賴的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

示例11: getByName

import org.eclipse.debug.core.ILaunchManager; //導入方法依賴的package包/類
/**
 * @see Model#getByName(String)
 */
public static Model getByName(final String fullQualifiedModelName) {
	Assert.isNotNull(fullQualifiedModelName);
	Assert.isLegal(!fullQualifiedModelName.contains(Model.SPEC_MODEL_DELIM), "Not a full-qualified model name.");
	
       final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
       final ILaunchConfigurationType launchConfigurationType = launchManager
               .getLaunchConfigurationType(TLCModelLaunchDelegate.LAUNCH_CONFIGURATION_TYPE);

	try {
		final ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(launchConfigurationType);
		for (int i = 0; i < launchConfigurations.length; i++) {
			// Can do equals here because of full qualified name.
			final ILaunchConfiguration launchConfiguration = launchConfigurations[i];
			if (fullQualifiedModelName.equals(launchConfiguration.getName())) {
				return launchConfiguration.getAdapter(Model.class);
			}
		}
	} catch (CoreException shouldNeverHappen) {
		shouldNeverHappen.printStackTrace();
	}
	
	return null;
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:27,代碼來源:TLCModelFactory.java

示例12: getBy

import org.eclipse.debug.core.ILaunchManager; //導入方法依賴的package包/類
public static Model getBy(final IFile aFile) {
	Assert.isNotNull(aFile);
	
       final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
       final ILaunchConfigurationType launchConfigurationType = launchManager
               .getLaunchConfigurationType(TLCModelLaunchDelegate.LAUNCH_CONFIGURATION_TYPE);

	try {
		final ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(launchConfigurationType);
		for (int i = 0; i < launchConfigurations.length; i++) {
			// Can do equals here because of full qualified name.
			final ILaunchConfiguration launchConfiguration = launchConfigurations[i];
			if (aFile.equals(launchConfiguration.getFile())) {
				return launchConfiguration.getAdapter(Model.class);
			}
		}
	} catch (CoreException shouldNeverHappen) {
		shouldNeverHappen.printStackTrace();
	}
	
	return null;
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:23,代碼來源:TLCModelFactory.java

示例13: createConfiguration

import org.eclipse.debug.core.ILaunchManager; //導入方法依賴的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

示例14: getLaunchConfiguration

import org.eclipse.debug.core.ILaunchManager; //導入方法依賴的package包/類
public ILaunchConfiguration getLaunchConfiguration(String projectName) {
  try {
    ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType type = launchManager
        .getLaunchConfigurationType(TestabilityConstants.TESTABILITY_LAUNCH_CONFIGURATION_TYPE);
    ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(type);
    for (ILaunchConfiguration launchConfiguration : launchConfigurations) {
      String configProjectName =
          launchConfiguration.getAttribute(TestabilityConstants.CONFIGURATION_ATTR_PROJECT_NAME,
              "");
      if (configProjectName.equals(projectName)
          && isValidToRun(projectName, launchConfiguration)) {
        return launchConfiguration;
      }
    }
  } catch (CoreException e) {
    logger.logException(e);
  }
  return null;
}
 
開發者ID:mhevery,項目名稱:testability-explorer,代碼行數:21,代碼來源:TestabilityLaunchConfigurationHelper.java

示例15: isExistingLaunchConfigWithRunOnBuildOtherThanCurrent

import org.eclipse.debug.core.ILaunchManager; //導入方法依賴的package包/類
public boolean isExistingLaunchConfigWithRunOnBuildOtherThanCurrent(
    String projectName, String launchConfigName) {
  try {
    ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType type = launchManager
        .getLaunchConfigurationType(TestabilityConstants.TESTABILITY_LAUNCH_CONFIGURATION_TYPE);
    ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(type);
    for (ILaunchConfiguration launchConfiguration : launchConfigurations) {
      String configProjectName =
          launchConfiguration.getAttribute(TestabilityConstants.CONFIGURATION_ATTR_PROJECT_NAME,
              "");
      boolean runOnEveryBuild =
          launchConfiguration.getAttribute(TestabilityConstants.CONFIGURATION_ATTR_RUN_ON_BUILD,
              false);
      String configName = launchConfiguration.getName();
      boolean isProjectNameEqual = configProjectName.equals(projectName);
      boolean isLaunchConfigNameEqual = launchConfigName.equals(configName); 
      if (isProjectNameEqual && runOnEveryBuild && !isLaunchConfigNameEqual) {
        return true;
      }
    }
  } catch (CoreException e) {
    logger.logException(e);
  }
  return false;
}
 
開發者ID:mhevery,項目名稱:testability-explorer,代碼行數:27,代碼來源:TestabilityLaunchConfigurationHelper.java


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