Bug 18316 Status line update when selecting task in task list
The following code snippet is executes by the CompilationUnitEditor when pressing the Next/Previous Problem buttons in the toolbar and also when using the keyboard shortcuts Ctrl+E/P. In the first case, the task list selection is updated and the status line is changed. In the second case, the status line is cleared. (The method setStatusLineErrorMessage calls setErrorMessage of the status line manager.) if (marker != null) { IWorkbenchPage page= getSite().getPage(); IViewPart view= view= page.findView("org.eclipse.ui.views.TaskList"); // $NON-NLS-1$ if (view instanceof TaskList) { StructuredSelection ss= new StructuredSelection(marker); ((TaskList) view).setSelection(ss, true); } } selectAndReveal(errorPosition.getOffset(), errorPosition.getLength()); setStatusLineErrorMessage(nextError.getMessage());
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
if (caret == selection.x)
					text.setSelectionRange(selection.y, offset - selection.y);
				else
					text.setSelectionRange(selection.x, offset - selection.x);		
			}
		}
	}
	/**
	 * Quick format action to format the enclosing java element.
	 * <p>
	 * The quick format action works as follows:
	 * <ul>
	 * <li>If there is no selection and the caret is positioned on a Java element,
	 * only this element is formatted. If the element has some accompanying comment,
	 * then the comment is formatted as well.</li>
	 * <li>If the selection spans one or more partitions of the document, then all
	 * partitions covered by the selection are entirely formatted.</li>
	 * <p>
	 * Partitions at the end of the selection are not completed, except for comments.
	 * 
	 * @since 3.0
	 */
	protected class QuickFormatAction extends Action {
		/*
		 * @see org.eclipse.jface.action.IAction#run()
		 */
		public void run() {
			final JavaSourceViewer viewer= (JavaSourceViewer) getSourceViewer();
			if (viewer.isEditable()) {
				final Point selection= viewer.rememberSelection();