本文整理汇总了Java中org.eclipse.debug.ui.DebugUITools.getLaunchGroup方法的典型用法代码示例。如果您正苦于以下问题:Java DebugUITools.getLaunchGroup方法的具体用法?Java DebugUITools.getLaunchGroup怎么用?Java DebugUITools.getLaunchGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.debug.ui.DebugUITools
的用法示例。
在下文中一共展示了DebugUITools.getLaunchGroup方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: launch
import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
/**
* Launch a resource. Try to launch using a launch configuration. Used for contextual launches
*
* @param file
* source file
* @param firstInstruction
* the first {@link EObject instruction}
* @param mode
* launch mode
*/
public void launch(final IResource file, EObject firstInstruction, final String mode) {
if (file instanceof IFile) {
prepareLaunch(file, firstInstruction, mode);
try {
ILaunchConfiguration[] configurations = getLaunchConfigurations(file);
if (configurations.length == 0) {
// try to create a launch configuration
configurations = createLaunchConfiguration(file, firstInstruction, mode);
}
// launch
if (configurations.length == 1) {
configurations[0].launch(mode, new NullProgressMonitor());
} else {
// more than one configuration applies
// open launch dialog for selection
final ILaunchGroup group = DebugUITools.getLaunchGroup(configurations[0], mode);
DebugUITools.openLaunchConfigurationDialogOnGroup(PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell(),
new StructuredSelection(configurations[0]), group.getIdentifier(), null);
}
} catch (CoreException e) {
// could not create launch configuration, run file directly
// try {
// launch(firstInstruction, null, mode, null, new NullProgressMonitor());
// } catch (CoreException e1) {
Activator.getDefault().error(e);
// }
}
}
}
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:45,代码来源:AbstractDSLLaunchConfigurationDelegateUI.java
示例2: createLaunchConfiguration
import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的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: createLaunchConfiguration
import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
@Override
protected final ILaunchConfiguration[] createLaunchConfiguration(IResource file, EObject firstInstruction, String mode)
throws CoreException {
ILaunchConfiguration[] launchConfigs = super.createLaunchConfiguration(file, firstInstruction, mode);
if (launchConfigs.length == 1) {
// open configuration for further editing
if (launchConfigs[0] instanceof ILaunchConfigurationWorkingCopy) {
ILaunchConfigurationWorkingCopy configuration = (ILaunchConfigurationWorkingCopy) launchConfigs[0];
String selectedLanguage = configuration.getAttribute(RunConfiguration.LAUNCH_SELECTED_LANGUAGE, "");
if (selectedLanguage.equals("")) {
// TODO try to infer possible language and other attribute
// from project content and environment
setDefaultsLaunchConfiguration(configuration);
final ILaunchGroup group = DebugUITools.getLaunchGroup(configuration, mode);
if (group != null) {
ILaunchConfiguration savedLaunchConfig = configuration.doSave();
// open configuration for user validation and inputs
DebugUITools.openLaunchConfigurationDialogOnGroup(PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell(), new StructuredSelection(savedLaunchConfig),
group.getIdentifier(), null);
// DebugUITools.openLaunchConfigurationDialog(PlatformUI.getWorkbench()
// .getActiveWorkbenchWindow().getShell(),
// savedLaunchConfig, group.getIdentifier(), null);
}
}
}
}
return launchConfigs;
}
示例4: computeLaunchGroup
import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
public ILaunchGroup computeLaunchGroup() {
ILaunchGroup result = null;
ILaunchMode launchMode = computeLaunchMode();
if( launchMode != null ) {
result = DebugUITools.getLaunchGroup( launchConfig, launchMode.getIdentifier() );
}
return result;
}
示例5: getLastLaunchConfig
import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
private ILaunchConfiguration getLastLaunchConfig( ILaunchConfiguration launchConfig ) {
ILaunchConfiguration result = null;
if( launchMode != null ) {
ILaunchGroup launchGroup = DebugUITools.getLaunchGroup( launchConfig, launchMode.getIdentifier() );
if( launchGroup != null ) {
result = DebugUITools.getLastLaunch( launchGroup.getIdentifier() );
}
}
return result;
}