Examples of IMouseEventMatcher


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

        //
        // }, new ClearHoverStylingAction(layer));

        // clear any hover styling if the mouse is moved out of a NatTable
        // region
        uiBindingRegistry.registerMouseMoveBinding(new IMouseEventMatcher() {
            @Override
            public boolean matches(NatTable natTable, MouseEvent event,
                    LabelStack regionLabels) {
                return (natTable != null && regionLabels == null);
            }

        }, new ClearHoverStylingAction());

        // clear any hover styling if the mouse is moved out of the NatTable
        // area
        uiBindingRegistry.registerMouseExitBinding(new IMouseEventMatcher() {
            @Override
            public boolean matches(NatTable natTable, MouseEvent event,
                    LabelStack regionLabels) {
                // always return true because this matcher is only asked in case
                // the mouse
View Full Code Here

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

    @Override
    public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
        // apply a hover styling on moving the mouse over a NatTable
        uiBindingRegistry.registerFirstMouseMoveBinding(
                new IMouseEventMatcher() {
                    @Override
                    public boolean matches(NatTable natTable, MouseEvent event,
                            LabelStack regionLabels) {
                        return layer.getClientAreaProvider().getClientArea()
                                .contains(event.x, event.y);
                    }

                }, new HoverStylingAction(layer));

        // clear any hover styling if the mouse is moved out of the region area
        // uiBindingRegistry.registerMouseMoveBinding(
        // new IMouseEventMatcher() {
        // @Override
        // public boolean matches(NatTable natTable, MouseEvent event,
        // LabelStack regionLabels) {
        // return
        // (!layer.getClientAreaProvider().getClientArea().contains(event.x,
        // event.y));
        // }
        //
        // }, new ClearHoverStylingAction());

        // clear any hover styling if the mouse is moved out of a NatTable
        // region
        uiBindingRegistry.registerMouseMoveBinding(new IMouseEventMatcher() {
            @Override
            public boolean matches(NatTable natTable, MouseEvent event,
                    LabelStack regionLabels) {
                return (natTable != null && regionLabels == null);
            }

        }, new ClearHoverStylingAction());

        // clear any hover styling if the mouse is moved out of the NatTable
        // area
        uiBindingRegistry.registerMouseExitBinding(new IMouseEventMatcher() {
            @Override
            public boolean matches(NatTable natTable, MouseEvent event,
                    LabelStack regionLabels) {
                // always return true because this matcher is only asked in case
                // the mouse
View Full Code Here

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

        uiBindingRegistry.registerMouseMoveBinding(new MouseEventMatcher(
                GridRegion.COLUMN_HEADER), new HoverStylingAction(layer));

        // clear any hover styling if the mouse is moved out of a NatTable
        // region
        uiBindingRegistry.registerMouseMoveBinding(new IMouseEventMatcher() {
            @Override
            public boolean matches(NatTable natTable, MouseEvent event,
                    LabelStack regionLabels) {
                return ((natTable != null && regionLabels == null) || regionLabels != null
                        && regionLabels.hasLabel(GridRegion.CORNER));
            }

        }, new ClearHoverStylingAction());

        // clear any hover styling if the mouse is moved out of the NatTable
        // area
        uiBindingRegistry.registerMouseExitBinding(new IMouseEventMatcher() {
            @Override
            public boolean matches(NatTable natTable, MouseEvent event,
                    LabelStack regionLabels) {
                // always return true because this matcher is only asked in case
                // the mouse
View Full Code Here

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

    @Override
    public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
        // apply a hover styling on moving the mouse over a NatTable
        uiBindingRegistry.registerFirstMouseMoveBinding(
                new IMouseEventMatcher() {
                    @Override
                    public boolean matches(NatTable natTable, MouseEvent event,
                            LabelStack regionLabels) {

                        int width = layer.getPreferredWidth();
                        int height = layer.getPreferredHeight();

                        return ((event.x > 0 && event.x < width) && (event.y > 0 && event.y < height));
                    }

                }, new HoverStylingAction(layer));

        // clear any hover styling if the mouse is moved out of the region area
        uiBindingRegistry.registerMouseMoveBinding(new IMouseEventMatcher() {
            @Override
            public boolean matches(NatTable natTable, MouseEvent event,
                    LabelStack regionLabels) {
                int width = layer.getPreferredWidth();
                int height = layer.getPreferredHeight();

                return ((event.x < 0 || event.x > width) || (event.y < 0 || event.y > height));
            }

        }, new ClearHoverStylingAction());

        // clear any hover styling if the mouse is moved out of a NatTable
        // region
        uiBindingRegistry.registerMouseMoveBinding(new IMouseEventMatcher() {
            @Override
            public boolean matches(NatTable natTable, MouseEvent event,
                    LabelStack regionLabels) {
                return (natTable != null && regionLabels == null);
            }

        }, new ClearHoverStylingAction());

        // clear any hover styling if the mouse is moved out of the NatTable
        // area
        uiBindingRegistry.registerMouseExitBinding(new IMouseEventMatcher() {
            @Override
            public boolean matches(NatTable natTable, MouseEvent event,
                    LabelStack regionLabels) {
                // always return true because this matcher is only asked in case
                // the mouse
View Full Code Here

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

public class BodyCellEditorMouseEventMatcherTest {

    @Test
    public void testEquals() {
        IMouseEventMatcher matcher1 = new BodyCellEditorMouseEventMatcher(
                TextCellEditor.class);
        IMouseEventMatcher matcher2 = new BodyCellEditorMouseEventMatcher(
                TextCellEditor.class);
        Assert.assertEquals(matcher1, matcher2);
    }
View Full Code Here

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

        Assert.assertEquals(matcher1, matcher2);
    }

    @Test
    public void testNotEqual() {
        IMouseEventMatcher matcher = new BodyCellEditorMouseEventMatcher(
                TextCellEditor.class);
        Assert.assertFalse(matcher.equals(new BodyCellEditorMouseEventMatcher(
                CheckBoxCellEditor.class)));
    }
View Full Code Here

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

public class MouseEventMatcherTest {

    @Test
    public void testDefaultEquals() {
        IMouseEventMatcher matcher1 = new MouseEventMatcher();
        IMouseEventMatcher matcher2 = new MouseEventMatcher();
        Assert.assertEquals(matcher1, matcher2);
    }
View Full Code Here

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

        Assert.assertEquals(matcher1, matcher2);
    }

    @Test
    public void testFullConstructorEquals() {
        IMouseEventMatcher matcher1 = new MouseEventMatcher(5, "Test_Region", 1);
        IMouseEventMatcher matcher2 = new MouseEventMatcher(5, "Test_Region", 1);
        Assert.assertEquals(matcher1, matcher2);
    }
View Full Code Here

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

        Assert.assertEquals(matcher1, matcher2);
    }

    @Test
    public void testNotEqual() {
        IMouseEventMatcher matcher = new MouseEventMatcher(5, "Test_Region", 1);

        Assert.assertFalse(matcher.equals(new MouseEventMatcher(4,
                "Test_Region", 1)));
        Assert.assertFalse(matcher.equals(new MouseEventMatcher(5, "X_Region",
                1)));
        Assert.assertFalse(matcher.equals(new MouseEventMatcher(5,
                "Test_Region", 2)));

        Assert.assertFalse(matcher.equals(new MouseEventMatcher(4, "X_Region",
                2)));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.