Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 195495 - [Viewers] Add option to do nothing on reaching the end
Summary: [Viewers] Add option to do nothing on reaching the end
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.5 M7   Edit
Assignee: Pawel Pogorzelski CLA
QA Contact:
URL:
Whiteboard: hasPatch
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-05 05:05 EDT by Larsen Doe CLA
Modified: 2009-06-02 06:49 EDT (History)
2 users (show)

See Also:
tomasz.zarna: review-


Attachments
Proposition of modifications 001 (9.82 KB, patch)
2007-09-07 10:37 EDT, Krzysztof Michalski CLA
no flags Details | Diff
Proposition of modifications 002 (11.06 KB, patch)
2007-09-12 08:39 EDT, Krzysztof Michalski CLA
no flags Details | Diff
Patch 002 refreshed to head (12.05 KB, patch)
2007-10-23 06:04 EDT, Krzysztof Michalski CLA
no flags Details | Diff
Patch_v03 (11.46 KB, patch)
2009-03-16 11:46 EDT, Pawel Pogorzelski CLA
no flags Details | Diff
Patch_v04 (12.94 KB, patch)
2009-03-17 07:11 EDT, Pawel Pogorzelski CLA
pawel.pogorzelski1: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Larsen Doe CLA 2007-07-05 05:05:13 EDT
It would be nice if we had a checkbox to "do nothing" on reaching the end while comparing (perhaps only displaying a text "end reached" anywhere).
Comment 1 Tomasz Zarna CLA 2007-07-05 06:47:54 EDT
Does it mean that the End reached dialog is not enough in your opinion? I think that you can always close it (or say "No" when ask to proceed with next element/start from the beginning) which will be equivalent to "do nothing" :)
Comment 2 Larsen Doe CLA 2007-07-05 06:56:57 EDT
The background is that I don´t like when a search starts over from the beginning again. Hey, I´ve been there, so I don´t need to see the changes again =)

I don´t want the dialog to be shown at all, so if I had this option I could tick it and also check "remember" the first time it appears. The next time when the search reached bottom, no dialog would appear.

I hope I could clarify what I want?
Comment 3 Tomasz Zarna CLA 2007-07-11 04:43:55 EDT
One more question Lars, just to make sure I do understand your intention: With "Do nothing" checkbox on I would limit navigation only to the element you're comparing at this moment. Also, there would be no way of moving to the next/previous element (file) if there were any. When reaching end (or beginning) I would disable Next Change/Difference (or Previous Change/Diff) and display only a message in the status line that the end (beginning) of the current element has been reached. This is how I see it, will you be happy with this kind of solution?

Comment 4 Larsen Doe CLA 2007-07-11 04:57:24 EDT
Exactly =)
Comment 5 Michael Valenta CLA 2007-07-11 12:58:28 EDT
This is related to bug 170168.
Comment 6 Krzysztof Michalski CLA 2007-09-07 10:37:15 EDT
Created attachment 77887 [details]
Proposition of modifications 001

I added "Do nothing" checkbox button do ComparePreferencePage and to "End reached" dialog. Moreover added enablement of next/previous diff/change buttons to TextMergeViewer#updateControls() as Tomek propose.
Comment 7 Szymon Brandys CLA 2007-09-12 06:14:37 EDT
The patch doesn't cover the problem in the bug report. The option "Do nothing" doesn't show when e.g. I'm comparing file with its history. AFAIS it works only when I want to sync more than one file with a repository.

I would think about one patch fixing both Bug 195495 and Bug 170168. I think that we can't fix the Bug 195495 completely without fixing Bug 170168.

Comment 8 Krzysztof Michalski CLA 2007-09-12 08:39:37 EDT
Created attachment 78174 [details]
Proposition of modifications 002

Patch fixes this problem. Moreover contains fix for bug 170168.
Comment 9 Szymon Brandys CLA 2007-09-25 06:31:44 EDT
THe patch has conflicts with HEAD. Please fix it.
Comment 10 Krzysztof Michalski CLA 2007-10-23 06:04:20 EDT
Created attachment 80939 [details]
Patch 002 refreshed to head
Comment 11 Tomasz Zarna CLA 2008-04-17 05:29:05 EDT
I'm sorry, but I need to give a "-" to the latest patch, even though it seems to works fine at the first look. However, I took a look at the code and I got some concerns:
* In comment 3 I mentioned it would be nice to have an information in the status line about reaching the end (beginning) of the current element. I can't find it in the patch
* Krzysztof introduces a new IPropertyChangeListener added to CompareUIPlugin.getDefault().getPreferenceStore() which is redundant, comparing to the fPreferenceChangeListener which is already there
* I'm not an expert here, but I think the disposal can be handled in handleDispose, no need for an additional listener here

I'll take over this bug, and take a second look on Krzysztof's patch. I'm pretty sure that with some adjustment it can be applied. Unfortunately, I'm afraid I won't make it in 3.4 M7, which is in fact the last iteration for 3.4. Thus I'm moving it to 3.5.
Comment 12 Pawel Pogorzelski CLA 2009-03-16 09:09:47 EDT
(In reply to comment #11)
> * In comment 3 I mentioned it would be nice to have an information in the
> status line about reaching the end (beginning) of the current element. I can't
> find it in the patch

Why such information would be useful? In case user has selected to "Do nothing" when element's end is reached the "Next difference" icon gets disabled so it's obvious that there is no next difference.

I'm asking because there is an option to show additional information in the status line for the current change. This would be overridden by "End of element reached" message. One could think about displaying "End of element reached" message for a moment and then switching to the message describing the change. However I'm not sure if such approach would be consistent with the way status line works in Eclipse.

I'm suggesting dropping the idea. Tomasz, what do you think?
Comment 13 Tomasz Zarna CLA 2009-03-16 09:25:23 EDT
(In reply to comment #12)
> I'm suggesting dropping the idea. Tomasz, what do you think?

I'm fine with dropping it. 

Comment 14 Pawel Pogorzelski CLA 2009-03-16 11:46:28 EDT
Created attachment 128941 [details]
Patch_v03

I updated the patch to HEAD and resolved some problems.

First of all, with "go to next/previous element" option turned on, after reaching the last change CompareNavigator was instructed to select the first change. This led to reloading the first change on the current document.

Also corrected some minor bugs with enablements of navigation buttons.

Tomasz, what about a review?
Comment 15 Tomasz Zarna CLA 2009-03-17 06:33:27 EDT
(In reply to comment #14)
> Tomasz, what about a review?

Sure, here are my comments:
* Do we need to call updateControls() for all property changes? If not, update only on events that affect buttons
* Add mnemonics on the pref page
* Rename "doNothingElementOption" to "doNothingOption"
* I wouldn't use else block at the end of isNavigationButtonEnabled, instead I would check for an expected value. Moreover I would put an assertion there to fail if the value is not one of the constants from ICompareUIConstants.

Other than the above the patch looks good, I will give it a second look as soon as the patch gets updated.
Comment 16 Pawel Pogorzelski CLA 2009-03-17 07:11:52 EDT
Created attachment 129064 [details]
Patch_v04

Patch changed according to what Tomasz suggested in comment 15.
Comment 17 Tomasz Zarna CLA 2009-03-17 07:46:04 EDT
Released to HEAD with some minor changes, available in builds >=I20090317-1800. Thanks Pawel.
Comment 18 Larsen Doe CLA 2009-03-17 09:47:30 EDT
Thanks a lot!