DESCRIPTION

Bug 495567 - allow "saveable" parts define dirty state behavior

Implementation for solution drafted in bug 495567 comment 18.

This patch makes the "dirty" state propagation behavior for Properties
view configurable. Per default, Properties view will not be "dirty".
After applying this patch bug 495567 can be considered as fixed.

To be backwards compatible, "dirty" state propagation behavior is
implemented as "opt-in": per default, framework do not shows the "dirty"
state for Properties view (or any of ISecondarySaveableSource
instances), even if the connected ISaveablePart is dirty. To do so, a
new interface "org.eclipse.ui.ISecondarySaveableSource" is added, which
implements isDirtyStateSupported() method and by default returns
"false".

PropertySheet implements this ISecondarySaveableSource interface now and
re-implements this in the way that it delegates the
isDirtyStateSupported() decision to the PropertySheetPage / connected
ISaveablePart. Therefore, if desired by a some tool/workflow, the
"dirty" state tracking of ISaveablePart can be enabled for Properties
view.

The default "false" can be changed to "true" by:
1) Contributing custom IPropertySheetPage implementation to the tracked
part and overriding getAdapter() to return custom
ISecondarySaveableSource.
2) Contributing custom ISecondarySaveableSource adapter to the tracked
part.
3) Contributing global IAdapterFactory which provides custom adapter to
ISecondarySaveableSource (not recommended, because if not properly
implemented this can affect unrelated code).

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


COMMENTS

author: Brenden Conley
date: 2016-07-11 10:40:12.000000000

Patch Set 9:

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

-------------------------------------
author: Brenden Conley
date: 2016-07-11 11:06:39.000000000

Patch Set 9: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9799/ : SUCCESS

-------------------------------------
author: Teagan Marsh
date: 2016-07-11 11:07:46.000000000

Patch Set 9:

(1 comment)

The implementation looks sound to me.

Line:12, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/ISecondarySaveableSource.java -> I think this should be an internal package.  I have some reservations about this being API which I'll expand on in the bug report.

-------------------------------------
author: Jayvion Booth
date: 2016-07-11 11:20:18.000000000

Patch Set 9:

(1 comment)

Line:12, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/ISecondarySaveableSource.java -> OK.

-------------------------------------
author: Jayvion Booth
date: 2016-07-11 11:20:25.000000000

Patch Set 10: Patch Set 9 was rebased

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

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

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