Bug 107719 - Filters on XRef View clear view when focus is lost from the editor part
Summary: Filters on XRef View clear view when focus is lost from the editor part
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.2.1   Edit
Assignee: Helen Beeken CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-23 09:11 EDT by Ben Dalziel CLA
Modified: 2005-08-25 11:55 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Dalziel CLA 2005-08-23 09:11:46 EDT
When applying filters to the Cross References view, it clears the view if the
part focus is not the editor for the file to which the cross references apply.

For examplem, if you are looking at a file in an editor, the cross references
view will have a tree, even if it is a single branch, i.e. no relationships.
Now click into the Cross References view so that the part tab becomes highlighted.

Being careful not to click out of the Cross References View, bring up the View
Menu from the drop down button in the Cross References toolbar and select the
'Filters...' button. In the presented dialog, check a relationship checkbox and
click OK.

The Cross References View is now emptied.  This should not happen.
Comment 1 Helen Beeken CLA 2005-08-23 11:53:19 EDT
From Ben's investigation, when the xref view is refreshed from the filter dialog
it goes through the runInUIThread(..) in XReferenceViewUpdateJob (this is also
used to update the xref view after a build). In the case described when the bug
was raised, the ISelection was an IStructuredSelection and the IWorkbenchPart
was the last active editor. Therefore, when following through the logic and
trying to calcualte the xrefs, an empty list was being returned because the
selection wasn't a text selection. 

The fix is to check that if the last active editor is equal to the last editor
recorded in the xref view, then to use the corresponding last selection (the
xref view keeps a record of the last selection and last selected workbench
part). Otherwise, retrieve the current selection. This keeps together the
workbench part and selection which is what should happen - they shouldn't get
out of sync.
Comment 2 Helen Beeken CLA 2005-08-24 05:56:31 EDT
XReferenceViewUpdateJob was created for bug 84317 to enable the xref view to
update after a build. This is currently the only other mechanism which uses this
so we have to make sure that the fix here doesn't break that. Unfortunately,
I've been unable to find any tests for bug 84317 :-( so I'm writing those before
applying this fix. 
Comment 3 Helen Beeken CLA 2005-08-25 09:57:15 EDT
It turns out that the fix for this bug also fixes bug 107589. Bug 107589 is a
serious problem, therefore I've integrated the fix. Just waiting for a clean
build containing this fix to close the bug.
Comment 4 Helen Beeken CLA 2005-08-25 11:42:37 EDT
The fix can be found in the AJDT 1.3 stream:

BUILD COMPLETE -  build.81
Date of build: 08/25/2005 14:57:05
Time to build: 34 minutes 29 seconds
Last changed: 08/25/2005 14:41:37
Last log entry: fix and manual tests for bugs 107719 and 107589 (same fix for
both bugs)

It's also been integrated into the following AJDT 1.2 build:

BUILD COMPLETE -  build.513
Date of build: 08/25/2005 15:32:57
Time to build: 32 minutes 7 seconds
Last changed: 08/25/2005 15:06:14
Last log entry: fix and manual tests for bugs 107589 and 197719 (same fix for
both bugs)

Therefore, closing this bug as fixed.