Bug 20105 - Toolbar buttons for next/prev have no effect
Summary: Toolbar buttons for next/prev have no effect
Status: RESOLVED 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 F4   Edit
Assignee: Dirk Baeumer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 19592 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-06-12 21:27 EDT by Nick Edgar CLA
Modified: 2002-06-18 05:52 EDT (History)
3 users (show)

See Also:


Attachments
Patch that fixes the problem (880 bytes, patch)
2002-06-17 08:51 EDT, Dirk Baeumer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2002-06-12 21:27:17 EDT
F3 build (20020612)

In both the sync view and the compare editor, the Next and Previous toolbar 
buttons have no effect.

The Navigate / Next and Previous menu items go to the next item (they don't 
open the file, but I'm filing a separate PR for that).
Comment 1 Dirk Baeumer CLA 2002-06-13 04:22:05 EDT
Verified that they don't work. However next/prev from the Navigate menu and the 
corresponding short cuts work. Have to investigate why this is so different.

Candiadte for F4
Comment 2 Dirk Baeumer CLA 2002-06-13 04:42:21 EDT
The short cut and the navigate menu only works in the compare editor, they 
don't work in the synchronize view.
Comment 3 Nick Edgar CLA 2002-06-13 11:40:26 EDT
There is a separate PR for the sync view: bug 19942.
Comment 4 Dirk Baeumer CLA 2002-06-14 12:25:29 EDT
*** Bug 19592 has been marked as a duplicate of this bug. ***
Comment 5 Erich Gamma CLA 2002-06-15 04:43:30 EDT
consequence if not fixed: serious usability issue, non working functionality.

The fact that the short cuts don't work in the synchronize view looks like the 
Synchronize view doesn't retarget the action. CCed Kevin.
Comment 6 Erich Gamma CLA 2002-06-16 18:45:32 EDT
The SyncView problem is separate and there is a fix see 19942. 

The problem in the CompareEditor is that the activate editor is not propagated 
to the ToolBar actions. This was introduced in F3. The fix is in 
CompareEditorContributor.setActivePart. Fix is trivial and ready to be released.

public void setActiveEditor(IEditorPart targetEditor) {
				
		//...
		if (fActiveEditorPart != null) {
			IEditorInput input= fActiveEditorPart.getEditorInput();
			if (input instanceof CompareEditorInput) {
				CompareEditorInput compareInput= 
(CompareEditorInput) input;
				fNext.setCompareEditorInput(compareInput);
				fPrevious.setCompareEditorInput(compareInput);
                                // fix for 20105
                                fToolbarNext.setCompareEditorInput
(compareInput);
                                fToolbarPrevious.setCompareEditorInput
(compareInput);
			}
		}

Comment 7 Dirk Baeumer CLA 2002-06-17 05:46:16 EDT
Enclosed the path that fixes the problem

Index: CompareEditorContributor.java
===================================================================
RCS 
file: /home/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/Com
pareEditorContributor.java,v
retrieving revision 1.9
diff -u -r1.9 CompareEditorContributor.java
--- CompareEditorContributor.java	6 Jun 2002 10:56:55 -0000	1.9
+++ CompareEditorContributor.java	17 Jun 2002 09:45:23 -0000
@@ -64,6 +64,10 @@
 				CompareEditorInput compareInput= 
(CompareEditorInput) input;
 				fNext.setCompareEditorInput(compareInput);
 				fPrevious.setCompareEditorInput(compareInput);
+				// Begin fix 
http://bugs.eclipse.org/bugs/show_bug.cgi?id=20105
+				fToolbarNext.setCompareEditorInput
(compareInput);
+				fToolbarPrevious.setCompareEditorInput
(compareInput);
+				// End fix 
http://bugs.eclipse.org/bugs/show_bug.cgi?id=20105
 			}
 		}
 			
Comment 8 Dirk Baeumer CLA 2002-06-17 08:51:24 EDT
Created attachment 1447 [details]
Patch that fixes the problem
Comment 9 Dirk Baeumer CLA 2002-06-18 04:06:40 EDT
First review by Daniel Megert
Comment 10 Dirk Baeumer CLA 2002-06-18 05:52:52 EDT
Second review by Martin Aeschlimann