dirty parts sometimes not shown for saving on application closing [message #1843593] |
Tue, 10 August 2021 03:06  |
Eclipse User |
|
|
|
We have a problem with our Eclipse RCP application after we upgraded from Eclipse 4.5 to Eclipse 4.17 (2020-09). When closing our application the dirty parts are no longer handled in a (in our view) consistent way. It all depends on the fact if a dirty part is visible in the active perspective or not. Imagine the following scenarios with two dirty parts:
Scenario 1: Both dirty parts are visible when closing. When closing the application a dialog is shown to save both resources. That is the desired behaviour.
Scenario 2: Only one dirty part is visible then closing. When closing the application a dialog is shown to save the visible dirty part. When you save now, the application is closed and the changes of the non-visible part is lost. In this case the same dialog as in scenario 1 should be shown, since there are 2 dirty parts and not only one.
Scenario 3: Both dirty parts are not visible when closing and no other dirty parts are visible. Just like in scenario 1 a dialog to save both resources are shown.
When taking a look at the code, in Workbench.saveAllParts() the dirty parts are indirectly determined using the EPartService-instance. PartServiceImpl.getParts() determines the Parts using the searchFlags 'EModelService.OUTSIDE_PERSPECTIVE | EModelService.IN_ACTIVE_PERSPECTIVE | EModelService.IN_SHARED_AREA'. So it looks like dirty parts, that are not visible right at this moment, are ignored. I wrote some code that uses EModelService.ANYWHERE instead as the searchFlags-value and in the resulting list all dirty parts are contained for all of the 3 scenarios. This also applies to the most current code I found in the git repository of Eclipse. So there shouldn't be a difference to a newer version that 4.17.
I was wondering if this is a bug or desired behaviour?
|
|
|
|
Powered by
FUDForum. Page generated in 0.03400 seconds