本文整理汇总了Java中org.eclipse.debug.ui.DebugUITools.setLaunchPerspective方法的典型用法代码示例。如果您正苦于以下问题:Java DebugUITools.setLaunchPerspective方法的具体用法?Java DebugUITools.setLaunchPerspective怎么用?Java DebugUITools.setLaunchPerspective使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.debug.ui.DebugUITools
的用法示例。
在下文中一共展示了DebugUITools.setLaunchPerspective方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runVM
import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
/**
* @param label
* @param classToLaunch
* @param classpath
* @param bootClasspath
* @param vmArgs
* @param prgArgs
* @param workDir
* @param sourceLocator
* @param debug
* @param showInDebugger
* @throws CoreException
*/
public void runVM(final String label, final String classToLaunch, final String[] classpath, final String[] bootClasspath, final String[] vmArgs,
final String[] prgArgs, final String workDir, final ISourceLocator sourceLocator, final boolean debug, final boolean showInDebugger)
throws CoreException {
final IVMInstall vmInstall = this.getVMInstall();
String mode = ILaunchManager.DEBUG_MODE;
if (debug && classToLaunch.equals(WEBLOGIC_MAIN_CLASS)) {
mode = ILaunchManager.DEBUG_MODE;
} else {
mode = ILaunchManager.RUN_MODE;
}
final IVMRunner vmRunner = vmInstall.getVMRunner(mode);
final ILaunchConfigurationType launchType = DebugPlugin.getDefault().getLaunchManager()
.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
final ILaunchConfigurationWorkingCopy config = launchType.newInstance(null, label);
config.setAttribute(IDebugUIConstants.ATTR_PRIVATE, true);
config.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, "org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector");
DebugUITools.setLaunchPerspective(launchType, mode, IDebugUIConstants.PERSPECTIVE_DEFAULT);
final Launch launch = new Launch(config, mode, sourceLocator);
config.doSave();
if (vmRunner != null) {
final VMRunnerConfiguration vmConfig = new VMRunnerConfiguration(classToLaunch, classpath);
vmConfig.setVMArguments(vmArgs);
vmConfig.setProgramArguments(prgArgs);
if (workDir != null) {
vmConfig.setWorkingDirectory(workDir);
}
if (bootClasspath.length == 0) {
vmConfig.setBootClassPath(null);
} else {
vmConfig.setBootClassPath(bootClasspath);
}
vmRunner.run(vmConfig, launch, null);
}
if (showInDebugger) {
DebugPlugin.getDefault().getLaunchManager().addLaunch(launch);
}
}
示例2: launch
import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
@Override
public void launch(final CloudFoundryApplicationModule appModule, final CloudFoundryServer cloudServer,
final int appInstance, final int remoteDebugPort) throws CoreException {
final AbstractDebugProvider provider = DebugProviderRegistry.getExistingProvider(appModule, cloudServer);
Job job = new Job("Launching debug - " + appModule.getDeployedApplicationName()) { //$NON-NLS-1$
protected IStatus run(IProgressMonitor monitor) {
try {
ILaunchConfiguration launchConfiguration = provider.getLaunchConfiguration(appModule.getLocalModule(), cloudServer.getServer(),
appInstance, remoteDebugPort, monitor);
DebugUITools.launch(launchConfiguration, ILaunchManager.DEBUG_MODE);
DebugUITools.setLaunchPerspective(launchConfiguration.getType(), ILaunchManager.DEBUG_MODE,
IDebugUIConstants.ID_DEBUG_PERSPECTIVE);
fireDebugChanged(cloudServer, appModule, Status.OK_STATUS);
}
catch (OperationCanceledException e) {
// do nothing, debug should be cancelled without error
}
catch (CoreException ce) {
CloudFoundryPlugin.getCallback().displayAndLogError(ce.getStatus());
}
return Status.OK_STATUS;
}
};
job.setSystem(true);
job.setPriority(Job.INTERACTIVE);
job.schedule();
}
示例3: debug
import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
/**
* Launch an application specified by the {@link DebugLaunch} in debug mode.
*/
public void debug(IProgressMonitor monitor) {
try {
if (!launch.isConnectedToDebugger() && launch.configure(monitor)) {
ILaunchConfiguration launchConfiguration = launch.resolveLaunchConfiguration(monitor);
DebugUITools.launch(launchConfiguration, ILaunchManager.DEBUG_MODE);
DebugUITools.setLaunchPerspective(launchConfiguration.getType(), ILaunchManager.DEBUG_MODE,
IDebugUIConstants.ID_DEBUG_PERSPECTIVE);
DebugOperations.fireDebugChanged(launch.getCloudFoundryServer(), launch.getApplicationModule(),
Status.OK_STATUS);
}
}
catch (CoreException ce) {
DebugOperations.fireDebugChanged(launch.getCloudFoundryServer(), launch.getApplicationModule(),
ce.getStatus());
}
catch (Throwable t) {
// Catch other issues with debug launching
IStatus status = DockerFoundryPlugin.getErrorStatus(t);
DebugOperations.fireDebugChanged(launch.getCloudFoundryServer(), launch.getApplicationModule(), status);
// Propagate any other error to allow Eclipse debug
// to handle the error
throw t;
}
}