Package org.eclipse.nebula.widgets.nattable.ui.matcher

Examples of org.eclipse.nebula.widgets.nattable.ui.matcher.CellLabelMouseEventMatcher


         * Configure the UI bindings for the mouse click
         */
        public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
            // Match a mouse event on the body, when the left button is clicked
            // and the custom cell label is present
            CellLabelMouseEventMatcher mouseEventMatcher = new CellLabelMouseEventMatcher(
                    GridRegion.BODY, MouseEventMatcher.LEFT_BUTTON,
                    Rendereing_a_cell_as_a_button.CUSTOM_CELL_LABEL);

            // Inform the button painter of the click.
            uiBindingRegistry.registerMouseDownBinding(mouseEventMatcher,
View Full Code Here


        natTableFixture.registerLabelOnColumn(bodyDataLayer, 0, TEST_LABEL);
    }

    @Test
    public void shouldMatchCellsWithCustomLabels() throws Exception {
        CellLabelMouseEventMatcher matcher = new CellLabelMouseEventMatcher(
                GridRegion.BODY, MouseEventMatcher.LEFT_BUTTON, TEST_LABEL);

        boolean match = matcher.matches(natTableFixture, new MouseEvent(
                SWTUtils.getLeftClickEvent(100, 100, 0, natTableFixture)),
                new LabelStack(GridRegion.BODY));

        Assert.assertTrue(match);
    }
View Full Code Here

        Assert.assertTrue(match);
    }

    @Test
    public void shouldTakeTheRegionIntoAccountWhileMatching() throws Exception {
        CellLabelMouseEventMatcher matcher = new CellLabelMouseEventMatcher(
                GridRegion.COLUMN_HEADER, MouseEventMatcher.LEFT_BUTTON,
                TEST_LABEL);

        boolean match = matcher.matches(natTableFixture, new MouseEvent(
                SWTUtils.getLeftClickEvent(100, 100, 0, natTableFixture)),
                new LabelStack(GridRegion.BODY));

        Assert.assertFalse(match);
    }
View Full Code Here

        Assert.assertFalse(match);
    }

    @Test
    public void shouldTakeTheButtomIntoAccountWhileMatching() throws Exception {
        CellLabelMouseEventMatcher matcher = new CellLabelMouseEventMatcher(
                GridRegion.BODY, MouseEventMatcher.RIGHT_BUTTON, TEST_LABEL);

        boolean match = matcher.matches(natTableFixture, new MouseEvent(
                SWTUtils.getLeftClickEvent(100, 100, 0, natTableFixture)),
                new LabelStack(GridRegion.BODY));

        Assert.assertFalse(match);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.ui.matcher.CellLabelMouseEventMatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.