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.
精彩评论