Wraps the execution of operation handlers, which should be the only
handlers actually modifying the GModel, into a recoding command, which
is executed on a command stack. Moreover, this change introduces
server-side undo and redo actions, which are sent by the client's
command stack on undo and redo request to the server. On the server,
those undo and redo actions are handled by the server-side command
stack.
Thus, this change fixes #276 and resolves #275.
A few explanations about certain aspects of this change:
We introduced dedicated server-side undo and redo actions, because
the action dispatcher in Sprotty directly invokes the command stack's
redo and undo implementation. Thus we can't just add an own action
handler to take over these actions without modifying Sprotty. To
counteract this issue, we make use of our GLSPCommandStack which instead
of handling undo and redo itself, forwards it to the server.
The returns of of Optional of operation action handlers
seemed pretty useless, so I removed them. They only spared a
RequestBoundsAction, if something went wrong. In any case, we needed to
throw exceptions if something goes wrong during the operation execution
to make sure the command is disposed from the command stack in case it
isn't performed successfully. Also it feels a bit more logical, to throw
exceptions if the arguments don't make sense.
We introduce our own recorder to avoid having to attach a full
content adapter to the model (which is expensive for large models) each
time we perform an operation. Therefore, we only attach one
GModelNotifier, which is an econtentadapter, but forwards the
notifications to its listeners. This way we (a) have a nice listening
mechanism and (b) change recorders just need to add themselves as
listeners in order to be able to record.
Wraps the execution of operation handlers, which should be the only handlers actually modifying the GModel, into a recoding command, which is executed on a command stack. Moreover, this change introduces server-side undo and redo actions, which are sent by the client's command stack on undo and redo request to the server. On the server, those undo and redo actions are handled by the server-side command stack.
Thus, this change fixes #276 and resolves #275.
A few explanations about certain aspects of this change:
We introduced dedicated server-side undo and redo actions, because the action dispatcher in Sprotty directly invokes the command stack's redo and undo implementation. Thus we can't just add an own action handler to take over these actions without modifying Sprotty. To counteract this issue, we make use of our GLSPCommandStack which instead of handling undo and redo itself, forwards it to the server.
The returns of of Optional of operation action handlers
seemed pretty useless, so I removed them. They only spared a
RequestBoundsAction, if something went wrong. In any case, we needed to
throw exceptions if something goes wrong during the operation execution
to make sure the command is disposed from the command stack in case it
isn't performed successfully. Also it feels a bit more logical, to throw
exceptions if the arguments don't make sense.
We introduce our own recorder to avoid having to attach a full content adapter to the model (which is expensive for large models) each time we perform an operation. Therefore, we only attach one GModelNotifier, which is an econtentadapter, but forwards the notifications to its listeners. This way we (a) have a nice listening mechanism and (b) change recorders just need to add themselves as listeners in order to be able to record.