DESCRIPTION

Bug 495567 - properly handle dirty state changes in properties view

This is solution #1 (see bug 495567 comment 6): a part exposing
ISaveablePart either via implementing it or via providing adapter to it,
must properly handle and propagate dirty state changes to the UI.

Properties view will properly track now dirty state of the contributing
ISaveablePart part, also if multiple instances of Properties view are
opened for same contributing part. As a result, UI representation of a
Properties view tracking a ISaveablePart will change: it will show
leading asterisk '*' in all cases the contributing part also shows it,
and hide it otherwise.

Change-Id: I7e2084ad8e250fa78c734ecd2cee6786ce7d9138
Signed-off-by: Jayvion Booth xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2016-06-26 06:23:38.000000000

Patch Set 7:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9651/

-------------------------------------
author: Brenden Conley
date: 2016-06-26 06:47:02.000000000

Patch Set 7: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9651/ : UNSTABLE

-------------------------------------
author: Teagan Marsh
date: 2016-06-30 20:26:37.000000000

Patch Set 7:

(3 comments)

Line:140, bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheet.java -> This class needs a comment as to its purpose.  I think that it listens for dirty changes for the currently selected part.  The filtering if this PropertySheet instance is found is a bit strange (see below).

Line:149, bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheet.java -> We don't need to recreate this DefaultSaveable each time through the look, do we?

Line:150, bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheet.java -> What if there is another saveable in the list?  That is, perhaps this is better encoded as:

if(saveables.length == 1 && saveables[0].equals(new DefaultSaveable(PropertySheet.this))) { return; }

-------------------------------------
author: Jayvion Booth
date: 2016-07-01 09:06:08.000000000

Patch Set 7:

(3 comments)

Line:140, bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheet.java -> Done

Line:149, bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheet.java -> Unfortunately there is no API to access part represented by a given saveable. So this is the workaround to check if the saveable is for the current part.

Line:150, bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheet.java -> Independently how many saveables are returned, we should not continue if the list contains our instance, because otherwise we might start an endless loop.

-------------------------------------
author: Gerrit Code Review
date: 2016-07-11 11:58:25.000000000

Change has been successfully merged into the git repository by Jayvion Booth

-------------------------------------
