Examples of DummyGridLayerStack


Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

    private DummyGridLayerStack gridLayer;
    private LayerListenerFixture listener;

    @Before
    public void setup() {
        gridLayer = new DummyGridLayerStack();
        natTable = new NatTable(new Shell(Display.getDefault()), gridLayer);
        natTable.setSize(400, 400);
        natTable.doCommand(new InitializeClientAreaCommandFixture());
        dragMode = new CellSelectionDragMode();
        Event event = new Event();
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

public class RowHideShowLayerTest2 {

    @Test
    public void shouldFireTheCorrectEventOnRowHide() throws Exception {
        NatTable natTable = new NatTableFixture(new Shell(),
                new DummyGridLayerStack() {

                    @Override
                    protected void init(IUniqueIndexLayer bodyDataLayer,
                            IUniqueIndexLayer columnHeaderDataLayer,
                            IUniqueIndexLayer rowHeaderDataLayer,
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

     */
    @Test
    public void scrollAndHideTheLastRow() throws Exception {
        // Total rows in fixture - 20 (index 0 - 19)
        NatTableFixture natTable = new NatTableFixture(new Shell(),
                new DummyGridLayerStack() {

                    @Override
                    protected void init(IUniqueIndexLayer bodyDataLayer,
                            IUniqueIndexLayer columnHeaderDataLayer,
                            IUniqueIndexLayer rowHeaderDataLayer,
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

    private NatTableFixture natTableFixture;

    @Before
    public void setup() {
        natTableFixture = new NatTableFixture(new Shell(),
                new DummyGridLayerStack() {

                    @Override
                    protected void init(IUniqueIndexLayer bodyDataLayer,
                            IUniqueIndexLayer columnHeaderDataLayer,
                            IUniqueIndexLayer rowHeaderDataLayer,
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

    /**
     * These sequence of actions were causing a nasty bug in AutoResize
     */
    @Test
    public void autoResizeOneColumn() throws Exception {
        GridLayer gridLayer = new DummyGridLayerStack();
        setClientAreaProvider(gridLayer);

        // Resize column
        gridLayer.doCommand(new ColumnResizeCommand(gridLayer, 2, 10));
        assertEquals(10, gridLayer.getColumnWidthByPosition(2));

        // Auto resize the one column
        InitializeAutoResizeColumnsCommand command = new InitializeAutoResizeColumnsCommand(
                gridLayer, 2, configRegistry, gcFactory);
        gridLayer.doCommand(command);
        // Note: the actual resized width is platform specific (font
        // dependency),
        // hence we can't compare against a fixed value.
        int columnWidth = gridLayer.getColumnWidthByPosition(2);
        assertTrue(columnWidth > 10);

        // Reorder columns
        gridLayer.doCommand(new ColumnReorderCommand(gridLayer, 2, 1));
        assertEquals(columnWidth, gridLayer.getColumnWidthByPosition(1));

        // Select all columns
        gridLayer.doCommand(new SelectAllCommand());

        // Resize all selected columns
        command = new InitializeAutoResizeColumnsCommand(gridLayer, 1,
                configRegistry, gcFactory);
        gridLayer.doCommand(command);

        for (int columnPosition = 1; columnPosition <= 20; columnPosition++) {
            assertTrue(
                    "column "
                            + columnPosition
                            + " should have been resized, but it is still its original width",
                    gridLayer.getColumnWidthByPosition(columnPosition) != 100);
        }
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

    private static final String TEST_LABEL = "testLabel";
    private NatTableFixture natTableFixture;

    @Before
    public void setUpCustomCellLabel() {
        DummyGridLayerStack gridLayerStack = new DummyGridLayerStack(5, 5);
        natTableFixture = new NatTableFixture(gridLayerStack);

        // Register custom label
        DataLayer bodyDataLayer = (DataLayer) gridLayerStack.getBodyDataLayer();
        natTableFixture.registerLabelOnColumn(bodyDataLayer, 0, TEST_LABEL);
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

    /**
     * Test for bug NTBL-431
     */
    @Test
    public void reiszeColumnInATableWithNoRows() throws Exception {
        NatTableFixture natTable = new NatTableFixture(new DummyGridLayerStack(
                5, 0), true);

        assertEquals(100, natTable.getColumnWidthByPosition(2));
        natTable.doCommand(new ColumnResizeCommand(natTable, 2, 150));

View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

    private DefaultGridLayer layerStack;
    private SelectionLayer selectionLayer;

    @Before
    public void setup() {
        layerStack = new DummyGridLayerStack(10, 5);
        selectionLayer = layerStack.getBodyLayer().getSelectionLayer();
        natTable = new NatTableFixture(layerStack, 1000, 200, true);
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

    private int eventCount = 0;
    private boolean updated = false;
    private ColumnOverrideLabelAccumulator columnLabelAccumulator;

    public NatTableFixture() {
        super(new Shell(), new DummyGridLayerStack(), true);
        initClientArea();
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

        }
        return columnLabelAccumulator;
    }

    public void scrollToColumn(int gridColumnPosition) {
        DummyGridLayerStack gridLayer = (DummyGridLayerStack) getUnderlyingLayerByPosition(
                1, 1);
        ViewportLayer viewportLayer = gridLayer.getBodyLayer()
                .getViewportLayer();
        viewportLayer.invalidateHorizontalStructure();
        viewportLayer.setOriginX(viewportLayer
                .getStartXOfColumnPosition(gridColumnPosition));
    }
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.