Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 285572 - [extract method] checkbox for replacing other occurrences misleading
Summary: [extract method] checkbox for replacing other occurrences misleading
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 trivial (vote)
Target Milestone: 3.6 M1   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-04 08:44 EDT by Dani Megert CLA
Modified: 2009-08-06 03:20 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 Dani Megert CLA 2009-08-04 08:44:36 EDT
R3.5 and I20090803-1800.

When extracting code which only appears once the checkbox says:
[ ] Replace all occurrences of statements with method

==> it should say: "Replace single occurrence..."
==> the checkbox should be checked

When extracting code which appears n times the checkbox says:
[x] Replace (n-1) occurrences...
==> it should say: "Replace (n-1) ADDITIONAL occurrences..."
Comment 1 Markus Keller CLA 2009-08-04 09:15:29 EDT
The checkbox always needs to have the same meaning w.r.t "additional" / "just the selection".

If we change the disabled state to be checked, then the checkbox text should always include the selected occurrence, i.e. plural text should become:
"Replace n occurrences of statements with method".

The single occurrence text should then be simplified to:
"Replace selection with method".


IMO, the better solution is:
- "Replace additional occurrences of statements with method" (disabled/unchecked)
- "Replace 1 additional occurrence of statements with method"
- "Replace (n-1) additional occurrences of statements with method"
Comment 2 Dani Megert CLA 2009-08-04 09:16:37 EDT
Agree.
Comment 3 Markus Keller CLA 2009-08-05 06:36:12 EDT
Fixed.
Comment 4 Dani Megert CLA 2009-08-06 03:20:08 EDT
Verified in I20090805-1800.