Java 类org.eclipse.debug.core.sourcelookup.IPersistableSourceLocator2 实例源码

项目:chromedevtools    文件:ChromiumRemoteTab.java   
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;
}