Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Issue with Undo
Issue with Undo [message #1817655] Wed, 27 November 2019 10:50
Yoann Farre is currently offline Yoann FarreFriend
Messages: 130
Registered: November 2017
Senior Member
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:

	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,
					EMFtoGMFCommandWrapper wrapper = new EMFtoGMFCommandWrapper(renameCommand);
		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.


Previous Topic:Help with templates
Next Topic:Requirements Table: How to add new columns?
Goto Forum:

Current Time: Sat Feb 22 23:45:36 GMT 2020

Powered by FUDForum. Page generated in 0.03659 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top