Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » org.eclipse.core.runtime.AssertionFailedException:
org.eclipse.core.runtime.AssertionFailedException: [message #635729] Wed, 27 October 2010 20:56 Go to next message
bachra04  is currently offline bachra04 Friend
Messages: 148
Registered: April 2010
Senior Member
The following part of code :

Command cmd2 = CreateConnectionViewAndElementRequest.getCreateCommand(wireT ype, regpart,myPart, Acidpart.getDiagramPreferencesHint());

CompoundCommand cc2 = new CompoundCommand("Create connection");
cc2.add(cmd2);


regpart.getDiagramEditDomain().getDiagramCommandStack().exec ute(cc2);


generated the following exception :

Caused by: org.eclipse.core.runtime.AssertionFailedException: null argument:failed to create a view
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85)
at org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand.do ExecuteWithResult(CreateCommand.java:99)
at org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTr ansactionalCommand.doExecute(AbstractTransactionalCommand.ja va:247)
at org.eclipse.emf.workspace.AbstractEMFOperation.execute(Abstr actEMFOperation.java:150)
at org.eclipse.gmf.runtime.common.core.command.CompositeCommand .doExecuteWithResult(CompositeCommand.java:403)
at org.eclipse.gmf.runtime.common.core.command.AbstractCommand. execute(AbstractCommand.java:135)
at org.eclipse.gmf.runtime.common.core.command.CompositeCommand .doExecuteWithResult(CompositeCommand.java:403)
at org.eclipse.gmf.runtime.common.core.command.AbstractCommand. execute(AbstractCommand.java:135)
at org.eclipse.gmf.runtime.common.core.command.CompositeCommand .doExecuteWithResult(CompositeCommand.java:403)
at org.eclipse.gmf.runtime.common.core.command.AbstractCommand. execute(AbstractCommand.java:135)
at org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:511)
... 33 more

Any idea what could be the reason and how to fix it ?
Re: org.eclipse.core.runtime.AssertionFailedException: [message #1692797 is a reply to message #635729] Sat, 18 April 2015 21:04 Go to previous message
Nikos Margaritis is currently offline Nikos MargaritisFriend
Messages: 65
Registered: September 2014
Member

Hello there,

I had exactly the same issue while using Quote:
CreateConnectionViewAndElementRequest.getCreateCommand(type,sourceEditPart, targetEditPart, diagramEditPart.getDiagramPreferencesHint());


The following method solves the problem and the exception is not encountered.

public void createAndExecuteConnectionRequestCommand(IElementType type, DiagramEditPart editPart, EditPart source, EditPart target) {
		CreateConnectionViewAndElementRequest request = new CreateConnectionViewAndElementRequest(type, ((IHintedType) type).getSemanticHint(), editPart.getDiagramPreferencesHint());
		Command cmd = CreateConnectionViewAndElementRequest.getCreateCommand(request, 
						source, target);
		System.out.println(cmd.getLabel());
		diagramEditPart.getDiagramEditDomain().getDiagramCommandStack().execute(cmd);
		//hack to refresh visuals and show the connection!
		diagramEditPart.addNotify();
}



Best, Nikos.
Previous Topic:How to create an EReference programmatically?
Next Topic:How to Set Default Grid line style, line color, and "on top"
Goto Forum:
  


Current Time: Mon Dec 18 20:40:45 GMT 2017

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

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