EMF Compare/Specifications/EditingTextualAttribute

From Eclipsepedia

Jump to: navigation, search

THIS PAGE IS ARCHIVED. IT IS PROBABLY OUTDATED AND WILL NOT BE UPDATED

Contents

Evolution Specification: Allow the editing of textual attribute

Current status is ARCHIVED

Preamble

This feature enables to directly edit a local value on either side of a textual difference (on text field of an object).

  • Bug 398083 - Allow the edition textual attribute


Introduction

Often, when comparing textual attribute, neither the local nor the remote value is the one the user wants to keep. We will relax the read-only constraint on textual compare viewer. As soon as the left or the right side is edited, the associated difference will be marked as rejected.


Detailed Specification

On a textual difference, the user has to be able to edit his own value and, in this context, he will benefit from the features related to the text viewer like undo/redo mechanism during his editing session.

The models will be updated as soon as the user changes the input of the content merge viewer (on double-click on one of the structure viewer item), when he watches/handles an other difference or match. At the same time, the status of the "edited" difference will be set to REJECTED.

In the other contexts, undo/redo action will enable to retrieve old/new set values (by textual editing or merge actions).

The save action shall set the current progressing textual editing in the model before serializing the data.


Backward Compatibility and Migration Paths

Metamodel Changes

This evolution does not change any metamodel.

API Changes

This evolution required to get access to the change recorder from the editing domain (an accessor has been added to ICompareEditingDomain).

User Interface Changes

For now, the user can edit his own value on a text field concerned by a difference, on a local model.

Documentation Changes

This documentation will have to be updated:

  • New and Noteworthy
  • User guide


Tests and Non-regression strategy

A test case of the feature is presented here: video

Found bugs

  • Bug 398311 - ChangeRecoder with EditingDomain
  • Bug 398405 - The save action does not work in a content merge viewer different from TableContentMergeViewer
  • Bug 398503 - No refresh of the Structure Merge Viewer after setting a textual value


Implementation choices and tradeoffs

During a textual editing session, it is possible to set each entered value in the model.

But, from the undo/redo mechanism viewpoint, it is not so relevant because each progressing step, during editing session, would be stored in the global command stack. So, this stack would be polluted by useless information, amongst other changed and set values coming from merges or textual editing actions.

Moreover, it would be needed to deactivate the local undo/redo mechanism on the text viewer because each undone or redone value would be set again and would modify this stack ! At last, the behavior would not be standard anymore and you should override the TextMergeViewer#configureTextViewer() method with your own configuration inheriting from SourceViewerConfiguration.