|
Re: [CDO] resolving conflicts with commands [message #500576 is a reply to message #500041] |
Thu, 26 November 2009 19:34 |
Victor Roldan Betancort Messages: 524 Registered: July 2009 |
Senior Member |
|
|
Lothar,
> If I edit on both sides I get a conflict (as expected) after the first one
> commits. I can resolve the conflict with the provided conflict resolvers.
> However the resolvers don't add to the command stack and therefore after
> resolving the conflict the command stack in the editor with the remaining
> changes is in an invalid state. Can one create a resolver that properly
> adds the changes done during resolving to the command stack, so that
> undo/redo continues to work properly?
I've never explicitly used EMF Commands nor CDO Conflict Resolvers, but
I can imagine that one could get the EditingDomain for an specific
Resource, then get the command stack (EditingDomain.getCommandStack())
and then modify the undo command (getUndoCommand())and I guess that also
the redo command (getRedoCommand()). Not sure how Commands are modified,
but Command.chain() looks promissing. Here some javadoc:
"Command org.eclipse.emf.common.command.Command.chain(Command command)
Returns a command that represents the composition of this command with
the given command. The resulting command may just be this, if this
command is capable of composition. Otherwise, it will be a new command
created to compose the two."
All this shall be done within a specific conflict resolver
implementation, I guess. Anyways, Ed knows better about this :P
I googled a bit and found this:
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .emf.workspace.doc/tutorials/workspaceTutorial.html
HTH,
Víctor.
|
|
|
Powered by
FUDForum. Page generated in 0.01592 seconds