开发者

Disable double click in palette of Eclipse RCP project

开发者 https://www.devze.com 2023-01-30 17:21 出处:网络
I have an Eclipse RCP application with a canvas and a palette full of items. The user can click on any item in the palette to select it and then drop it anywhere on the canvas.

I have an Eclipse RCP application with a canvas and a palette full of items. The user can click on any item in the palette to select it and then drop it anywhere on the canvas.

If the user double clicks开发者_开发百科 an item, it gets immediately dropped on the canvas in the upper left corner. Is there a way to disable the double click in the palette?


If your are using DiagramEditorWithFlyOutPalette, the mouse listener is directly attached in that class. Thus you can hardly hack it. But it provides the method toolSupportsAccessibility() that allows you to define if your current tool (ie. the item in the palette) supports the access via double-click or enter-key.

So if you override toolSupportsAccessibility() and return false, the double-click will have no effect.

0

精彩评论

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