Class CellPainterMouseEventMatcher

    • Constructor Detail

      • CellPainterMouseEventMatcher

        public CellPainterMouseEventMatcher​(String regionName,
                                            int button,
                                            ICellPainter targetCellPainter)
        Creates a CellPainterMouseEventMatcher for a given region name, mouse button and a specific target cellPainter instance. Can be used in case one single painter instance is registered that should be checked for.
        Parameters:
        regionName - The name of the region where this matcher should react on. Typically a GridRegion if a default grid is used. Can also be another value in case a custom region label is defined in a custom composition.
        button - The mouse button this matcher should react on, e.g. MouseEventMatcher.LEFT_BUTTON and MouseEventMatcher.RIGHT_BUTTON
        targetCellPainter - The ICellPainter instance that should be used for the check.
      • CellPainterMouseEventMatcher

        public CellPainterMouseEventMatcher​(String regionName,
                                            int button,
                                            Class<? extends ICellPainter> targetCellPainterClass)
        Creates a CellPainterMouseEventMatcher for a given region name, mouse button and a target cellPainter class. Can be used in case every instance of a painter should be treated the same way, e.g. checkboxes.
        Parameters:
        regionName - The name of the region where this matcher should react on. Typically a GridRegion if a default grid is used. Can also be another value in case a custom region label is defined in a custom composition.
        button - The mouse button this matcher should react on, e.g. MouseEventMatcher.LEFT_BUTTON and MouseEventMatcher.RIGHT_BUTTON
        targetCellPainterClass - The concrete type of the ICellPainter that should be used for the check.
    • 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
        Overrides:
        matches in class MouseEventMatcher
        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