Bug 205548 - "Link with editor" does not work when "Focus on active task" is on and "Show members in Package Explorer" is off
Summary: "Link with editor" does not work when "Focus on active task" is on and "Show ...
Status: VERIFIED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 2000
: P2 major with 2 votes (vote)
Target Milestone: 2.3   Edit
Assignee: Steffen Pingel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-05 03:43 EDT by Mauro Molinari CLA
Modified: 2008-02-29 12:21 EST (History)
1 user (show)

See Also:


Attachments
mylyn/context/zip (2.77 KB, application/octet-stream)
2008-01-11 21:06 EST, Mik Kersten CLA
no flags Details
mylyn/context/zip (8.03 KB, application/octet-stream)
2008-02-20 21:46 EST, Steffen Pingel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mauro Molinari CLA 2007-10-05 03:43:26 EDT
Build ID: M20070921-1145

Steps To Reproduce:
1. make sure that "Show members in Package Explorer" option in Java | Appearance preferences page is unchecked
2. activate a task which has some files in its context
3. make sure that "Focus on active task" is on in the package explorer
3. the "Link with editor" feature does not work: as soon as you click or move in the editor, the selection in the package editor is removed

More information:
If you switch "Focus on active task" off, the "Link with editor" feature perfectly works, selecting the class currently opened in the editor.

NOTE 1: the version I'm using is Mylyn 2.1: there's no such version in "Version" combo box here in Bugzilla

NOTE 2: I'm marking this as a major severity bug because "Link with editor" is a very important feature to me and I'm completely confused by the mess that is created in the Package Explorer when "Show members in Package Explorer" is on and members are automatically exploded by Mylyn.
Comment 1 Mauro Molinari CLA 2007-10-05 04:04:47 EDT
By the way, why "Link with editor" cannot be switched on and off anymore while "Focus on active task" is on? I think the two features should be independent, as they were in Mylyn 2.0...

Please also consider my Comment #1 in bug #204951, where I outlined some other problems I'm encountering with the "Focus on active task" feature in Mylyn 2.1.
Comment 2 Mik Kersten CLA 2007-10-05 22:26:36 EDT
 (In reply to comment #1)
> By the way, why "Link with editor" cannot be switched on and off anymore while
> "Focus on active task" is on? I think the two features should be independent, as
> they were in Mylyn 2.0...

The reason for this is that linking has always been automatically enabled when a view is focused.  So the functionality hasn't changed, just the UI.  The need to disable linking comes from views that many more nodes than they can display, and typically a focused view either won't have a scrollbar, and almost always won't have 2x the nodes that in can display.  
Comment 3 Mauro Molinari CLA 2007-10-09 03:11:48 EDT
(In reply to comment #2)
> The reason for this is that linking has always been automatically enabled when
> a view is focused.  So the functionality hasn't changed, just the UI.  The need
> to disable linking comes from views that many more nodes than they can display,
> and typically a focused view either won't have a scrollbar, and almost always
> won't have 2x the nodes that in can display.  

So, do you mean that when "Focus on active task" is enabled the "Link with Editor" should always be enabled? Because, if you do this:
1) switch "Focus on active task" off
2) switch "Link with Editor" off
3) switch "Focus on active task" on
you get the following situation: "Focus on active task" on with "Link with Editor" off. Moreover, you cannot switch "Link with Editor" on, without previously switch "Focus on active task" off... or, at least, the UI gives you this impression.

Mauro.
Comment 4 Fredrik Vraalsen CLA 2007-10-25 05:58:42 EDT
> So, do you mean that when "Focus on active task" is enabled the "Link with
> Editor" should always be enabled? Because, if you do this:
> 1) switch "Focus on active task" off
> 2) switch "Link with Editor" off
> 3) switch "Focus on active task" on
> you get the following situation: "Focus on active task" on with "Link with
> Editor" off. Moreover, you cannot switch "Link with Editor" on, without
> previously switch "Focus on active task" off... or, at least, the UI gives you
> this impression.

I am unable to get editor linking to work in Package Explorer with Mylyn at all when "Focus on active task" is on, even after switching "Link with Editor" on while "Focus on active task" is off.

When "Focus on active task" is off, linking works as expected.

"Show members in Package Explorer" is on.

This is with Eclipse 3.3.1, Mylyn 2.1.

Comment 5 Eugene Kuleshov CLA 2007-10-25 12:58:49 EDT
I am not sure which side of the linking issue Frederic hit into, but I observe the following behavior:

-- Window / Prferences / General / Open Mode = Doble click
-- Activate "Linking with Editor" in Package Explorer view and open two editors
-- After that if you *single click* on resources for those editors in the Package Explorer, corresponding editor will be selected
-- Now activate some task and try to single click in Package Explorer again. Editors are not selected.
Comment 6 Fredrik Vraalsen CLA 2007-10-26 03:17:20 EDT
(In reply to comment #5)
> I am not sure which side of the linking issue Frederic hit into, but I observe
> the following behavior:
> 
> -- Window / Prferences / General / Open Mode = Doble click
> -- Activate "Linking with Editor" in Package Explorer view and open two editors
> -- After that if you *single click* on resources for those editors in the
> Package Explorer, corresponding editor will be selected
> -- Now activate some task and try to single click in Package Explorer again.
> Editors are not selected.

My Eclipse was set to Open Mode = Double click, and I can confirm that I see exactly the behaviour that Eugene describes above.  

If I change Open Mode to single click I get the behaviour I want when Focus on Active Task is enabled, but I don't really want single click open when Focus on Active Task is disabled.
Comment 7 Mik Kersten CLA 2007-12-19 20:28:20 EST
Fixed as part of bug 204951.  Please try this in tonight's weekly build, available within a few hours.

	http://www.eclipse.org/mylyn/downloads/
Comment 8 Mauro Molinari CLA 2008-01-09 09:30:29 EST
Sorry, it doesn't work for me yet! :-(
Tried with Mylyn 2.2...

If I click on an open editor tab, the file is highlighted in package explorer, but as soon as I click within the editor (for instance to start editing a file), the selection gets lost in package explorer.

This is going to be a nightmare for me, I am forced to always switch "Focus on active task" off...

Mauro.
Comment 9 Mik Kersten CLA 2008-01-11 21:05:55 EST
Mauro: I explored this, and I'm almost certain that the problem is not this bug, but an idiosyncracy of how selections are set in the Package Explorer.  When you first select an element in the file, the element becomes interesting and shows in the view.  At that point it is too late for us to set the selection on it given our current architecture.  However, if you select another method, then go back to the first method, you will notice it get selected.  If not, reopen this bug.  If so, please file a new bug that the Package Explorer selection is lost when first clicking on a member within a Java file.
Comment 10 Mik Kersten CLA 2008-01-11 21:06:00 EST
Created attachment 86745 [details]
mylyn/context/zip
Comment 11 Mauro Molinari CLA 2008-01-14 03:33:05 EST
(In reply to comment #9)
> Mauro: I explored this, and I'm almost certain that the problem is not this
> bug, but an idiosyncracy of how selections are set in the Package Explorer. 
> When you first select an element in the file, the element becomes interesting
> and shows in the view.  At that point it is too late for us to set the
> selection on it given our current architecture.  However, if you select another
> method, then go back to the first method, you will notice it get selected.  If
> not, reopen this bug.  If so, please file a new bug that the Package Explorer
> selection is lost when first clicking on a member within a Java file.

No Mik, it does not work as you say for me... can't you reproduce the behaviour I'm describing?

This is what I do, step by step:

1) activate a task: it has some open files, from the previous task activation session

2) click on a tab of an open file => if the corresponding class is visible in Package Explorer, it gets selected; otherwise, it is shown, but it is not seleceted (sometimes, the containing package gets selected, though, but not always)

This might be what you describe... but this is not so critical, as soon as the selection would be restored...

3) then, if I click in the editor or move the cursor using the keyboard arrow keys, the selection is reset in the package explorer! I can move all around in the file (using either the mouse or the keyboard), click on methods in the outline view, whatever you want... the selection in package explorer is not restored, my class is not selected anymore!

Remember that I have "Show members in Package Explorer" OFF.

If I swith "Focus on active task" off, the "Link with editor" function works as expected.

Moreover, it may be useful for you to know that during my latest trials (I did them to write this reply), I sometimes encountered some other odd behaviours:
1) once, I clicked on an open file that was not visible in Package Explorer, but it was not subsequently shown...

2) why are there some open files (by open file I mean that there's an open editor for them) that are not shown in Package Explorer? It seems that there is a synchronization problem for context information between the open editors and the "Focus on active task" function of Package Explorer, although I thought it was fixed by the resolution of bug #208265...

3) right now, the "Focus on active task" button has disappeared from my Package Explorer toolbar and I don't know why!!!!!  :-( 
I had to restart Eclipse to get it back. It seems a side effect of bug #204951, which should be solved, too.....

Unfortunately, there seem to still be some UI synchronization bug...

Mauro.
Comment 12 Mik Kersten CLA 2008-02-20 20:44:07 EST
Steffen: could you see if you can reproduce this?
Comment 13 Steffen Pingel CLA 2008-02-20 21:46:52 EST
Added a check if the "Show member" flag is enabled on the content provider or not. The preference is in the preferences under Java > Appearance: Show members in Package Explorer.
Comment 14 Steffen Pingel CLA 2008-02-20 21:46:56 EST
Created attachment 90273 [details]
mylyn/context/zip
Comment 15 Mik Kersten CLA 2008-02-26 02:11:09 EST
Excellent.
Comment 16 Mauro Molinari CLA 2008-02-29 06:00:58 EST
IT WORKS!!! :-)

I'm very happy for this, thank you very much Steffen and Mik!

Mauro.
Comment 17 Mik Kersten CLA 2008-02-29 12:21:21 EST
I'm very happy to hear that it looks like we finally have the last cases of this problem ironed out :)