当前位置: 首页>>代码示例>>Java>>正文


Java ISourceLocator类代码示例

本文整理汇总了Java中org.eclipse.debug.core.model.ISourceLocator的典型用法代码示例。如果您正苦于以下问题:Java ISourceLocator类的具体用法?Java ISourceLocator怎么用?Java ISourceLocator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ISourceLocator类属于org.eclipse.debug.core.model包,在下文中一共展示了ISourceLocator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRunningLaunchConfiguration

import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
private ILaunchConfiguration getRunningLaunchConfiguration() {
	Set<IProject> projects = new HashSet<IProject>(
			Arrays.asList(ProjectUtil.getProjects(repository)));

	ILaunchManager launchManager = DebugPlugin.getDefault()
			.getLaunchManager();
	ILaunch[] launches = launchManager.getLaunches();
	for (ILaunch launch : launches) {
		if (launch.isTerminated())
			continue;
		ISourceLocator locator = launch.getSourceLocator();
		if (locator instanceof ISourceLookupDirector) {
			ISourceLookupDirector director = (ISourceLookupDirector) locator;
			ISourceContainer[] containers = director.getSourceContainers();
			if (isAnyProjectInSourceContainers(containers, projects))
				return launch.getLaunchConfiguration();
		}
	}
	return null;
}
 
开发者ID:Genuitec,项目名称:gerrit-tools,代码行数:21,代码来源:BranchOperationUI.java

示例2: read

import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
private ISourceLookupDirector read(ILaunchConfiguration config) throws CoreException {
  String memento = config.getAttribute(
      ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, (String)null);
  if (memento == null) {
    return null;
  }
  String type = config.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String)null);
  if (type == null) {
    type = config.getType().getSourceLocatorId();
  }
  ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
  ISourceLocator locator = launchManager.newSourceLocator(type);
  if (locator instanceof IPersistableSourceLocator2 == false) {
    return null;
  }
  ISourceLookupDirector director = (ISourceLookupDirector) locator;
  director.initializeFromMemento(memento, config);
  return director;
}
 
开发者ID:jbosstools,项目名称:chromedevtools,代码行数:20,代码来源:ChromiumRemoteTab.java

示例3: createGdbLaunchDelegate

import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
@Override
protected GdbLaunchDelegateExtension createGdbLaunchDelegate() {
	return new GdbLaunchDelegateExtension() {
		@Override
		protected GdbLaunch createGdbLaunch(ILaunchConfiguration configuration, String mode, ISourceLocator locator)
				throws CoreException {
			return doCreateGdbLaunch(configuration, mode, locator);
		}
		
		@Override
		protected LangDebugServicesExtensions createServicesExtensions(
				IDsfDebugServicesFactory parentServiceFactory) {
			return new GoDebugServicesExtensions(parentServiceFactory);
		};
	};
}
 
开发者ID:GoClipse,项目名称:goclipse,代码行数:17,代码来源:GoDebugLaunchConfigurationDelegate.java

示例4: runVM

import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的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

示例5: handleDebugEvents

import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
public void handleDebugEvents(DebugEvent[] events) {
	if(events.length > 0 && runtime != null && !runtime.isTerminated()) {
		DebugEvent e = events[0];
		PandionJUI.executeUpdate(() -> {
			if(e.getKind() == DebugEvent.SUSPEND && e.getDetail() == DebugEvent.STEP_END && exception == null) {
				IJavaThread thread = (IJavaThread) e.getSource();		
				IStackFrame f = thread.getTopStackFrame();
				if(f == null)
					return;
				ISourceLocator sourceLocator = f.getLaunch().getSourceLocator();
				Object sourceElement = sourceLocator == null ? null : sourceLocator.getSourceElement(f);

				if(sourceElement != null) {
					if(sourceElement instanceof IFile)
						handleFrames(thread);
					else
						thread.stepReturn();
					if(f != null && f.getLineNumber() == -1)
						thread.resume(); // to jump over injected code
				}
				else {
					thread.stepReturn();
				}

				//						Job job = Job.create("Update table", (ICoreRunnable) monitor -> {
				//							System.out.println("STEP");
				//							thread.stepInto();
				//						});
				//						job.schedule(3000);

			}
			else if(e.getKind() == DebugEvent.CHANGE && e.getDetail() == DebugEvent.CONTENT) {
				runtime = new RuntimeModel();
				runtimeView.setInput(runtime);
			}
			else if(e.getKind() == DebugEvent.TERMINATE && e.getSource() instanceof RuntimeProcess) {
				runtime.setTerminated();
			}
		});
	}
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:42,代码来源:PandionJView.java

示例6: getSourceLocator

import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
@Override
public ISourceLocator getSourceLocator() {
	return sourceLocator;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:5,代码来源:MockLaunch.java

示例7: setSourceLocator

import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
@Override
public void setSourceLocator(ISourceLocator locator) {
	sourceLocator = locator;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:5,代码来源:MockLaunch.java

示例8: TestLaunch

import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
public TestLaunch( ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator ) {
  super( launchConfiguration, mode, locator );
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:4,代码来源:TestLaunch.java

示例9: getSourceLocator

import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
public ISourceLocator getSourceLocator() {
  return null;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:4,代码来源:MockILaunch.java

示例10: setSourceLocator

import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
public void setSourceLocator(ISourceLocator sourceLocator) {
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:3,代码来源:MockILaunch.java

示例11: getSourceLocator

import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
@Override
protected ISourceLocator getSourceLocator(ILaunchConfiguration configuration, DsfSession session)
		throws CoreException {
	return super.getSourceLocator(configuration, session);
}
 
开发者ID:GoClipse,项目名称:goclipse,代码行数:6,代码来源:GdbLaunchDelegateExtension.java

示例12: createGdbLaunch

import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
@Override
protected GdbLaunch createGdbLaunch(ILaunchConfiguration configuration, String mode,
		ISourceLocator locator) throws CoreException {
	return doCreateGdbLaunch(configuration, mode, locator);
}
 
开发者ID:GoClipse,项目名称:goclipse,代码行数:6,代码来源:AbstractLangDebugLaunchConfigurationDelegate.java

示例13: doCreateGdbLaunch

import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
protected abstract GdbLaunch doCreateGdbLaunch(ILaunchConfiguration configuration, String mode,
ISourceLocator locator);
 
开发者ID:GoClipse,项目名称:goclipse,代码行数:3,代码来源:AbstractLangDebugLaunchConfigurationDelegate.java

示例14: doCreateGdbLaunch

import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
@Override
protected GdbLaunch doCreateGdbLaunch(ILaunchConfiguration configuration, String mode, ISourceLocator locator) {
	return new GoGdbLaunch(configuration, mode, locator);
}
 
开发者ID:GoClipse,项目名称:goclipse,代码行数:5,代码来源:GoDebugLaunchConfigurationDelegate.java

示例15: GoGdbLaunch

import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
protected GoGdbLaunch(ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator) {
	super(launchConfiguration, mode, locator);
}
 
开发者ID:GoClipse,项目名称:goclipse,代码行数:4,代码来源:GoGdbLaunch.java


注:本文中的org.eclipse.debug.core.model.ISourceLocator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。