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: Jayvion Booth
date: 2016-07-01 09:06:30.000000000

Uploaded patch set 7: Patch Set 6 was rebased.

-------------------------------------
author: Brenden Conley
date: 2016-07-01 09:06:37.000000000

Patch Set 7:

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

-------------------------------------
author: Brenden Conley
date: 2016-07-01 09:29:46.000000000

Patch Set 7: Verified+1

Build Successful 

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

-------------------------------------
author: Myah Faulkner
date: 2016-07-08 12:49:01.000000000

Patch Set 7:

(1 comment)

Line:154, bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheet.java -> Is there a special reason for not combining this with another OR with the above if statement?

-------------------------------------
author: Jayvion Booth
date: 2016-07-08 14:23:00.000000000

Patch Set 7:

(1 comment)

Line:154, bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheet.java -> Just to have a clean diff. I will change it.

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

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

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