Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » How to directedit text in customfeature?
How to directedit text in customfeature? [message #1778959] Tue, 26 December 2017 13:31 Go to next message
xi yahui is currently offline xi yahuiFriend
Messages: 32
Registered: October 2017
Member
I want to provider directedit in contextmenu.
I can call the directedit after the shape is added. But when I put the code in the custom feature, I can't call the directedit.
In the custom feature, the code as:
IDirectEditingInfo directEditingInfo = getFeatureProvider().getDirectEditingInfo();
directEditingInfo.setActive(true);
directEditingInfo.setMainPictogramElement(containerShape);
directEditingInfo.setPictogramElement(shape);
directEditingInfo.setGraphicsAlgorithm(shape.getGraphicsAlgorithm());
Re: How to directedit text in customfeature? [message #1778982 is a reply to message #1778959] Wed, 27 December 2017 14:15 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
In the add feature you usually enable direct editing by calling:
getFeatureProvider().getDirectEditingInfo().setActive(true);

Afterwards the diagram is refreshed automatically since something is added to it. That is probably missing in the case of your custom feature (not sure what else is done there). Have you tried to trigger a refresh of the diagram in the end of your feature (DiagramBehavior or DiagramRefreshBehavior.refresh())?

Michael
Re: How to directedit text in customfeature? [message #1778992 is a reply to message #1778982] Thu, 28 December 2017 00:38 Go to previous message
xi yahui is currently offline xi yahuiFriend
Messages: 32
Registered: October 2017
Member
Thanks. I can do it by adding the refresh method.
getDiagramBehavior().refresh();
Previous Topic:How to prevent the selection of Shape
Next Topic:Can I draw a line rather than a connection?
Goto Forum:
  


Current Time: Fri Apr 26 22:11:51 GMT 2024

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

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

Back to the top