Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 228262 - Open test editors are not refreshed when removing referenced test assets.
Summary: Open test editors are not refreshed when removing referenced test assets.
Status: CLOSED WONTFIX
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Bozier jerome CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 312025
Blocks:
  Show dependency tree
 
Reported: 2008-04-22 15:05 EDT by Paul Slauenwhite CLA
Modified: 2016-05-05 11:01 EDT (History)
1 user (show)

See Also:


Attachments
patch (first part of mechanism) (23.08 KB, patch)
2010-06-01 04:24 EDT, Bozier jerome CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Slauenwhite CLA 2008-04-22 15:05:54 EDT
Open test editors are not refreshed when removing referenced test assets.

[See https://bugs.eclipse.org/bugs/show_bug.cgi?id=220555#c4]:

Jerome, we need to refresh the open editors when removing referenced test
assets.

In theory, open editors perform a reload because the resource they opened have
changed. 

[See https://bugs.eclipse.org/bugs/show_bug.cgi?id=166025#c76]

Would be great if open editor could be notified when a change occur, so that
the refresh can be made in memory, instead of having to reload the file.

It's a bit complex to implement, because not only we have to notify editors
that something changed, but also what, and each editor must update its
information for each kind of change (resource disappeared, renamed, etc)
it's not a trivial change....
Comment 1 Paul Slauenwhite CLA 2008-04-22 15:06:14 EDT
Jerome, please provide a sizing.
Comment 2 Bozier jerome CLA 2008-04-28 05:00:23 EDT
works needed :
. implement a mini protocol for editor change, that notify :
- what changed (EMF resource)
- how it changed (logical rename, physical rename, physical move, delete)
. update all editors to be able to deal with theses informations 
estimated time : coding 2 weeks minimum + huge testing (lots of potential side effect)
Comment 3 Paul Slauenwhite CLA 2008-04-28 12:50:36 EDT
(In reply to comment #2)
> works needed :
> . implement a mini protocol for editor change, that notify :
> - what changed (EMF resource)
> - how it changed (logical rename, physical rename, physical move, delete)
> . update all editors to be able to deal with theses informations 
> estimated time : coding 2 weeks minimum + huge testing (lots of potential side
> effect)
> 

Jerome, please update the Orig. Est. field with your estimate.
Comment 4 Bozier jerome CLA 2008-05-05 04:27:57 EDT
update estimated work including testing part
Comment 5 Paul Slauenwhite CLA 2008-05-21 14:21:56 EDT
Deferring to future as approved by the TPTP PMC (http://dev.eclipse.org/mhonarc/lists/tptp-pmc/msg04926.html).
Comment 6 Bozier jerome CLA 2010-05-06 09:34:23 EDT
after some testing, it seems that i can reuse an evolution i coded one year ago that allow the user to put listeners around elementary changes (move/rename/delete/update)
if i make the editor register on theses refactoring listener, they could be updated directly
i'll have to code a filter to only be notified on changes relative to the things displayed in the editor to decrease a lot the number of notification. 
ideal would be to make this registering on higher possible level (in BaseEditorExtension perhaps) and refine it on the specialized editors

i will try to make a prototype with deployment editor to see if it's a doable solution

Paul, any thoughts on the subject ?
Comment 7 Bozier jerome CLA 2010-05-07 05:10:27 EDT
seems there is some strange behavior on editor opening that make all this listener mechanism to not work (created bugzilla 312025 for this problem)

working on it before continuing my prototyping
Comment 8 Paul Slauenwhite CLA 2010-05-07 06:52:15 EDT
(In reply to comment #6)
> after some testing, it seems that i can reuse an evolution i coded one year ago
> that allow the user to put listeners around elementary changes
> (move/rename/delete/update)
> if i make the editor register on theses refactoring listener, they could be
> updated directly
> i'll have to code a filter to only be notified on changes relative to the
> things displayed in the editor to decrease a lot the number of notification. 
> ideal would be to make this registering on higher possible level (in
> BaseEditorExtension perhaps) and refine it on the specialized editors
> 
> i will try to make a prototype with deployment editor to see if it's a doable
> solution
> 
> Paul, any thoughts on the subject ?

Seems like the right approach.  As you suggest, we should only emit useful events for the type of listener.

Being considered for TPTP 4.7.0.
Comment 9 Paul Slauenwhite CLA 2010-05-11 15:59:41 EDT
Given that we enter TPTP 4.7.0 shutdown on Monday (http://www.eclipse.org/tptp/home/project_info/releaseinfo/4.7/schedule.html) and the size of this change, deferring to future.  Jerome, please attach the patch once complete and we will target the defect to the next release.
Comment 10 Bozier jerome CLA 2010-06-01 04:24:14 EDT
Created attachment 170614 [details]
patch (first part of mechanism)

this is a partial patch
it add a mechanism where editors are notified when a resource they display is affected by a refactoring event
(in this patch, there is a console display on listener adding/removing and on refactoring notification to illustrate the mechanism)

example :
if a deployment dpl use the artifact art1, art2 and the locations loc1 and loc2, its editor will now listen all theses resources (dpl, art1, art2, loc1, loc2)

on the same way, a test will listen for the datapool and external test it uses, but will not listen on its test log (test log are not displayed in the editor)

artifact / deployment / datapool will only listen the resource on witch they are opened (even if they keep reference to other test element, their editor do not display them)

remaining work : 
. make that editors use this notification to update themself
. unplug original resource listener
. tons of testing
Comment 11 Alex Bernstein CLA 2010-06-07 14:02:10 EDT
not sure what version of tptp this defect is targeted for?
Comment 12 Paul Slauenwhite CLA 2010-06-22 15:15:10 EDT
(In reply to comment #11)
> not sure what version of tptp this defect is targeted for?

Alex, this defect is not currently targeted to a specific TPTP release.  As such, there are no plans to deliver a fix.  Does your consuming product require this defect?
Comment 13 Paul Slauenwhite CLA 2010-06-24 13:29:35 EDT
No longer required by a consuming product.
Comment 14 Paul Slauenwhite CLA 2010-06-24 13:33:10 EDT
Closing.