Class CellEditorMouseEventMatcher

  • All Implemented Interfaces:
    IMouseEventMatcher

    public class CellEditorMouseEventMatcher
    extends Object
    implements IMouseEventMatcher
    Implementation of IMouseEventMatcher that will check if editing should be activated. For this it is possible to specify the region label to react on, the mouse button that was used to click and if an editor is registered for the cell on which the mouse click was executed. If no region label is specified, only the mouse button and the presence of a cell editor is evaluated.

    If not specified, this matcher will react on the left mouse button.

    • Constructor Detail

      • CellEditorMouseEventMatcher

        public CellEditorMouseEventMatcher()
        Will create a new CellEditorMouseEventMatcher that will only evaluate the presence of a cell editor and the mouse left click.
      • CellEditorMouseEventMatcher

        public CellEditorMouseEventMatcher​(int button)
        Will create a new CellEditorMouseEventMatcher that will only evaluate the presence of a cell editor and the specified mouse click.
        Parameters:
        button - The mouse button that need to be pressed or released for this matcher to react.
      • CellEditorMouseEventMatcher

        public CellEditorMouseEventMatcher​(String regionLabel)
        Will create a new CellEditorMouseEventMatcher for the specified grid region and the mouse left click.
        Parameters:
        regionLabel - the label that specifies the region this matcher should be attached.
      • CellEditorMouseEventMatcher

        public CellEditorMouseEventMatcher​(String regionLabel,
                                           int button)
        Will create a new CellEditorMouseEventMatcher for the specified grid region and mouse button.
        Parameters:
        regionLabel - the label that specifies the region this matcher should be attached.
        button - The mouse button that need to be pressed or released for this matcher to react.
    • Method Detail

      • matches

        public boolean matches​(NatTable natTable,
                               org.eclipse.swt.events.MouseEvent event,
                               LabelStack regionLabels)
        Description copied from interface: IMouseEventMatcher
        Figures out if the mouse event occurred in the supplied region.
        Specified by:
        matches in interface IMouseEventMatcher
        Parameters:
        natTable - The NatTable on which the MouseEvent occured.
        event - The SWT MouseEvent.
        regionLabels - The LabelStack with the region labels of the MouseEvent coordinates.
        Returns:
        true if the MouseEvent matches this IMouseEventMatcher and should therefore be handled, false if not