I am using Panel as a Figure in GEF eclipse. Now on double click I want to add a Label as other normal example shows . How to achieve that.
How to add/edit Label name in Panel of GEF
720 views Asked by Abhishek Choudhary At
1
I am using Panel as a Figure in GEF eclipse. Now on double click I want to add a Label as other normal example shows . How to achieve that.
On the
EditPartthat manages the figure you should install aDIRECT_EDIT_ROLEpolicy (implemented byDirectEditPolicyclass). This will cause yourEditPartto be called when double clicks occur on the figure. The framework will call methodperformRequestwith aRequestConstants.REQ_OPENorRequestConstants.REQ_DIRECT_EDITrequest. Upon receiving the request you can add whatever you want to the figure and refresh visuals.If you want to edit text inside a
Label, you can see how I implemented this here.Good luck.