org.eclipse.core.runtime.AssertionFailedException: [message #635729] |
Wed, 27 October 2010 16:56  |
Eclipse User |
|
|
|
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 17:04  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.27237 seconds