Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358003 - SetCommand.create bug in gmf editor (annotations)
Summary: SetCommand.create bug in gmf editor (annotations)
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BPMN (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-17 12:13 EDT by Paul Keryon CLA
Modified: 2012-01-06 13:57 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Keryon CLA 2011-09-17 12:13:46 EDT
Build Identifier: 20110218-0911

Hi, I'm using the BPMN modeler code to create drag'n'drop annotations, and it's working fine excepted that when the annotation icon is added, the entire editor seems like "resetting" and two simple views (extending ViewPart and no observers, no interacting with editing domain) are weirdly closed


The code which is provoking the closure is the following

___________________________________
protected Command createEAnnotationDropCommand(final EAnnotation ea, final EModelElement element) 
	{
		AbstractTransactionalCommand command = new EasyCommand(element) 
		{

			@Override
			protected CommandResult doExecuteWithResult
			(
					IProgressMonitor monitor, IAdaptable info) 
			throws ExecutionException 
			{
				if (element.getEAnnotation(ea.getSource()) != null) 
				{
					RemoveCommand.create(getEditingDomain(), element,
							EcorePackage.eINSTANCE.getEModelElement_EAnnotations(),
							element.getEAnnotation(ea.getSource())).execute();
				}

				SetCommand.create(getEditingDomain(), ea, 
						EcorePackage.eINSTANCE.getEAnnotation_EModelElement(),
						element).execute();
				
				
				return CommandResult.newOKCommandResult();
			}
		};
		return new ICommandProxy(command);
	}
_______________________________________________


Every time the command is dispatched (so the function returns CommandResult.newOKCommandResult() ), the views are shut down.. after that I get the error

org.eclipse.swt.SWTException: Widget is disposed

but I think it's logic because the views have been closed by "something"

I've searched a lot but found nothing, might this be a gmf bug?

Reproducible: Always

Steps to Reproduce:
1. start the bpmn editor
2. start the views
3. annotate an element with a drag'n'drop
4. views are shut down with errors