Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » DiagramComposite workbench part
DiagramComposite workbench part [message #1695192] Tue, 12 May 2015 14:40 Go to next message
Jerome Sivadier is currently offline Jerome SivadierFriend
Messages: 15
Registered: May 2015
Junior Member
Hello Michael,

I am trying to extend the new DiagramComposite class from Graphiti 0.10 and I am facing a problem I do not know how to solve. Here it is :
For demo purposes, I am trying to launch a Dialog containing a Graphiti diagram composite from a Graphiti diagram editor. Both diagrams share the same DiagramEditorInput and a common DiagramBehavior but one is extending the DiagramEditor class and the other extends the DiagramComposite class.

Then when I launch the dialog I have tried to instantiate my DiagramComposite with a IWorkbenchPart and without.
* With a IWorkbenchPart, the editor works well but when I close the window (call #dispose()) it unregisters all actions defined in the WorkbenchPart including the ones I have declared in the parent graphical editor !
* Without this IWorkbenchPart the editor does not start because of NullPointerExceptions in the Graphiti library. Actually these NPE are thrown because of many calls to "IDiagramContainerUI#getWorkbenchPart()#getSite()" failing because getWorkbenchPart() returns null.

You can find such calls in ElementDeleteListener (l.64), in DiagramComposite (a lot of times), and in other classes. I have tried to manually modify the variable values to avoid throwing NPE everytime "getWorkbenchPart()#getSite()" is called and it seems to work.

Final question: should I be instantiating a DiagramComposite without a workbench part?
If NO how to solve the dispose() problem?
If YES I guess some refactor is needed in that part of the library. I suggest to replace every "getWorkbenchPart()#getSite()" by a "getSite()" which is defined in IDiagramContainerUI, and add a check in "getSite()" to be sure the WorkbenchPart() is not null there. If so return null.

Thanks for your advice !
Regards,
Jérôme

[Updated on: Tue, 12 May 2015 14:42]

Report message to a moderator

Re: DiagramComposite workbench part [message #1695510 is a reply to message #1695192] Fri, 15 May 2015 13:23 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Jérôme,

the intention is to to start the composite with a workbench part. And it
sounds as if the indirection you describe for getting the site is missing.
Would you file a bug for that, please?

Since this will be an API change I'm afraid we will only be able to do that
for the next developement cycle as we have already passed API freeze...

Thanks,
Michael
Re: DiagramComposite workbench part [message #1695650 is a reply to message #1695510] Mon, 18 May 2015 11:46 Go to previous message
Jerome Sivadier is currently offline Jerome SivadierFriend
Messages: 15
Registered: May 2015
Junior Member
Michael,

Thanks for this reply, here is the bug I have reported: https://bugs.eclipse.org/bugs/show_bug.cgi?id=467502

No problem for the API freeze, I will wait and maybe clone the project and modify it locally if I need this feature in a close future.

Regards,
Jérôme
Previous Topic:Diagram does not update after model is changed
Next Topic:Example/Tutorial for Non-Emf model in Graphiti
Goto Forum:
  


Current Time: Thu Mar 28 14:32:39 GMT 2024

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

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

Back to the top