Search code examples
javaeclipseeclipse-rcppalette

Disable double click in palette of Eclipse RCP project


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?


Solution

  • 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.