本文整理汇总了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;
}
示例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;
}
示例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);
};
};
}
示例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);
}
}
示例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();
}
});
}
}
示例6: getSourceLocator
import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
@Override
public ISourceLocator getSourceLocator() {
return sourceLocator;
}
示例7: setSourceLocator
import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
@Override
public void setSourceLocator(ISourceLocator locator) {
sourceLocator = locator;
}
示例8: TestLaunch
import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
public TestLaunch( ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator ) {
super( launchConfiguration, mode, locator );
}
示例9: getSourceLocator
import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
public ISourceLocator getSourceLocator() {
return null;
}
示例10: setSourceLocator
import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
public void setSourceLocator(ISourceLocator sourceLocator) {
}
示例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);
}
示例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);
}
示例13: doCreateGdbLaunch
import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
protected abstract GdbLaunch doCreateGdbLaunch(ILaunchConfiguration configuration, String mode,
ISourceLocator locator);
示例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);
}
示例15: GoGdbLaunch
import org.eclipse.debug.core.model.ISourceLocator; //导入依赖的package包/类
protected GoGdbLaunch(ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator) {
super(launchConfiguration, mode, locator);
}