Skip to main content



      Home
Home » Modeling » Graphiti » Properties view doesn't work for DnD element
Properties view doesn't work for DnD element [message #1486753] Tue, 25 November 2014 04:06 Go to next message
Eclipse UserFriend
Hi everyone,


I'm newbie in modeling world and Graphiti, and I am trying to create simple RCP application with Graphiti Diagram.


All of my business objects are saved into one xmi file, which I can see and edit from the tree view.
I have implemented properties view for all my elements, and it works as I expected, but when I DnD business element from the tree view into diagram, and change any of its attributes through properties view, I'm getting Null Pointer Exception for my TransactionalEditingDomain.

Here is my part of code:
 if (m_componentDescription.isFocusControl()) {
      final PictogramElement pictogramElement =  getSelectedPictogramElement();
      final Component component = (Component) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pictogramElement);

      final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(component); //here I'm getting exception
      editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {...


Can anyone help me with this ?

Thanks in advance...
Djordje
Re: Properties view doesn't work for DnD element [message #1490830 is a reply to message #1486753] Fri, 28 November 2014 08:28 Go to previous messageGo to next message
Eclipse UserFriend
Djordje,

have you seen question 3 in our FAQ? That might help in building that.
https://www.eclipse.org/graphiti/developers/faq.php

You need to use the editing domain of the editor (get it from DiagramEditor)
and use that for modifications if you have a property sheet associated to
the diagram. TransactionUtil will not be able to provide the right editing
domain in that case.

Michael
Re: Properties view doesn't work for DnD element [message #1498341 is a reply to message #1490830] Thu, 04 December 2014 05:36 Go to previous messageGo to next message
Eclipse UserFriend
Michael,

Thank you for your reply.

I would be very thankful if you could give me any example of editor editing domain usage.
I have tried to use getDiagramEditor method, but this method is deprecated. Which method should I use instead ?

Thank you in advance...

Djordje

[Updated on: Thu, 04 December 2014 05:37] by Moderator

Re: Properties view doesn't work for DnD element [message #1503594 is a reply to message #1498341] Mon, 08 December 2014 11:02 Go to previous messageGo to next message
Eclipse UserFriend
Djordje,

I gues you have a GFPropertySection, right? There is a method
getDiagramContainer you should call that will return the editor in the end
(DiagramContainers are any kind of UIs that can hold a diagram, e.g.
editors, views).

Michael
Re: Properties view doesn't work for DnD element [message #1505727 is a reply to message #1503594] Wed, 10 December 2014 04:02 Go to previous messageGo to next message
Eclipse UserFriend
Michael,

Again, Thanks for your reply...

Yes I have GFPropertySection, and I have found method you mentioned above,
but what should I do next to get editing domain?

Djordje

[Updated on: Wed, 10 December 2014 04:02] by Moderator

Re: Properties view doesn't work for DnD element [message #1512237 is a reply to message #1505727] Mon, 15 December 2014 10:28 Go to previous message
Eclipse UserFriend
Djordje,

well, after that you can use the editing domain to execute your change.
Something like:

editingDomain.getCommandStack().execute(command);
where command is a subclass of EMF RecordingCommand.

HTH,
Michael
Previous Topic:Create automatic decoration between two pictogram elements
Next Topic:Move the Parent ContainerShape from its Children
Goto Forum:
  


Current Time: Wed Jul 23 22:28:20 EDT 2025

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

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

Back to the top