Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Call Direct Edit feature
Call Direct Edit feature [message #756064] Thu, 10 November 2011 17:50 Go to next message
Adrian Mouat is currently offline Adrian MouatFriend
Messages: 16
Registered: September 2011
Junior Member
Hi,

I have set up a custom feature to handle double click events. From this, I would like to call my DirectEditFeature. I can easily get the appropriate feature, but execute() is defined as a no-op it seems.

There is documentation for calling direct edit immediately after object creation, but this solution doesn't work if the object has already been created.

So, is there a way to invoke direct edit? (And why not implement the execute method?)

Regards,

Adrian.
Re: Call Direct Edit feature [message #756182 is a reply to message #756064] Fri, 11 November 2011 12:09 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
After providing the directEditingInfo (I gues that is what you mean) you
will have to enforce a refresh on the diagram editor
(DiagramEditor.refresh()). That should enable direct editing.

HTH,
Michael
Re: Call Direct Edit feature [message #756252 is a reply to message #756182] Fri, 11 November 2011 16:35 Go to previous message
Adrian Mouat is currently offline Adrian MouatFriend
Messages: 16
Registered: September 2011
Junior Member
Yes, it works now. Many thanks!

For anyone looking to do the same you will need code something like:

IDirectEditingInfo directEditingInfo =
getFeatureProvider().getDirectEditingInfo();
directEditingInfo.setMainPictogramElement(pe);

//pe should be shape and ga text
directEditingInfo.setPictogramElement(s);
directEditingInfo.setGraphicsAlgorithm(s.getGraphicsAlgorithm());

directEditingInfo.setActive(true);
getDiagramEditor().refresh();

[Updated on: Fri, 11 November 2011 16:41]

Report message to a moderator

Previous Topic:Connections with Horizontal start and end & Moving Bendpoints
Next Topic:Getting IProject instance associated to a Diagram
Goto Forum:
  


Current Time: Thu Apr 25 15:41:54 GMT 2024

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

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

Back to the top