DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page Problem with TransactionalEditingDomain and dynamic changes in UML model
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jul 2009
Question Problem with TransactionalEditingDomain and dynamic changes in UML model - 07-07-2009, 04:42 AM

Hi folks,

I'm trying to modify my UML model during it's validation and here is the piece of code I use to apply programatically a stereotype to the validated node.

Code:
public static void applyStereotype(final NamedElement obj, final IStereotypedElementType stereotype ){
		if (obj.getAppliedStereotype(stereotype.getStereotypeName()) != null) return;
		final TransactionalEditingDomain domain = TransactionalEditingDomain.Registry.INSTANCE.getEditingDomain("org.eclipse.gmf.runtime.emf.core.compatibility.MSLEditingDomain");
		CommandStack stack = domain.getCommandStack();
		Command c = new RecordingCommand(domain, "apply stereotype"){
			@Override
			protected void doExecute() {
            obj.applyStereotype(obj.getApplicableStereotype(stereotype.getStereotypeName()));
			}
		};
		stack.execute(c);
		return;
	}
This code is called during validation of a selected UML object. There is no problem as far as the object is selected in project explorer. But when the object is selecting via diagram editor, the validation freezes ; the RecordingCommand is passed and executed, but never gives back to calling thread.

Does someone have an idea for me ?
Reply With Quote
Reply

Tags
emf, gmf, msleditingdomain, recordingcommand

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Null pointer exception when trying to generate EMF model aparna.1185 Eclipse 2 05-16-2009 01:27 PM
Nice documentation output for ecore model? StefanPuchta Eclipse 0 09-09-2008 08:41 AM
Ibatis issue problem: Dynamic Data handling without doing loops in ibatis marc2 Java 0 07-04-2008 04:13 AM
Remotely modifying an EMF model for design collaboration darpan310 Eclipse 0 04-18-2008 08:34 AM
Issue of offset between model and view in GEF nsinghal Eclipse 0 02-06-2008 04:16 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com