Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 18316 - Status line update when selecting task in task list
Summary: Status line update when selecting task in task list
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 major (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Kai-Uwe Maetzel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 21061 (view as bug list)
Depends on:
Blocks: 13617
  Show dependency tree
 
Reported: 2002-05-30 10:29 EDT by Kai-Uwe Maetzel CLA
Modified: 2003-10-20 12:51 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kai-Uwe Maetzel CLA 2002-05-30 10:29:14 EDT
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());
Comment 1 Nick Edgar CLA 2002-06-11 14:23:53 EDT
If you set a breakpoint in StatusLine.updateMessageLabel(), you will see that 
the status line error message is being cleared by the CompilationUnitEditor's 
fStatusLineClearer.

The stack is as follows when this occurs.  It is calling setErrorMessage(null).

Thread [main] (Suspended (breakpoint at line 498 in 
org.eclipse.jface.action.StatusLine))
	org.eclipse.jface.action.StatusLine.updateMessageLabel() line: 498
	org.eclipse.jface.action.StatusLine.setErrorMessage
(org.eclipse.swt.graphics.Image, java.lang.String) line: 376
	org.eclipse.jface.action.StatusLine.setErrorMessage(java.lang.String) 
line: 365
	org.eclipse.jface.action.StatusLineManager.setErrorMessage
(java.lang.String) line: 96
	org.eclipse.jface.action.SubStatusLineManager.setErrorMessage
(java.lang.String) line: 73
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$1.selectio
nChanged(org.eclipse.jface.viewers.SelectionChangedEvent) line: 779
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSou
rceViewer(org.eclipse.jface.viewers.Viewer).fireSelectionChanged
(org.eclipse.jface.viewers.SelectionChangedEvent) line: 147
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSou
rceViewer(org.eclipse.jface.text.TextViewer).selectionChanged(int, int) line: 
1432
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSou
rceViewer(org.eclipse.jface.text.TextViewer).setSelectedRange(int, int) line: 
1322
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor
(org.eclipse.ui.texteditor.AbstractTextEditor).selectAndReveal(int, int) line: 
2978
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor
(org.eclipse.ui.texteditor.AbstractTextEditor).gotoMarker
(org.eclipse.core.resources.IMarker) line: 2884
	org.eclipse.ui.views.tasklist.TaskList.selectionChanged
(org.eclipse.jface.viewers.SelectionChangedEvent) line: 955
	org.eclipse.ui.views.tasklist.TaskList$6.selectionChanged
(org.eclipse.jface.viewers.SelectionChangedEvent) line: 364
	org.eclipse.jface.viewers.TableViewer
(org.eclipse.jface.viewers.Viewer).fireSelectionChanged
(org.eclipse.jface.viewers.SelectionChangedEvent) line: 147
	org.eclipse.jface.viewers.TableViewer
(org.eclipse.jface.viewers.StructuredViewer).updateSelection
(org.eclipse.jface.viewers.ISelection) line: 1153
	org.eclipse.jface.viewers.TableViewer
(org.eclipse.jface.viewers.StructuredViewer).handleSelect
(org.eclipse.swt.events.SelectionEvent) line: 544
	org.eclipse.jface.viewers.StructuredViewer$1.widgetSelected
(org.eclipse.swt.events.SelectionEvent) line: 568
	org.eclipse.jface.util.OpenStrategy.fireSelectionEvent
(org.eclipse.swt.events.SelectionEvent) line: 171
	org.eclipse.jface.util.OpenStrategy.access$3
(org.eclipse.jface.util.OpenStrategy, org.eclipse.swt.events.SelectionEvent) 
line: 168
	org.eclipse.jface.util.OpenStrategy$1.handleEvent
(org.eclipse.swt.widgets.Event) line: 297
	org.eclipse.swt.widgets.EventTable.sendEvent
(org.eclipse.swt.widgets.Event) line: 75
	org.eclipse.swt.widgets.Table(org.eclipse.swt.widgets.Widget).sendEvent
(org.eclipse.swt.widgets.Event) line: 825
	org.eclipse.swt.widgets.Display.runDeferredEvents() line: 1527
	org.eclipse.swt.widgets.Display.readAndDispatch() line: 1289
	org.eclipse.ui.internal.Workbench.runEventLoop() line: 1177
	org.eclipse.ui.internal.Workbench.run(java.lang.Object) line: 1160
	org.eclipse.core.internal.boot.InternalBootLoader.run
(java.lang.String, java.net.URL, java.lang.String, java.lang.String[], 
java.lang.Runnable) line: 739
	org.eclipse.core.boot.BootLoader.run(java.lang.String, java.net.URL, 
java.lang.String, java.lang.String[]) line: 432
	EclipseRuntimeLauncher.main(java.lang.String[]) line: 24
Comment 2 Dirk Baeumer CLA 2002-06-12 09:04:28 EDT
Candidate for F4
Comment 3 Kai-Uwe Maetzel CLA 2002-09-04 04:53:28 EDT
*** Bug 21061 has been marked as a duplicate of this bug. ***
Comment 4 Tom Hofmann CLA 2003-07-15 13:02:04 EDT
worksforme in 200307100800
Comment 5 Nick Edgar CLA 2003-07-15 14:13:08 EDT
Suggest showing the error message when the text cursor is in an error range,
whether or not it was brought there by Next/Prev Problem.
E.g. mouse click, or arrow keys

I know this info is available via F2, but this feature is not immediately obvious.
Comment 6 Kai-Uwe Maetzel CLA 2003-10-06 11:45:21 EDT
Implemented Nick's proposal. The update of the status line is now done when 
the post selection event occurs. The same is done when explicitly stepping 
through the problems. I am undecided whether I like it better when it happens 
immediately in the latter case. Let me know. Build > 20031006.
Comment 7 Nick Edgar CLA 2003-10-06 14:16:08 EDT
I'll try it out, but when explicitly stepping through problems, chances are I 
would be actively looking at the status line to see the message, and would 
expect it to update immediately.
Comment 8 Martin Aeschlimann CLA 2003-10-08 12:36:30 EDT
verified in 20031007 + new jdt plugins
Comment 9 Dani Megert CLA 2003-10-20 12:51:57 EDT
Note: this behavior was removed shortly before M4 because it caused problems
with the incremental find feature (see bug 45124). This is now fixed starting
I20031021.