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 66585 - Cannot undo javadoc added from Navigator
Summary: Cannot undo javadoc added from Navigator
Status: RESOLVED INVALID
Alias: None
Product: java
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: David Simonek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-12 11:08 UTC by Milan Kubec
Modified: 2006-11-29 17:56 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milan Kubec 2005-10-12 11:08:41 UTC
[dev-200510111800, JDK 1.5.0-05]

Javadoc added from Navigator for a method by action 'Create Javadoc' cannot be
undone by Undo action.

Steps to reproduce:
1) Have some class with method members without javadoc
2) Invoke action Create Javadoc from context menu of those methods in Navigator
Javadoc comment is added to class but it cannot be undone by Undo action.

P2 because Undo action is esential editing action and not being able to undo
edits done by IDE action is really bad.
Comment 1 David Simonek 2005-10-12 11:37:14 UTC
Milo, is there any chance to hook into Undo action from java/navigation or is it
not implementable? I never touched any Undo code... thanks.
Comment 2 Miloslav Metelka 2005-10-12 14:18:35 UTC
AFAIK the navigator's effect IS undoable you just need to focus the editor, right?
The navigator generates text insertion which gets added to the editor's undo
manager so it's normally undoable through getting the particular top component
and calling tc.getUndoRedo().undo(). The only problem is how to know whether you
are undoing the right edit because the UndoRedo won't give you the next edit to
be undone. IMHO you could possibly limit the undoing to the state when the user
does not change the focus out from the navigator and 'blindly' attempt to undo
the last edit by the call that I have described above.
Comment 3 David Simonek 2005-11-08 15:11:28 UTC
I'm hesitating if I should try Mila's approach (tricky to find editor anyway)
but I thing I'll waive this bug completely. In any case it won't work 100% until
UndoRedo mechanism will support some "marking" of the changes. I guess impact of
this bug is very low compared to the huge effort that right fix would take.
Comment 4 David Simonek 2005-11-09 15:54:20 UTC
After offline discussion with mkubec, I devided to downgrade to P3. While Undo
functionality is important in editor, navigator's "add javadoc" is rarely used
and Undo works OK after jump to editor.

I'm even thinking about removing this functionality from navigator, as code
modifications should be done through editor primarily. Sadly no similar action
is available in our editor now AFAIK.
Comment 5 David Simonek 2006-11-29 17:56:00 UTC
Java navigation part was reimplemented and this bug is obsolete, as new
implementation doesn't and won't contain javadoc creating AFAIK.