Search in sources :

Example 1 with CellLabelMouseEventMatcher

use of org.eclipse.nebula.widgets.nattable.ui.matcher.CellLabelMouseEventMatcher in project nebula.widgets.nattable by eclipse.

the class CellLabelMouseEventMatcherTest method shouldTakeTheRegionIntoAccountWhileMatching.

@Test
public void shouldTakeTheRegionIntoAccountWhileMatching() throws Exception {
    CellLabelMouseEventMatcher matcher = new CellLabelMouseEventMatcher(GridRegion.COLUMN_HEADER, MouseEventMatcher.LEFT_BUTTON, TEST_LABEL);
    boolean match = matcher.matches(this.natTableFixture, new MouseEvent(SWTUtils.getLeftClickEvent(100, 100, 0, this.natTableFixture)), new LabelStack(GridRegion.BODY));
    Assert.assertFalse(match);
}
Also used : MouseEvent(org.eclipse.swt.events.MouseEvent) LabelStack(org.eclipse.nebula.widgets.nattable.layer.LabelStack) CellLabelMouseEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.CellLabelMouseEventMatcher) Test(org.junit.Test)

Example 2 with CellLabelMouseEventMatcher

use of org.eclipse.nebula.widgets.nattable.ui.matcher.CellLabelMouseEventMatcher in project nebula.widgets.nattable by eclipse.

the class CellLabelMouseEventMatcherTest method shouldMatchCellsWithCustomLabels.

@Test
public void shouldMatchCellsWithCustomLabels() throws Exception {
    CellLabelMouseEventMatcher matcher = new CellLabelMouseEventMatcher(GridRegion.BODY, MouseEventMatcher.LEFT_BUTTON, TEST_LABEL);
    boolean match = matcher.matches(this.natTableFixture, new MouseEvent(SWTUtils.getLeftClickEvent(100, 100, 0, this.natTableFixture)), new LabelStack(GridRegion.BODY));
    Assert.assertTrue(match);
}
Also used : MouseEvent(org.eclipse.swt.events.MouseEvent) LabelStack(org.eclipse.nebula.widgets.nattable.layer.LabelStack) CellLabelMouseEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.CellLabelMouseEventMatcher) Test(org.junit.Test)

Example 3 with CellLabelMouseEventMatcher

use of org.eclipse.nebula.widgets.nattable.ui.matcher.CellLabelMouseEventMatcher in project nebula.widgets.nattable by eclipse.

the class CellLabelMouseEventMatcherTest method shouldTakeTheButtomIntoAccountWhileMatching.

@Test
public void shouldTakeTheButtomIntoAccountWhileMatching() throws Exception {
    CellLabelMouseEventMatcher matcher = new CellLabelMouseEventMatcher(GridRegion.BODY, MouseEventMatcher.RIGHT_BUTTON, TEST_LABEL);
    boolean match = matcher.matches(this.natTableFixture, new MouseEvent(SWTUtils.getLeftClickEvent(100, 100, 0, this.natTableFixture)), new LabelStack(GridRegion.BODY));
    Assert.assertFalse(match);
}
Also used : MouseEvent(org.eclipse.swt.events.MouseEvent) LabelStack(org.eclipse.nebula.widgets.nattable.layer.LabelStack) CellLabelMouseEventMatcher(org.eclipse.nebula.widgets.nattable.ui.matcher.CellLabelMouseEventMatcher) Test(org.junit.Test)

Aggregations

LabelStack (org.eclipse.nebula.widgets.nattable.layer.LabelStack)3 CellLabelMouseEventMatcher (org.eclipse.nebula.widgets.nattable.ui.matcher.CellLabelMouseEventMatcher)3 MouseEvent (org.eclipse.swt.events.MouseEvent)3 Test (org.junit.Test)3