Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 09:06 Go to next message
Djordje Stanojevic is currently offline Djordje StanojevicFriend
Messages: 14
Registered: February 2014
Junior Member
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


Djordje Stanojevic
Re: Properties view doesn't work for DnD element [message #1490830 is a reply to message #1486753] Fri, 28 November 2014 13:28 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1894
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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 10:36 Go to previous messageGo to next message
Djordje Stanojevic is currently offline Djordje StanojevicFriend
Messages: 14
Registered: February 2014
Junior Member
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


Djordje Stanojevic

[Updated on: Thu, 04 December 2014 10:37]

Report message to a moderator

Re: Properties view doesn't work for DnD element [message #1503594 is a reply to message #1498341] Mon, 08 December 2014 16:02 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1894
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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 09:02 Go to previous messageGo to next message
Djordje Stanojevic is currently offline Djordje StanojevicFriend
Messages: 14
Registered: February 2014
Junior Member
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


Djordje Stanojevic

[Updated on: Wed, 10 December 2014 09:02]

Report message to a moderator

Re: Properties view doesn't work for DnD element [message #1512237 is a reply to message #1505727] Mon, 15 December 2014 15:28 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1894
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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: Tue Jun 19 01:19:08 GMT 2018

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

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

Back to the top