mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
[269689] [source lookup] DsfSourceDisplayadapter should respect ISourcePresentation API
This commit is contained in:
parent
30c1dc4f38
commit
486b8d0bde
1 changed files with 34 additions and 18 deletions
|
@ -56,6 +56,7 @@ import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant;
|
|||
import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage;
|
||||
import org.eclipse.debug.ui.DebugUITools;
|
||||
import org.eclipse.debug.ui.IDebugUIConstants;
|
||||
import org.eclipse.debug.ui.ISourcePresentation;
|
||||
import org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditorInput;
|
||||
import org.eclipse.debug.ui.sourcelookup.ISourceDisplay;
|
||||
import org.eclipse.jface.text.BadLocationException;
|
||||
|
@ -192,6 +193,20 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl
|
|||
if (sourceElement == null) {
|
||||
editorInput = new CommonSourceNotFoundEditorInput(dmc);
|
||||
editorId = IDebugUIConstants.ID_COMMON_SOURCE_NOT_FOUND_EDITOR;
|
||||
} else {
|
||||
ISourcePresentation presentation= null;
|
||||
if (fSourceLookup instanceof ISourcePresentation) {
|
||||
presentation = (ISourcePresentation) fSourceLookup;
|
||||
} else {
|
||||
if (dmc != null) {
|
||||
presentation = (ISourcePresentation) dmc.getAdapter(ISourcePresentation.class);
|
||||
}
|
||||
}
|
||||
if (presentation != null) {
|
||||
editorInput = presentation.getEditorInput(sourceElement);
|
||||
if (editorInput != null) {
|
||||
editorId = presentation.getEditorId(editorInput, sourceElement);
|
||||
}
|
||||
} else if (sourceElement instanceof IFile) {
|
||||
editorId = getEditorIdForFilename(((IFile)sourceElement).getName());
|
||||
editorInput = new FileEditorInput((IFile)sourceElement);
|
||||
|
@ -211,6 +226,7 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl
|
|||
editorInput = new FileStoreEditorInput(fileStore);
|
||||
editorId = getEditorIdForFilename(file.getName());
|
||||
}
|
||||
}
|
||||
result.setEditorInput(editorInput);
|
||||
result.setEditorId(editorId);
|
||||
result.setSourceElement(sourceElement);
|
||||
|
|
Loading…
Add table
Reference in a new issue