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


Java DebugUITools.setLaunchPerspective方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:rajendarreddyj,項目名稱:eclipse-weblogic-plugin,代碼行數:53,代碼來源:WeblogicLauncher.java

示例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();

}
 
開發者ID:eclipse,項目名稱:cft,代碼行數:35,代碼來源:ApplicationDebugUILauncher.java

示例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;
	}

}
 
開發者ID:osswangxining,項目名稱:dockerfoundry,代碼行數:35,代碼來源:DebugCommand.java


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