org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector Java Examples

The following examples show how to use org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LangSourceLookupDirector.java    From goclipse with Eclipse Public License 1.0 6 votes vote down vote up
protected ISourceLookupDirector getSourceLookupDirector() {
	ISourceLookupDirector commonSourceLookupDirector = new AbstractSourceLookupDirector() {
		@Override
		public void initializeParticipants() {
		}
	};
	
	ArrayList2<ISourceContainer> containers = new ArrayList2<>();
	containers.add(new LangAbsolutePathSourceContainer());
	containers.add(new ProgramRelativePathSourceContainer());
	
	customizeDefaultSourceContainers(containers);
	commonSourceLookupDirector.setSourceContainers(containers.toArray(ISourceContainer.class));
	
	return commonSourceLookupDirector;
}
 
Example #2
Source File: XtendFileHyperlink.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void linkActivated() {
  try {
    try {
      ILaunch _launch = this.getLaunch();
      ISourceLocator _sourceLocator = null;
      if (_launch!=null) {
        _sourceLocator=_launch.getSourceLocator();
      }
      final ISourceLocator l = _sourceLocator;
      boolean _matched = false;
      if (l instanceof AbstractSourceLookupDirector) {
        _matched=true;
        final Object result = ((AbstractSourceLookupDirector)l).getSourceElement(this.fileName);
        boolean _matched_1 = false;
        if (result instanceof IFile) {
          _matched_1=true;
          final IEditorPart editor = IDE.openEditor(this.workbench.getActiveWorkbenchWindow().getActivePage(), ((IFile)result));
          boolean _matched_2 = false;
          if (editor instanceof XtextEditor) {
            _matched_2=true;
            final IRegion region = ((XtextEditor)editor).getDocument().getLineInformation((this.lineNumber - 1));
            ((XtextEditor)editor).selectAndReveal(region.getOffset(), region.getLength());
          }
        }
      }
    } catch (final Throwable _t) {
      if (_t instanceof NumberFormatException) {
      } else {
        throw Exceptions.sneakyThrow(_t);
      }
    }
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}