Skip to main content



      Home
Home » Eclipse Projects » GEF » Executing directEdit request on EditOart after its creation
Executing directEdit request on EditOart after its creation [message #690023] Tue, 28 June 2011 15:39 Go to next message
Eclipse UserFriend
Hello everyone.
I want to be able to execute direct editing of a label in an EditPart's Figure right after the figure is added to the diagram, as follows:
1) user selects the "Add Figure" tool from the pallete,
2) user clicks on the diagram and a new figure is created (this works already).
3) the application enables the direct editing of the figure's label automatically.
I've been reading the forum and searching the internet but haven't seen this done. Any help?
thanks
Re: Executing directEdit request on EditOart after its creation [message #1426465 is a reply to message #690023] Thu, 18 September 2014 16:06 Go to previous messageGo to next message
Eclipse UserFriend
Is your problem solved?
I want the same thing.
Thanks!
Re: Executing directEdit request on EditOart after its creation [message #1426823 is a reply to message #1426465] Fri, 19 September 2014 05:06 Go to previous message
Eclipse UserFriend
Take a look at DirectEditPolicy, it is used to enable direct editing of an EditPart when it is added/created.

You basically need to extend this (abstract) class by filling the abstract methods:


  • getDirectEditCommand() to provide the actual command to perform the modification/edit.
  • showCurrentEditValue() to update the figure with the 'current value', so the 'cell editor' is able to use the correct dimensions.

Install the policy using
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new MyDirectEditPolicy());
in the createEditPolicies() method of your EditPart.
Previous Topic:Weird Node Resizing Problem
Next Topic:ShortestPathConnectionRouter + bend points: custom bend points not taken into account
Goto Forum:
  


Current Time: Sun Jul 13 17:47:46 EDT 2025

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

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

Back to the top