Closed eckig closed 9 years ago
Thanks for the report, I'll look into this a.s.a.p.
It's intentional that the command is executed before the command appender is called. Even after a compound command is executed, you can still append-and-execute additional commands to it.
Can you provide an example of what you are trying to do and what exactly is not working?
paste.setOnAction(ev -> mEditor.getSelectionManager().paste(this::doPaste));
private void doPaste(List<GNode> pNodes, CompoundCommand pCommand)
{
GraphModelBridge wrapper = GraphModelBridge.getInstanceFor(getBean().getGraphModel());
for (GNode node : pNodes)
{
clone = ...;
pCommand.append(EMFUtils.addCommand(getBean().getDomainModel(), clone));
}
}
Then I will get an Exception that the command is already prepared (see CompoundCommand#append()). I swapped both elements, so the CommandAppender is called first and afterwards executed - Then it works perfectly fine.
Ok, previously I have just tested it using CompoundCommand#appendAndExecute(). Did you try that?
Ah okay, did not know that and it works just fine. Thanks for the hint, you may want to put it down in writing (JavaDoc) :-)
If I paste previously copied nodes with a CommandAppender I can not append commands to sync my domain model. If think it is a bug in SelectionCopier#addPastedElements where the command is executed before the CommandAppender is called..?