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 44434 - Move class dialog contains wrong values -
Summary: Move class dialog contains wrong values -
Status: CLOSED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 4.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: issues@java
URL:
Keywords: T9Y
Depends on:
Blocks:
 
Reported: 2004-06-07 14:27 UTC by Marek Grummich
Modified: 2007-04-03 18:02 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Snapshot (51.62 KB, image/png)
2004-06-07 14:38 UTC, Marek Grummich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Grummich 2004-06-07 14:27:44 UTC
Build 040606 j2sdk1.4.2
Consider a following structure:
<source packages>
|-abc
| |-a.java
| |-b.java
| |-c.java
|
|-def

I select all three java file in the project view
and invoke Control-X (Cut) then Control-V (Paste)
action on the 'def' folder. The same I can perform
using D&D functionality. Files are moved in the
first step of action and Move class dialog is
appeared. The attachment shows the dialog contains
wrong values (location - should be 'abc', to
package should be 'def'). 
Question - What is a correct behaviour when user
press the cansel button in the dialog. I would
expect whole action (move) is reverted to the
initial state, but files are remain moved now.
Comment 1 Marek Grummich 2004-06-07 14:38:06 UTC
Created attachment 15526 [details]
Snapshot
Comment 2 Marek Grummich 2004-06-07 14:40:36 UTC
Sorry, I forgot to mentioned the dialog doesn't have a title (look at
the attachment).
Comment 3 Jan Becicka 2004-06-07 15:23:26 UTC
1. Misleading package is fixed:
Checking in MoveClassPanel.java;
/cvs/refactoring/src/org/netbeans/modules/refactoring/ui/MoveClassPanel.java,v
 <--  MoveClassPanel.java
new revision: 1.3; previous revision: 1.2
done

2. Location should be "Source Packages".

3. Answer to your question:
If you do cut/paste (or DND) - files are moved on the disk and then
Move Class Refactoring is invoked. If you cancel Move Class
Refactoring, no changes are made in contents of files, but these files
should stay moved.

4. Lowering priority to P4. Missing title is minor issue.

Comment 4 Jiri Skrivanek 2004-06-08 15:20:59 UTC
Increasing priority because the title is important for UI tests. On
the other hand it is also important to understand purpose of the
dialog. I also thought that Cancel revert the move. UI is not clear IMO.
Comment 5 Jan Chalupa 2004-06-11 09:31:19 UTC
IMO, the users won't understand moving of files (and classes) as a two
step process. They use a single DnD gesture or Paste action to move
files (along with classes). The fact that this is done in two steps
(move files + refactor classes) is an implementation detail the user
doesn't care about. Therefore, Cancel should restore the original
state completely. -> P2
Comment 6 Jan Becicka 2004-06-14 19:08:15 UTC
To Honza Ch.:
It depends on point of view. This solution allows to move file and
don't do refactoring.
After consultation with UI we added explanatory title:
"Refactor Code for Moved Class(es)"

User: mmatula 
  Date: 04/06/13 13:58:48

  Modified:    src/org/netbeans/modules/refactoring/ui Bundle.properties
                        MoveClassPanel.java MoveClassesUI.java
                        RefactoringOperationListener.java RenamePanel.java
                        RenameRefactoringUI.java
  Log:
  Changing title of the refactoring window when triggered by a file
rename/move to Refactor Code for Renamed/Moved File(s)/Class(es)
implemented

Comment 7 Marek Grummich 2004-07-15 12:42:11 UTC
Verified