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 11:20:32.000000000

Patch Set 10:

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

-------------------------------------
author: Brenden Conley
date: 2016-07-11 11:44:05.000000000

Patch Set 10: Verified+1

Build Successful 

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

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

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

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