Java Code Examples for org.eclipse.ui.ide.IDE#gotoMarker()

The following examples show how to use org.eclipse.ui.ide.IDE#gotoMarker() . 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: DsfGdbAdaptor.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
private static void gotoRank(IEditorPart editor, int rank) {
    IEditorInput editorInput = editor.getEditorInput();
    if (editorInput instanceof IFileEditorInput) {
        IFile file = ((IFileEditorInput) editorInput).getFile();
        try {
            final IMarker marker = file.createMarker(IMarker.MARKER);
            marker.setAttribute(IMarker.LOCATION, (Integer) rank);
            IDE.gotoMarker(editor, marker);
            marker.delete();
        } catch (CoreException e) {
            GdbTraceCorePlugin.logError(e.getMessage(), e);
        }
    }
}
 
Example 2
Source File: JavaSearchResultPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void showWithMarker(IEditorPart editor, IFile file, int offset, int length) throws PartInitException {
	try {
		IMarker marker= file.createMarker(NewSearchUI.SEARCH_MARKER);
		HashMap<String, Integer> attributes= new HashMap<String, Integer>(4);
		attributes.put(IMarker.CHAR_START, new Integer(offset));
		attributes.put(IMarker.CHAR_END, new Integer(offset + length));
		marker.setAttributes(attributes);
		IDE.gotoMarker(editor, marker);
		marker.delete();
	} catch (CoreException e) {
		throw new PartInitException(SearchMessages.JavaSearchResultPage_error_marker, e);
	}
}
 
Example 3
Source File: ImpexPageEditor.java    From hybris-commerce-eclipse-plugin with Apache License 2.0 4 votes vote down vote up
public void gotoMarker(IMarker marker) {
	setActivePage(0);
	IDE.gotoMarker(getEditor(0), marker);
}