Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Problem creating view
Problem creating view [message #559824] Sun, 19 September 2010 16:28
123star  is currently offline 123star Friend
Messages: 70
Registered: June 2010
Member
Hi,

I'm trying to create the view of semantic elements, but I encountered an exception:

Here's the code:

public static void createNodeView(EObject element){

PapyrusMultiDiagramEditor editor = (PapyrusMultiDiagramEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().getActiveEditor();


ViewDescriptor viewDescriptor = new ViewDescriptor(
new EObjectAdapter(element), Node.class, String.valueOf(ViewUtil.APPEND), editor.getDiagramEditPart().getDiagramPreferencesHint());


CreateViewRequest req = new CreateViewRequest(viewDescriptor);

Command comm = editor.getDiagramEditPart().getCommand(req);

comm.execute();
}

Here's the 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.diagram.ui.commands.ICommandProxy.ex ecute(ICommandProxy.java:68)
at org.eclipse.gef.commands.CompoundCommand.execute(CompoundCom mand.java:107)
at main.Shared.createNodeView(Shared.java:274)


I can't see the error, any suggestion?
Thanks in advance, 123star
Previous Topic:Actor in Block Definition Diagram?
Next Topic:Change Shape of Collaboration in UML2 Composite Diagram
Goto Forum:
  


Current Time: Fri Apr 26 11:46:15 GMT 2024

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

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

Back to the top