Bug 19972 - CompareEditorInput should not call OpenStrategy.setOpenMethod
Summary: CompareEditorInput should not call OpenStrategy.setOpenMethod
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 critical (vote)
Target Milestone: 2.0 F3   Edit
Assignee: Erich Gamma CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-11 22:26 EDT by Nick Edgar CLA
Modified: 2002-06-13 05:41 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2002-06-11 22:26:34 EDT
Build 20020611

I got in a situation today where I had single-click behaviour in the Navigator 
and Packages view even though I did not change the preference.
The chief suspect is the call to OpenStrategy.setOpenMethod in 
CompareEditorInput.

I do not have a repeatable case, but Dejan tells me he saw it today as well, 
and he was also using Compare extensively.

Even if this problem did not occur, it seems dubious to override the user's 
preference.
Comment 1 Nick Edgar CLA 2002-06-11 23:35:41 EDT
Steps to reproduce this:
- open Sync view as a fast view
- do a sync to release some changes
- release them, clearing the sync view's panes
- click on a part which does not take focus to dismiss the sync view, such as 
an Outline view when there are no open editors, or an empty editor area

Workaround:
- Workbench / Preferences / Workbench 
- select Open mode / Single Click
- Apply
- select Open mode / Double Click
- OK
Comment 2 Erich Gamma CLA 2002-06-12 04:39:32 EDT
This is a workaround to avoid that right clicking to pop-up a menu triggers the 
compare. This is critical since when you have a large zip that you just want to 
commit there was no way to do so without triggering the diff. The OpenStrategy 
handles this case in single click mode.

The open strategy is set on focus and reset when the focus is lost, so this 
means that a focus lost event must have been missed.

We should investigate when this can happen. If this cannot be tracked down then
there are two options:
- rollback the old behaviour, then the zip problem will show up again
- have the compare view honor the open strategy, which would require users to 
double click to trigger a diff when single click mode isn't set.

We will not be able to address this for F3
Comment 3 Nick Edgar CLA 2002-06-12 09:57:36 EDT
Please bump up priority as I consider this a stop ship.

Another option is for us to provide API which will allow you to use single 
click mode without changing the global strategy.
Comment 4 Dirk Baeumer CLA 2002-06-12 11:07:42 EDT
Here is a reproducable test case:

- load a project from a repository
- do some change to a file
- select that file
- synchronize the file with repository 
- make sync view a fast view
- synchronize the file again with repository
  observe:
  the synchronize view pops up and is activated (added code to trace activation
  and deactivation in CompareEditorInput).
- now select the file you synchronized
  observe:
  you receive a second activate event which reads the changed open strategy 
  mode. As a result single click gets restored on a deactivate.
Comment 5 Dirk Baeumer CLA 2002-06-12 12:29:41 EDT
The problem is that we end up having more than one listener changing the open
mode which makes is hard to guaruntee that in all cases we restore the value
of the open mode to its original value. 

The fix is that we fully honor the open mode strategy in compare and don't 
change the mode behinde the scenes. Additionally we add an Open action to the 
context menu.

This make compare consistent with the rest of the platform.
Comment 6 Dirk Baeumer CLA 2002-06-12 12:33:31 EDT
Discussed fix with Erich and we agree to fix it this way
Comment 7 Dirk Baeumer CLA 2002-06-12 12:57:26 EDT
Removed code that manipulates the OpenStrategy. Added code that structure 
compare pane (the one on the right hand side) works on single click. This is no 
problem since the file is loaded from the repository already.
Comment 8 Dirk Baeumer CLA 2002-06-12 13:29:33 EDT
It is not possible to add an open action since the viewer in the left pane is 
unknown for comapre. It is provided by team. If we want an open action, team 
must provide one.
Comment 9 Dirk Baeumer CLA 2002-06-12 14:44:05 EDT
Fixed as proposed for build input 20020612a. 

Fixed reviewed by Adam Kiezun
Comment 10 Dirk Baeumer CLA 2002-06-13 05:41:57 EDT
Verified. TB