(转)GEF中鼠标双击事件的截获

本文介绍如何在Eclipse GEF框架中处理鼠标双击事件。通过重载figure对应的editpart中的performRequest方法,并检查Request的类型为REQ_OPEN来实现。此方法作为回调在SelectEditPartTracker的performOpen方法中被调用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://dev.eclipse.org/mhonarc/lists/gef-dev/msg00183.html
Ask:
How to add a double click event or Request on a figure?when double click on a figure, a dialog pop up and do some actions.for example when double click on
a UML class figure, a dialog pop up, user can Add a method to the class.
Answer:
This is already done in GEF. Your editpart will receive a performRequest(req) with the type RequestConstants.REQ_OPEN.
See SelectEditPartTRacker#performOpen()

-randy
就是在figure对应的editpart中重载方法performRequest(Request req),并判断req的type是否为RequestConstants.REQ_OPEN,如果是,则处理这个双击事件.
这个方法是个回调方法,在SelectEditPartTRacker#performOpen() 中调用的.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值