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 211201 - Create/delete actions should have undo
Summary: Create/delete actions should have undo
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 7.2
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks: 212131
  Show dependency tree
 
Reported: 2012-04-14 23:29 UTC by ulfzibis
Modified: 2012-05-10 12:05 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ulfzibis 2012-04-14 23:29:14 UTC
[ BUILD # : 201204100400 ]
[ JDK VERSION : 1.7 ]

- Tools -> Create Tests on Xyz
- Refactor Rename XyzTest to XyzTest_old
- Tools -> Create Tests on Xyz
- Undo
- Undo
--> Cannot remame file XyzTest_old in ...
IMO, 2nd created XyzTest should be deleted first.
Comment 1 Jan Becicka 2012-04-16 11:02:58 UTC
Is there any exception?

From the description I don't see any issue. You cannot undo refactoring, because XyzTest.java already exists...
Comment 2 ulfzibis 2012-04-16 11:53:36 UTC
There is no exception.
Because file renaming is covered by Undo, I assumed, that creation/deletion should be covered too.
Comment 3 Jaroslav Tulach 2012-04-18 06:38:50 UTC
The "undo" feature of file rename is not handled by openide.loaders module, but injected in by Jan Bečička from refactoring. openide.loaders don't care about undo/redo of files.

Should your request for creation/deletion be handled, it needs to be handled by the same code and person (e.g. Jan). There is OperationListener to provide basic hook into the creation/deletion process.

Anyway, as Jan reassigned the bug to openide.loaders, it seems, he does not want to work on the feature. From the point of view of openide.loaders, this is won'tfix, thus closing. 

If you want to negotiate, please negotiate with Jan.
Comment 4 ulfzibis 2012-04-18 10:38:19 UTC
It seems, that Undo was originally meant to work on the content of the file in focus.
Since short, Undo has included it's work on refactoring actions, so could affect files, which are not in focus, even outside there content, e.g. file name, even creating new files, e.g. Extract Superclass.
So from first intuitive feeling I expected Undo to include "Create Something", but I agree, this would be a further step.

I didn't mean Undo of "Delete" by "Undo should cover create/delete", I only meant undo of create, which _is_ delete.
But I'm not sure, if there is any action in Refactor, which could entail a file delete, where undo should recreate the old deleted file.