| package org.eclipse.nebula.widgets.nattable.renderer.swt.event.binding |
| |
| import java.util.LinkedList |
| import org.eclipse.swt.events.KeyEvent |
| import org.eclipse.swt.events.MouseEvent |
| |
| class UiBindingsImpl implements UiBindings { |
| |
| val keyBindings = new LinkedList<KeyBinding> |
| val mouseMoveBindings = new LinkedList<MouseBinding> |
| val mouseDownBindings = new LinkedList<MouseBinding> |
| val singleClickBindings = new LinkedList<MouseBinding> |
| val doubleClickBindings = new LinkedList<MouseBinding> |
| val dragBindings = new LinkedList<DragBinding> |
| |
| def getKeyBindings() { keyBindings } |
| def getMouseMoveBindings() { mouseMoveBindings } |
| def getMouseDownBindings() { mouseDownBindings } |
| def getSingleClickBindings() { singleClickBindings } |
| def getDoubleClickBindings() { doubleClickBindings } |
| |
| // Lookup ///////////////////////////////////////////////////////////////// |
| |
| override getKeyEventAction(KeyEvent event) { |
| keyBindings.findFirst([ matcher.matches(event) ])?.action |
| } |
| |
| override getMouseMoveAction(MouseEvent event) { |
| mouseMoveBindings.findFirst([ matcher.matches(event) ])?.action |
| } |
| |
| override getMouseDownAction(MouseEvent event) { |
| mouseDownBindings.findFirst([ matcher.matches(event) ])?.action |
| } |
| |
| override getSingleClickAction(MouseEvent event) { |
| singleClickBindings.findFirst([ matcher.matches(event) ])?.action |
| } |
| |
| override getDoubleClickAction(MouseEvent event) { |
| doubleClickBindings.findFirst([ matcher.matches(event) ])?.action |
| } |
| |
| override getDragAction(MouseEvent event) { |
| dragBindings.findFirst([ matcher.matches(event) ])?.action |
| } |
| |
| } |