Class CellPainterMouseEventMatcher
java.lang.Object
org.eclipse.nebula.widgets.nattable.ui.matcher.MouseEventMatcher
org.eclipse.nebula.widgets.nattable.ui.matcher.CellPainterMouseEventMatcher
- All Implemented Interfaces:
IMouseEventMatcher
- Direct Known Subclasses:
ClearFilterIconMouseEventMatcher
,ComboBoxClearFilterIconMouseEventMatcher
Matches a mouse click on an
ICellPainter
within a cell in a specified
region.-
Field Summary
Fields inherited from class org.eclipse.nebula.widgets.nattable.ui.matcher.MouseEventMatcher
LEFT_BUTTON, RIGHT_BUTTON
-
Constructor Summary
ConstructorsConstructorDescriptionCellPainterMouseEventMatcher
(int stateMask, String regionName, int button, Class<? extends ICellPainter> targetCellPainterClass) Creates aCellPainterMouseEventMatcher
for a given state mask, region name, mouse button and a target cellPainter class.CellPainterMouseEventMatcher
(int stateMask, String regionName, int button, ICellPainter targetCellPainter) Creates aCellPainterMouseEventMatcher
for a given state mask, region name, mouse button and a specific target cellPainter instance.CellPainterMouseEventMatcher
(String regionName, int button, Class<? extends ICellPainter> targetCellPainterClass) Creates aCellPainterMouseEventMatcher
for a given region name, mouse button and a target cellPainter class.CellPainterMouseEventMatcher
(String regionName, int button, ICellPainter targetCellPainter) Creates aCellPainterMouseEventMatcher
for a given region name, mouse button and a specific target cellPainter instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
matches
(NatTable natTable, org.eclipse.swt.events.MouseEvent event, LabelStack regionLabels) Figures out if the mouse event occurred in the supplied region.Methods inherited from class org.eclipse.nebula.widgets.nattable.ui.matcher.MouseEventMatcher
bodyLeftClick, bodyRightClick, columnGroupHeaderLeftClick, columnGroupHeaderRightClick, columnHeaderLeftClick, columnHeaderRightClick, equals, getButton, getEventRegion, getStateMask, hashCode, rowGroupHeaderLeftClick, rowGroupHeaderRightClick, rowHeaderLeftClick, rowHeaderRightClick
-
Constructor Details
-
CellPainterMouseEventMatcher
Creates aCellPainterMouseEventMatcher
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 aGridRegion
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
andMouseEventMatcher.RIGHT_BUTTON
targetCellPainter
- TheICellPainter
instance that should be used for the check.
-
CellPainterMouseEventMatcher
public CellPainterMouseEventMatcher(int stateMask, String regionName, int button, ICellPainter targetCellPainter) Creates aCellPainterMouseEventMatcher
for a given state mask, 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:
stateMask
- the state of the keyboard modifier keys and mouse masks at the time the event was generated.regionName
- The name of the region where this matcher should react on. Typically aGridRegion
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
andMouseEventMatcher.RIGHT_BUTTON
targetCellPainter
- TheICellPainter
instance that should be used for the check.- Since:
- 2.1
-
CellPainterMouseEventMatcher
public CellPainterMouseEventMatcher(String regionName, int button, Class<? extends ICellPainter> targetCellPainterClass) Creates aCellPainterMouseEventMatcher
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 aGridRegion
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
andMouseEventMatcher.RIGHT_BUTTON
targetCellPainterClass
- The concrete type of theICellPainter
that should be used for the check.
-
CellPainterMouseEventMatcher
public CellPainterMouseEventMatcher(int stateMask, String regionName, int button, Class<? extends ICellPainter> targetCellPainterClass) Creates aCellPainterMouseEventMatcher
for a given state mask, 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:
stateMask
- the state of the keyboard modifier keys and mouse masks at the time the event was generated.regionName
- The name of the region where this matcher should react on. Typically aGridRegion
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
andMouseEventMatcher.RIGHT_BUTTON
targetCellPainterClass
- The concrete type of theICellPainter
that should be used for the check.- Since:
- 2.1
-
-
Method Details
-
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 interfaceIMouseEventMatcher
- Overrides:
matches
in classMouseEventMatcher
- Parameters:
natTable
- The NatTable on which theMouseEvent
occured.event
- The SWTMouseEvent
.regionLabels
- TheLabelStack
with the region labels of theMouseEvent
coordinates.- Returns:
true
if theMouseEvent
matches thisIMouseEventMatcher
and should therefore be handled,false
if not
-