Issue with Undo [message #1817655] |
Wed, 27 November 2019 05:50 |
Eclipse User |
|
|
|
Hello everyone,
In my plugins for Papyrus, I have some issues with the undo feature. In some cases, when the user requests to undo an action, the previous actions are not undone on some elements.
For example, I have an EditHelperAdvice which contains a method to manage the renaming of a stereotyped element:
@Override
protected ICommand getAfterSetCommand(SetRequest request) {
StateInvariant stateInv = (StateInvariant) request.getElementToEdit();
CompositeCommand compositeCommand = new CompositeCommand("Set Command"); //$NON-NLS-1$
if (request.getFeature() == UMLPackage.eINSTANCE.getNamedElement_Name()) {
String newName = (String) request.getValue();
SequenceState seqState = UMLUtil.getStereotypeApplication(stateInv, SequenceState.class);
State state = seqState.getAssociatedState();
if (state.getName() != newName) {
AbstractCommand renameCommand = new RenameElementCommand(request.getEditingDomain(), state,
newName);
EMFtoGMFCommandWrapper wrapper = new EMFtoGMFCommandWrapper(renameCommand);
compositeCommand.add(wrapper);
}
}
return compositeCommand.compose(super.getAfterSetCommand(request));
}
"SequenceState" is a stereotype from my profile which refers to a state (UML). the wanted behavior is the following:
- when the user change the name of the element stereotyped with SequenceState, the associated state is renamed as well.
I obtain the wanted behavior but if I request to undo the renaming, only the element having the stereotype SequenceState is rolled back (the state which was renamed is not rolled back). I don't understand why. Could you provide me some (obvious or not) reasons which can cause this?
Thanks for reading.
Regards.
Yoann
|
|
|
Powered by
FUDForum. Page generated in 0.03606 seconds