本文整理汇总了Java中org.eclipse.debug.core.ILaunchManager.getLaunchConfigurations方法的典型用法代码示例。如果您正苦于以下问题:Java ILaunchManager.getLaunchConfigurations方法的具体用法?Java ILaunchManager.getLaunchConfigurations怎么用?Java ILaunchManager.getLaunchConfigurations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.debug.core.ILaunchManager
的用法示例。
在下文中一共展示了ILaunchManager.getLaunchConfigurations方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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);
}
}
示例3: 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;
}
}
示例4: 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;
}
}
示例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_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;
}
}
示例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_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;
}
}
示例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_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;
}
}
示例8: 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;
}
示例9: 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;
}
示例10: findConfig
import org.eclipse.debug.core.ILaunchManager; //导入方法依赖的package包/类
/**
* Looks for and returns an existing {@link ILaunchConfiguration} object for a
* specified project.
* @param manager The {@link ILaunchManager}.
* @param type The {@link ILaunchConfigurationType}.
* @param projectName The name of the project
* @return an existing <code>ILaunchConfiguration</code> object matching the project, or
* <code>null</code>.
*/
public static ILaunchConfiguration findConfig(ILaunchManager manager,
ILaunchConfigurationType type, String projectName) {
try {
ILaunchConfiguration[] configs = manager.getLaunchConfigurations(type);
for (ILaunchConfiguration config : configs) {
if (config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "")
.equals(projectName)) { //$NON-NLS-1$
return config;
}
}
} catch (CoreException e) {
MessageDialog.openError(Display.getCurrent().getActiveShell(),
"Launch Error", e.getStatus().getMessage());
}
// didn't find anything that matches. Return null
return null;
}
示例11: 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;
}
示例12: 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;
}
示例13: getLaunchConfigurations
import org.eclipse.debug.core.ILaunchManager; //导入方法依赖的package包/类
/**
* @param typeIds launch configuration type ids that will be searched for, or
* empty to match all
* @throws CoreException
*/
public static List<ILaunchConfiguration> getLaunchConfigurations(
IProject project, String... typeIds) throws CoreException {
Set<String> setOfTypeIds = new HashSet<String>(Arrays.asList(typeIds));
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
List<ILaunchConfiguration> launchConfigs = new ArrayList<ILaunchConfiguration>();
for (ILaunchConfiguration launchConfig : manager.getLaunchConfigurations()) {
IJavaProject javaProject = getJavaProject(launchConfig);
boolean typeIdIsOk = setOfTypeIds.isEmpty()
|| setOfTypeIds.contains(launchConfig.getType().getIdentifier());
if (javaProject != null && project.equals(javaProject.getProject())
&& typeIdIsOk) {
launchConfigs.add(launchConfig);
}
}
return launchConfigs;
}
示例14: removeLaunchConfig
import org.eclipse.debug.core.ILaunchManager; //导入方法依赖的package包/类
private static void removeLaunchConfig(String launchConfigName) throws Exception {
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
try {
ILaunchConfiguration[] launchConfigs = manager.getLaunchConfigurations();
for (ILaunchConfiguration launchConfig : launchConfigs) {
if (launchConfig.getName().equals(launchConfigName)) {
launchConfig.delete();
break;
}
}
} catch (CoreException e) {
GWTPluginLog.logError(e);
throw new Exception("Could not remove existing Java launch configuration");
}
}
示例15: findConfigurationByName
import org.eclipse.debug.core.ILaunchManager; //导入方法依赖的package包/类
public static ILaunchConfiguration findConfigurationByName(String name) {
try {
String configTypeStr = WebAppLaunchConfiguration.TYPE_ID;
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType typeid = launchManager.getLaunchConfigurationType(configTypeStr);
ILaunchConfiguration[] configs = launchManager.getLaunchConfigurations(typeid);
for (ILaunchConfiguration config : configs) {
if (config.getName().equals(name)) {
return config;
}
}
} catch (CoreException e) {
CorePluginLog.logError(e);
}
return null;
}