| de.loskutov.bco.editors.BytecodeDocumentProvider
BytecodeDocumentProvider | public class BytecodeDocumentProvider extends ClassFileDocumentProvider (Code) | | Overriden to get control over document content for bytecode editors
author: Andrei |
Method Summary | |
public IRegion | getDecompiledLineInfo(IEditorInput input, int decompiledLine) | public IDocument | getDocument(Object element) During debug session, debugger tries to get line information for the current line
in the stack, and then uses this info to set cursor and select text in editor.
The problem is, that Java debugger knows only "source" - based lines, but our editor
contains "bytecode" text, where the lines are NOT aligned to the source code lines.
(it is simply not possible).
So if we do not change the default implementation, the selected bytecode text will
never match requested sourcecode lines.
As workaround we "just" pass to the debugger another document, as one we use to
represent the text in our editor. | protected boolean | setDocumentContent(IDocument document, IEditorInput editorInput, String encoding) |
getDecompiledLineInfo | public IRegion getDecompiledLineInfo(IEditorInput input, int decompiledLine)(Code) | | |
getDocument | public IDocument getDocument(Object element)(Code) | | During debug session, debugger tries to get line information for the current line
in the stack, and then uses this info to set cursor and select text in editor.
The problem is, that Java debugger knows only "source" - based lines, but our editor
contains "bytecode" text, where the lines are NOT aligned to the source code lines.
(it is simply not possible).
So if we do not change the default implementation, the selected bytecode text will
never match requested sourcecode lines.
As workaround we "just" pass to the debugger another document, as one we use to
represent the text in our editor. This document is a proxy and just replaces
the implementation of "getLineInformation" method. Our implementation mapps the
requested sourcecode line to the bytecode line in editor.
All other clients of this method shouldn't be affected and should receive always
the original document.
|
setDocumentContent | protected boolean setDocumentContent(IDocument document, IEditorInput editorInput, String encoding) throws CoreException(Code) | | |
|
|