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
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Navigator (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: apireviews
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2007-03-16 23:05 UTC by Peter Zavadsky
Modified: 2008-12-22 10:56 UTC (History)
6 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
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
solution.
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
Cool.
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
better?

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 `NavigatorPanelWithUndo.java' for addition
cvs server: use 'cvs commit' to add this file permanently
Checking in
core/navigator/src/org/netbeans/modules/navigator/NavigatorController.java;
/cvs/core/navigator/src/org/netbeans/modules/navigator/NavigatorController.java,v
 <--  NavigatorController.java
new revision: 1.18; previous revision: 1.17
done
Checking in core/navigator/src/org/netbeans/modules/navigator/NavigatorTC.java;
/cvs/core/navigator/src/org/netbeans/modules/navigator/NavigatorTC.java,v  <-- 
NavigatorTC.java
new revision: 1.13; previous revision: 1.12
done
Checking in core/navigator/apichanges.xml;
/cvs/core/navigator/apichanges.xml,v  <--  apichanges.xml
new revision: 1.5; previous revision: 1.4
done
Checking in core/navigator/arch.xml;
/cvs/core/navigator/arch.xml,v  <--  arch.xml
new revision: 1.12; previous revision: 1.11
done
Checking in core/navigator/manifest.mf;
/cvs/core/navigator/manifest.mf,v  <--  manifest.mf
new revision: 1.7; previous revision: 1.6
done
Checking in
core/navigator/test/unit/src/org/netbeans/modules/navigator/NavigatorTCTest.java;
/cvs/core/navigator/test/unit/src/org/netbeans/modules/navigator/NavigatorTCTest.java,v
 <--  NavigatorTCTest.java
new revision: 1.8; previous revision: 1.7
done
RCS file:
/cvs/core/navigator/src/org/netbeans/spi/navigator/NavigatorPanelWithUndo.java,v
done
Checking in
core/navigator/src/org/netbeans/spi/navigator/NavigatorPanelWithUndo.java;
/cvs/core/navigator/src/org/netbeans/spi/navigator/NavigatorPanelWithUndo.java,v
 <--  NavigatorPanelWithUndo.java
initial revision: 1.1
done
Checking in ide/golden/deps.txt;
/cvs/ide/golden/deps.txt,v  <--  deps.txt
new revision: 1.514; previous revision: 1.513
done
Checking in
core/navigator/test/unit/src/org/netbeans/modules/navigator/resources/testCorrectCallsOfNavigatorPanelMethodsLayer.xml;
/cvs/core/navigator/test/unit/src/org/netbeans/modules/navigator/resources/testCorrectCallsOfNavigatorPanelMethodsLayer.xml,v
 <--  testCorrectCallsOfNavigatorPanelMethodsLayer.xml
new revision: 1.5; previous revision: 1.4
done
Checking in core/navigator/nbproject/project.xml;
/cvs/core/navigator/nbproject/project.xml,v  <--  project.xml
new revision: 1.6; previous revision: 1.5
done
Checking in core/navigator/nbproject/project.properties;
/cvs/core/navigator/nbproject/project.properties,v  <--  project.properties
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 :-)