This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 51337

Summary: Refactoring 'Preview' should provide real preview
Product: editor Reporter: psuk <psuk>
Component: RefactoringAssignee: issues@java <issues>
Status: RESOLVED FIXED    
Severity: blocker CC: bleonard, cwebster, mmatula
Priority: P2    
Version: 4.x   
Hardware: PC   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on: 89592, 93029, 93060    
Bug Blocks: 89605    

Description psuk 2004-11-09 18:04:07 UTC
Refactoring 'Preview' needs to provide a way for
the user to see the future state, rather than the
list of places/lines where the source file is
going to be changed.

Comments from the NetBeans 4.0 Beta 2 feedback:
--------------------------------------------
I used the refactoring feature today to add a
parameter to a constructor.

When I hit Preview, I got a list of all the places
referencing the constructor.

However, the preview text did not show the
-new-/proposed version of the line, instead it
showed the old (same as in editor) version of the
code.

As a result I was unsure if it would work. I
copied my tree and tried anyway -- and it works.
--------------------------------------------
Comment 1 Martin Matula 2004-11-09 21:38:06 UTC
This will be covered by a "diff" available from the pop-up menu in
usages window. We plan to implement this for promoF (nb4.2)
Comment 2 Charlie Hunt 2005-01-16 14:43:24 UTC
Adding this comment here since it is related to this issue and may
change the strategy of where a preview or diff may be viewable.

Since Refactoring uses a wizard type of approach, the generally
accepted workflow with a wizard is walk a user through the steps of an
operation one screen at a time and when the last screen has gone away,
then the operation is fully complete.  Refactoring doesn't follow this
principle.  For instance, on a Refactor > Rename, after a user puts in
a new name and presses "Next", the wizard goes away.  For users who
are used to wizard operations, his or her expectation is that the
refactoring in complete.  This is not the case, instead the IDE's
output window displays a list of occurences it found that would be
modified and requires the user to press "Do Refactoring" to finish the
operation which is outside the wizard.

To be consistent with a wizard approach, a slightly different
windowing flow should in place. Here's an example, (not necessarily
the best approach, but a possibility):

Put the preview up inside the wizard after the user presses "Next" on
the "Rename" dialog with a scrollable window with the "Do Refactoring"
or a "Next" at the bottom of the wizard.  This screen of the wizard
might also be the place to show a "diff" button for the previews.
Comment 3 Jan Becicka 2006-11-22 14:00:19 UTC
We try to do it for 6.0
Comment 4 Jan Becicka 2007-01-17 19:23:12 UTC
Prototype implemented.