[528330] Handle possible edition conflicts in the text widget

Some conflict situations could cause the loss of user input inside a
text field.

If the user has started editing a text field when a concurrent refresh
occurs and produces a different reference value that the one he
started from, detect the potential conflict and react accordingly. If
the new reference value is the same, keep the user input without
interupting him.

The reaction in case of conflict is configurable: the implementation
in EEFTextLifecycleManager uses a new preference
TEXT_CONFLICT_RESOLUTION_MODE, which is not exposed in the UI but can
be configured programmatically using
EEFPreferences.setTextConflictResolutionMode().

The default preference value can also be overridden by configuration,
using the -pluginCustomization startup flag to point to a
plugin_customization.ini file with, for example:

org.eclipse.eef.ide.ui/TEXT_CONFLICT_RESOLUTION_MODE=USE_LOCAL_VERSION

EEFTextLifecycleManager supports three modes:
* USE_MODEL_VERSION: overwrite the widget's content with the value
  computed from the new version of the model (no user feedback). This
  is the default.
* USE_LOCAL_VERSION: keep the current value begin edited by the
  end-user in the widget (no user feedback);
* ASK_USER: open a simple dialog box to ask the user which version to
  keep. Note that the simple dialog provided is only suitable for
  short (single-line) text fields.

Conflict resolution can further be customized by providing a custom
LifecycleManager which extends the default EEFTextLifecycleManager and
overrides either:
* askUserToResolveConflict() to take the preference in consideration,
  but implement ASK_USER differently, for example with a more
  sophisticated dialog.
* resolveEditionConflict() to provide a completely different
  strategy (possibly ignoring the preference).

Bug: 528330
Change-Id: I37125b40fcfaea3fd8dcfc59aa2dcb692dfe6919
Cherry-Picks: 528134
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
4 files changed
tree: efc23e05720e2c73e504f67b72cba5c25c3ef182
  1. doc/
  2. features/
  3. plugins/
  4. prototypes/
  5. releng/
  6. samples/
  7. tests/
  8. .gitignore