[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Getting the ChangeDescription of an AbstractEMFOperation

Hi everybody,

we have developed an extended EMF model Editor that is a slightly
modified EcoreEditor, which opens specialised editors on double click,
depending on the selected EClass.

Since all these editors work directly on the model we integrated the
EMF.transaction framework via the workspace integration. Every
specialised Editor has its own undo/redo history context and on saving
the changes are propagates to the main EcoreEditor. So the main Editor's
undo/redo history does not reflect all changes done in the specialised
editors, but big chunks of changes that propagated in a kind of compound
operation that contains already executed operations.

There is one big problem left, though. Since we are working directly on
the model from all editors and not all changes are reflected by the
undo/redo history of the main editor, we may run into chronological
problems.

Example:
 MEE = main EcoreEditor, SE = specialised editor.

Lets assume we have saved some changes done in SE and then done some
more changes. Now SE is dirty and contains local changes in the
undo/redo history and MEE contains only one change (the compound changes
done in SE until saved). If the user is in MEE and undoes the changes
from SE, this action may result in an inconsistent state, if the changes
are not disjoint. Because then the rollback of changes in MEE would
override changes done later in SE and SE wouldn't recognise this.

To prevent this from happening it would be great to have access to the
ChangeDescription of the AbstractEMFOperations, but the getter is
protected final and even the trick with a helper class being in the same
package but in another jar file doesn't work. I get an IllegalAccess
Exception and I'm not sure why, because if the package is sealed (I
can't find any clues as to why it is) it should be an SecurityException
about sealing.
Anyway, I'd really appreciate if this description would be made public,
or if anyone can tell me how to get this information via another approach.

Thanks in advance!