开发者

How to add/edit Label name in Panel of GEF

开发者 https://www.devze.com 2023-02-14 14:09 出处:网络
I am using Panel as a Figure in GEF e开发者_如何学Pythonclipse. Now on double click I want to add a Label as other normal example shows .

I am using Panel as a Figure in GEF e开发者_如何学Pythonclipse. Now on double click I want to add a Label as other normal example shows . How to achieve that.


On the EditPart that manages the figure you should install a DIRECT_EDIT_ROLE policy (implemented by DirectEditPolicy class). This will cause your EditPart to be called when double clicks occur on the figure. The framework will call method performRequest with a RequestConstants.REQ_OPEN or RequestConstants.REQ_DIRECT_EDIT request. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号