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 12:50 Go to next message
Adrian Mouat is currently offline Adrian Mouat
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 07:09 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1587
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 11:35 Go to previous message
Adrian Mouat is currently offline Adrian Mouat
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 11: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: Wed Aug 27 17:15:26 EDT 2014

Powered by FUDForum. Page generated in 0.05045 seconds