Community
Participate
Working Groups
I200405190010 0. set to have at most 1 editor and set folding off for new editors 1. open a file from CVS Repository view 2. open a normal CU 3. add an error Observe: no error shown (reconciler not started?) 4. close all 5. open a normal CU which has errors and/or warnings 6. enable folding for this CU 7. open a file from repository Observe: folding annotations, errors and warnings hang around
For 3.0.1 we should fix at least the dangling projection annotations. Important Note: Update of some actions depends on the scenario: if the reused editor is opened via a view (e.g. PackageExplorer) then partChanged gets triggered which updates the action contributions i.e. EditorActionBarContributor.setActiveEditor(...) gets called. However, if the reused editor is opened while this editor is already active and opening is done via global action (e.g. Open Type or Open External File...) then EditorActionBarContributor.setActiveEditor(...) isn't called.
Also, when using the editor navigation history, setActiveEditor is not called.
A partial fix does the following: - in JavaEditor.doSetInput, call SourceViewerDecorationSupport.dispose(), not uninstall() - at the same place, move the call to SourceViewerDecorationSupport.install after internalDoSetInput to make sure the AnnotationPainter picks up the correct annotation model - in AbstractReconciler::install(), we assume that the document will be set on the viewer after install. This may not be the case with editor re-use, so we have to make sure we register the reconciler as document listener on the viewer's document, if already there. This does not fix the action enablement, but it does remove the old annotations and ensures that the correct annotation model gets used.
after review by Christof, we changed the following: - JavaEditor stays as is - Instead, we make sure that AnnotationPainter clears its internal cache of drawn annotations (decorations) when its model is set to null.
Created attachment 13641 [details] AbstractReconciler.java.diff Patch for AbstractReconciler.java In install(), when the supplied ITextViewer already has a document, we register as document listener with the document. With this, a reconciler can be installed on a live viewer and gives up the requirement that the document must be set after its installation.
Created attachment 13642 [details] AnnotationPainter.java.diff Patch for AnnotationPainter.java In catchUpWithModel, if the supplied annotation model is null, we don't just exit but instead make sure that any of the internally cached annotations get cleared. Otherwise a painter that gets deactivated may still draw the set of annotations it stored before it was deactivated.
released into 3.1. HEAD, awaiting review for 3.0.1
Fixes reviewed and approved. Released to R3_0_maintenance branch Filed bug 71081 about the general editor reuse problem
Verified in M200409010800.