Package org.eclipse.nebula.widgets.nattable.test.fixture.layer

Examples of org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture


    private DataLayer dataLayer;

    @Before
    public void setup() {
        dataLayer = new DataLayerFixture();
    }
View Full Code Here


    @Before
    public void setup() {
        model = new ColumnGroupModelFixture();
        model.addColumnsIndexesToGroup("G4", 8, 9);

        bodyStack = new ColumnGroupBodyLayerStack(new DataLayerFixture(20, 10,
                10, 20), model);

        new NatTableFixture(bodyStack); // Inits client area
    }
View Full Code Here

    };

    @Before
    public void setUp() {
        this.selectionLayer = new SelectionLayer(new DataLayerFixture(10, 10, 100, 40));
        // Selection grid origin as starting point
        this.selectionLayer.setSelectedCell(0, 0);
        this.moveCommandHandler = new MoveCellSelectionCommandHandler(this.selectionLayer);
    }
View Full Code Here

    @Test
    public void getWidth() throws Exception {
        assertEquals(150, layerFixture.getWidth());

        // 20 columns total - 100 wide each
        layerFixture.setChildLayer(GridRegion.CORNER, new DataLayerFixture(10,
                10, 100, 20), 0, 0);
        layerFixture.setChildLayer(GridRegion.COLUMN_HEADER,
                new DataLayerFixture(10, 10, 100, 20), 1, 0);

        assertEquals(2000, layerFixture.getWidth());
    }
View Full Code Here

    @Test
    public void getHeight() throws Exception {
        assertEquals(70, layerFixture.getHeight());

        // 20 rows, each 20 high
        layerFixture.setChildLayer(GridRegion.CORNER, new DataLayerFixture(10,
                10, 100, 20), 0, 0);
        layerFixture.setChildLayer(GridRegion.ROW_HEADER, new DataLayerFixture(
                10, 10, 100, 20), 0, 1);

        assertEquals(400, layerFixture.getHeight());
    }
View Full Code Here

    private ILayer layer;

    @Before
    public void setup() {
        layer = new DataLayerFixture();
    }
View Full Code Here

    private SelectionLayer selectionLayer;
    private RowHideShowLayer rowHideShowLayer;

    @Before
    public void setUp() {
        rowHideShowLayer = new RowHideShowLayer(new DataLayerFixture());
        selectionLayer = new SelectionLayer(rowHideShowLayer);
    }
View Full Code Here

    private SelectionLayer selectionLayer;
    private SelectColumnCommandHandler commandHandler;

    @Before
    public void setUp() {
        selectionLayer = new SelectionLayer(new DataLayerFixture(10, 50, 100,
                40));
        // Selection grid origin as starting point
        selectionLayer.setSelectedCell(0, 0);
        commandHandler = new SelectColumnCommandHandler(selectionLayer);
    }
View Full Code Here

        Assert.assertEquals(6, rowHideShowLayer.getRowIndexByPosition(6));
    }

    @Test
    public void showRowPositions() throws Exception {
        rowHideShowLayer = new RowHideShowLayerFixture(new DataLayerFixture(2,
                10, 100, 20));

        assertEquals(10, rowHideShowLayer.getRowCount());

        rowHideShowLayer.hideRowPositions(Arrays.asList(3, 4, 5));
View Full Code Here

public class MaxCellBoundsHelperTest {

    @Test
    public void getPreferedColumnWidths() throws Exception {
        DataLayerFixture dataLayer = new DataLayerFixture(2, 3, 10, 10);
        IDataProvider dataProvider = dataLayer.getDataProvider();

        // Col 0
        dataProvider.setDataValue(0, 0, "Long");
        dataProvider.setDataValue(0, 1, "Longer");
        dataProvider.setDataValue(0, 2, "Longest Text");

        // Col 1
        dataProvider.setDataValue(1, 0, "Elephant");
        dataProvider.setDataValue(1, 1, "Cat");
        dataProvider.setDataValue(1, 2, "Rat");

        AutoResizeColumnCommandFixture command = new AutoResizeColumnCommandFixture();
        GCFactory gcFactory = command.getGCFactory();
        IConfigRegistry registry = command.getConfigRegistry();
        GC gc = gcFactory.createGC();
        int col0MaxTextWidth = new TextPainter().getPreferredWidth(
                new CellFixture("Longest Text"), gc, registry);
        int col1MaxTextWidth = new TextPainter().getPreferredWidth(
                new CellFixture("Elephant"), gc, registry);
        gc.dispose();

        int[] maxColumnWidths = MaxCellBoundsHelper.getPreferredColumnWidths(
                registry, gcFactory, dataLayer, new int[] { 0, 1 });

        // Adjust widths
        int col0AdjustedMaxWidth = dataLayer.getLayerPainter()
                .adjustCellBounds(0, 0,
                        new Rectangle(0, 0, maxColumnWidths[0], 10)).width;
        int col1AdjustedMaxWidth = dataLayer.getLayerPainter()
                .adjustCellBounds(1, 0,
                        new Rectangle(0, 0, maxColumnWidths[1], 10)).width;

        Assert.assertEquals(col0MaxTextWidth, col0AdjustedMaxWidth);
        Assert.assertEquals(col1MaxTextWidth, col1AdjustedMaxWidth);
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.test.fixture.layer.DataLayerFixture

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.