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 98125 - UndoRedo is not supported
Summary: UndoRedo is not supported
Alias: None
Product: platform
Classification: Unclassified
Component: Navigator (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: apireviews
Depends on:
Reported: 2007-03-16 23:05 UTC by Peter Zavadsky
Modified: 2008-12-22 10:56 UTC (History)
6 users (show)

See Also:
Exception Reporter:

diff of proposed patch (23.74 KB, patch)
2007-04-02 16:48 UTC, David Simonek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Zavadsky 2007-03-16 23:05:04 UTC
One more issue found with Navigator.
It doesn't support UndoRedo (like a standard TopComponent does). It is needed to
support the visualweb Outline, which was just moved into it.

Suggestions how to solve it:
1) Ideally, the NavigatorPanel would contain method getUndoRedo.
Since it is public API interface, it can't be added. So this is not working.

2) As a by pass, the UndoRedo from the NavigatorPanel impl could be passed via
the lookup (NavigatorPanel.getLookup method).
And the NavigatorTC would delegate to it.

At the moment we have only 2) to suggest. You might come up with other better
Comment 1 David Simonek 2007-03-28 14:53:41 UTC
Will try to do Milestone 9.
Comment 2 Peter Zavadsky 2007-03-28 19:11:44 UTC
I was thinking a bit about it. Would be actually the 1st suggestion possible.?
Taking into account that there are probably only two implementations of that
interface, and both are in our hands (java, outline).
Would be the incompatible change (added method to the interface) OK for this case?
Comment 3 David Simonek 2007-03-29 13:53:10 UTC
I thought about extra interface NavigatorPanelWithUndo extends NavigatorPanel.
Unfortunately there are more API users (ant, xml). We will see what API
reviewers will say...
Comment 4 David Simonek 2007-04-02 16:45:07 UTC
I'd like to ask for fast track review of this API change.

Basically, I'm adding NavigatorPanelWithUndo interface which extends
NavigatorPanel and has only one method UndoRedo getUndoRedo().

The only question is probably if method 2) suggested by pzavadsky wouldn't be

I'll attach diff of all materials needed for review.
Comment 5 David Simonek 2007-04-02 16:48:51 UTC
Created attachment 40270 [details]
diff of proposed patch
Comment 6 Marek Fukala 2007-04-03 09:31:28 UTC
Samaresh is now owner of the XML modules. 

IMHO the solution #1 proposed by Petr could work as well if we are confident
that noone outside netbeans implemented the API, which is not probable.

I must admit that I do not like the solution with NavigatorPanelWithUndo much,
but seems to me to be the best solution if do not want #1.
Comment 7 Jaroslav Tulach 2007-04-03 12:02:47 UTC
Prrr, probability does not count[1], this is stable API and adding methods 
into interfaces in stable API is not NetBeans habit.

Adding new interface looks fine to me. Alternative to it is to find the 
UndoRedo inside lookup, but that is imho uglier.

[1] moreover I believe a lot of people unknown to us implemented this 
interface - Geertjan blogged about it => means everyone knows how to use it
Comment 8 Peter Zavadsky 2007-04-06 21:24:04 UTC
I don't know if you were waiting for my comment. If yes, I am perfectly OK with
the Dafe's extended interface solution.
Comment 9 David Simonek 2007-04-10 17:20:53 UTC
Petr, I was waiting for one week fast track review time limit, which passed today.

So integrated into main trunk along with the tests, api changes and javadoc
documentation, enjoy...

cvs server: scheduling file `' for addition
cvs server: use 'cvs commit' to add this file permanently
Checking in
new revision: 1.18; previous revision: 1.17
Checking in core/navigator/src/org/netbeans/modules/navigator/;
/cvs/core/navigator/src/org/netbeans/modules/navigator/,v  <--
new revision: 1.13; previous revision: 1.12
Checking in core/navigator/apichanges.xml;
/cvs/core/navigator/apichanges.xml,v  <--  apichanges.xml
new revision: 1.5; previous revision: 1.4
Checking in core/navigator/arch.xml;
/cvs/core/navigator/arch.xml,v  <--  arch.xml
new revision: 1.12; previous revision: 1.11
Checking in core/navigator/;
/cvs/core/navigator/,v  <--
new revision: 1.7; previous revision: 1.6
Checking in
new revision: 1.8; previous revision: 1.7
RCS file:
Checking in
initial revision: 1.1
Checking in ide/golden/deps.txt;
/cvs/ide/golden/deps.txt,v  <--  deps.txt
new revision: 1.514; previous revision: 1.513
Checking in
 <--  testCorrectCallsOfNavigatorPanelMethodsLayer.xml
new revision: 1.5; previous revision: 1.4
Checking in core/navigator/nbproject/project.xml;
/cvs/core/navigator/nbproject/project.xml,v  <--  project.xml
new revision: 1.6; previous revision: 1.5
Checking in core/navigator/nbproject/;
/cvs/core/navigator/nbproject/,v  <--
new revision: 1.9; previous revision: 1.8
Comment 10 Peter Zavadsky 2007-04-10 17:32:24 UTC
I see. I will try it out as soon as we get the change over. Thanks.
Comment 11 Peter Zavadsky 2007-04-11 19:39:22 UTC
The API is working for me. Thanks!
Comment 12 David Simonek 2007-04-12 11:10:53 UTC
Pleasure also on my side :-)
Btw it seems that writing tests is really effective, especially for newly
created APIs. I thought differently several years ago :-)