本文整理汇总了Java中org.eclipse.debug.core.ILaunchConfigurationType类的典型用法代码示例。如果您正苦于以下问题:Java ILaunchConfigurationType类的具体用法?Java ILaunchConfigurationType怎么用?Java ILaunchConfigurationType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ILaunchConfigurationType类属于org.eclipse.debug.core包,在下文中一共展示了ILaunchConfigurationType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: launchFile
import org.eclipse.debug.core.ILaunchConfigurationType; //导入依赖的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
}
示例2: getLaunchConfiguration
import org.eclipse.debug.core.ILaunchConfigurationType; //导入依赖的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;
}
示例3: toLaunchConfiguration
import org.eclipse.debug.core.ILaunchConfigurationType; //导入依赖的package包/类
/**
* Converts a {@link TestConfiguration} to an {@link ILaunchConfiguration}. Will throw a {@link WrappedException} in
* case of error.
*
* @see TestConfiguration#readPersistentValues()
*/
public ILaunchConfiguration toLaunchConfiguration(ILaunchConfigurationType type, TestConfiguration testConfig) {
try {
final ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager()
.getLaunchConfigurations(type);
for (ILaunchConfiguration config : configs) {
if (equals(testConfig, config))
return config;
}
final IContainer container = null;
final ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(container, testConfig.getName());
workingCopy.setAttributes(testConfig.readPersistentValues());
return workingCopy.doSave();
} catch (Exception e) {
throw new WrappedException("could not convert N4JS TestConfiguration to Eclipse ILaunchConfiguration", e);
}
}
示例4: toLaunchConfiguration
import org.eclipse.debug.core.ILaunchConfigurationType; //导入依赖的package包/类
/**
* Converts a {@link RunConfiguration} to an {@link ILaunchConfiguration}. Will throw a {@link WrappedException} in
* case of error.
*
* @see RunConfiguration#readPersistentValues()
*/
public ILaunchConfiguration toLaunchConfiguration(ILaunchConfigurationType type, RunConfiguration runConfig) {
try {
final ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager()
.getLaunchConfigurations(type);
for (ILaunchConfiguration config : configs) {
if (equals(runConfig, config))
return config;
}
final IContainer container = null;
final ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(container, runConfig.getName());
workingCopy.setAttributes(runConfig.readPersistentValues());
return workingCopy.doSave();
} catch (Exception e) {
throw new WrappedException("could not convert N4JS RunConfiguration to Eclipse ILaunchConfiguration", e);
}
}
示例5: getRunnerId
import org.eclipse.debug.core.ILaunchConfigurationType; //导入依赖的package包/类
/**
* Read the N4JS runner ID from the given Eclipse launch configuration. Will throw exceptions if 'failFast' is
* <code>true</code>, otherwise will return <code>null</code> in case of error.
*/
public static String getRunnerId(ILaunchConfiguration launchConfig, boolean failFast) {
try {
// 1) simple case: runnerId already defined in launchConfig
final String id = launchConfig.getAttribute(RunConfiguration.RUNNER_ID, (String) null);
if (id != null)
return id;
// 2) tricky case: not set yet, so have to go via the ILaunchConfigurationType or the launchConfig
final ILaunchConfigurationType launchConfigType = launchConfig.getType();
return getRunnerId(launchConfigType, failFast);
} catch (CoreException e) {
if (failFast)
throw new WrappedException(e);
return null;
}
}
示例6: execute
import org.eclipse.debug.core.ILaunchConfigurationType; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.sirius.tools.api.ui.IExternalJavaAction#execute(java.util.Collection, java.util.Map)
*/
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
final ILaunchConfigurationType launchConfigType = DebugPlugin.getDefault().getLaunchManager()
.getLaunchConfigurationType(getLaunchConfigurationTypeID());
Set<String> modes = new HashSet<String>();
modes.add("debug");
try {
ILaunchDelegate[] delegates = launchConfigType.getDelegates(modes);
if (delegates.length != 0
&& delegates[0].getDelegate() instanceof AbstractDSLLaunchConfigurationDelegateUI) {
AbstractDSLLaunchConfigurationDelegateUI delegate = (AbstractDSLLaunchConfigurationDelegateUI)delegates[0]
.getDelegate();
delegate.launch(delegate.getLaunchableResource(PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage().getActiveEditor()),
getFirstInstruction(selections), "debug");
}
} catch (CoreException e) {
DebugSiriusIdeUiPlugin.getPlugin().getLog().log(
new Status(IStatus.ERROR, DebugSiriusIdeUiPlugin.ID, e.getLocalizedMessage(), e));
}
}
示例7: cleanWorkspace
import org.eclipse.debug.core.ILaunchConfigurationType; //导入依赖的package包/类
public static void cleanWorkspace() throws CoreException {
IProject[] projects = getRoot().getProjects();
deleteProjects(projects);
IProject[] otherProjects = getRoot().getProjects(IContainer.INCLUDE_HIDDEN);
deleteProjects(otherProjects);
ILaunchConfigurationType configType = DebugPlugin.getDefault().getLaunchManager()
.getLaunchConfigurationType(GW4ELaunchShortcut.GW4ELAUNCHCONFIGURATIONTYPE);
ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager()
.getLaunchConfigurations(configType);
for (int i = 0; i < configs.length; i++) {
ILaunchConfiguration config = configs[i];
config.delete();
}
}
示例8: addLaunchCfg
import org.eclipse.debug.core.ILaunchConfigurationType; //导入依赖的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);
}
}
示例9: createConfiguration
import org.eclipse.debug.core.ILaunchConfigurationType; //导入依赖的package包/类
/**
* Creates and returns a new configuration based on the specified type.
*
* @param additionalScope additional scope which can be given
* @param type
* type to create a launch configuration for
*
* @return launch configuration configured to launch the specified type
*/
protected ILaunchConfiguration createConfiguration(IResource resource, Object additionalScope) {
ILaunchConfiguration config = null;
ILaunchConfigurationWorkingCopy wc = null;
try {
String projectName = createGradleProjectName(resource);
String proposal = createLaunchConfigurationNameProposal(projectName, resource, additionalScope);
ILaunchConfigurationType configType = getConfigurationType();
wc = configType.newInstance(null, getLaunchManager().generateLaunchConfigurationName(proposal));
createCustomConfiguration(resource, additionalScope, wc, projectName);
config = wc.doSave();
} catch (CoreException exception) {
MessageDialog.openError(EclipseUtil.getActiveWorkbenchShell(), "EGradle create configuration failed",
exception.getStatus().getMessage());
}
return config;
}
示例10: createMavenPackagingLaunchConfiguration
import org.eclipse.debug.core.ILaunchConfigurationType; //导入依赖的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
示例11: checkConflictingLaunches
import org.eclipse.debug.core.ILaunchConfigurationType; //导入依赖的package包/类
@VisibleForTesting
void checkConflictingLaunches(ILaunchConfigurationType launchConfigType, String mode,
DefaultRunConfiguration runConfig, ILaunch[] launches) throws CoreException {
for (ILaunch launch : launches) {
if (launch.isTerminated()
|| launch.getLaunchConfiguration() == null
|| launch.getLaunchConfiguration().getType() != launchConfigType) {
continue;
}
IServer otherServer = ServerUtil.getServer(launch.getLaunchConfiguration());
DefaultRunConfiguration otherRunConfig =
generateServerRunConfiguration(launch.getLaunchConfiguration(), otherServer, mode);
IStatus conflicts = checkConflicts(runConfig, otherRunConfig,
new MultiStatus(Activator.PLUGIN_ID, 0,
Messages.getString("conflicts.with.running.server", otherServer.getName()), //$NON-NLS-1$
null));
if (!conflicts.isOK()) {
throw new CoreException(StatusUtil.filter(conflicts));
}
}
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:23,代码来源:LocalAppEngineServerLaunchConfigurationDelegate.java
示例12: getConfigurations
import org.eclipse.debug.core.ILaunchConfigurationType; //导入依赖的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;
}
}
示例13: getConfigurations
import org.eclipse.debug.core.ILaunchConfigurationType; //导入依赖的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;
}
}
示例14: getConfigurations
import org.eclipse.debug.core.ILaunchConfigurationType; //导入依赖的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;
}
}
示例15: getConfigurations
import org.eclipse.debug.core.ILaunchConfigurationType; //导入依赖的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;
}
}