Package org.eclipse.nebula.widgets.nattable.viewport

Examples of org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer$KeepRowInsideViewportEventHandler


        // all columns will be same size while the NatTable itself will have
        // 100%
        final DataLayer n1DataLayer = new DataLayer(dataProvider);
        n1DataLayer.setColumnPercentageSizing(true);
        n1DataLayer.setRowPercentageSizing(true);
        ViewportLayer layer = new ViewportLayer(new SelectionLayer(n1DataLayer));
        layer.setRegionName(GridRegion.BODY);
        final NatTable n1 = new NatTable(simplePanel, layer);
        GridDataFactory.fillDefaults().grab(true, true).applyTo(n1);

        // example for fixed percentage sizing
        // ensure that the sum of column sizes is not greater than 100
        final DataLayer n2DataLayer = new DataLayer(dataProvider);
        n2DataLayer.setColumnWidthPercentageByPosition(0, 25);
        n2DataLayer.setColumnWidthPercentageByPosition(1, 25);
        n2DataLayer.setColumnWidthPercentageByPosition(2, 50);
        layer = new ViewportLayer(new SelectionLayer(n2DataLayer));
        layer.setRegionName(GridRegion.BODY);
        final NatTable n2 = new NatTable(simplePanel, layer);
        GridDataFactory.fillDefaults().grab(true, true).applyTo(n2);

        // example for mixed percentage sizing
        // configure not every column with the exact percentage value, this way
        // the columns for which
        // no exact values are set will use the remaining space
        final DataLayer n3DataLayer = new DataLayer(dataProvider);
        n3DataLayer.setColumnPercentageSizing(true);
        n3DataLayer.setColumnWidthPercentageByPosition(0, 40);
        n3DataLayer.setColumnWidthPercentageByPosition(2, 40);
        layer = new ViewportLayer(new SelectionLayer(n3DataLayer));
        layer.setRegionName(GridRegion.BODY);
        final NatTable n3 = new NatTable(simplePanel, layer);
        GridDataFactory.fillDefaults().grab(true, true).applyTo(n3);

        // example for mixed fixed/percentage sizing
        // configure not every column with the exact percentage value, this way
        // the columns for which
        // no exact values are set will use the remaining space
        final DataLayer mixDataLayer = new DataLayer(dataProvider);
        mixDataLayer.setColumnPercentageSizing(true);
        mixDataLayer.setColumnPercentageSizing(0, false);
        mixDataLayer.setColumnPercentageSizing(1, false);
        mixDataLayer.setColumnWidthByPosition(0, 100);
        mixDataLayer.setColumnWidthByPosition(1, 100);
        layer = new ViewportLayer(new SelectionLayer(mixDataLayer));
        layer.setRegionName(GridRegion.BODY);
        final NatTable mix = new NatTable(simplePanel, layer);
        GridDataFactory.fillDefaults().grab(true, true).applyTo(mix);

        // example for percentage calculation with default sizing in a grid
        // all columns will be same size while the NatTable itself will have
View Full Code Here


        StandaloneNatExampleRunner.run(new SpanningDataLayerExample());
    }

    public Control createExampleControl(Composite parent) {
        CompositeLayer layer = new CompositeLayer(1, 1);
        layer.setChildLayer(GridRegion.BODY, new ViewportLayer(
                new SelectionLayer(new SpanningDataLayer(
                        new DummySpanningBodyDataProvider(1000000, 1000000)))),
                0, 0);
        return new NatTable(parent, layer);
    }
View Full Code Here

    public static void main(String[] args) throws Exception {
        StandaloneNatExampleRunner.run(new ViewportDataLayerExample());
    }

    public Control createExampleControl(Composite parent) {
        return new NatTable(parent, new ViewportLayer(new DataLayer(
                new DummyBodyDataProvider(1000000, 1000000))));
    }
View Full Code Here

    private ViewportLayer viewportLayer;

    @Before
    public void setUp() {
        this.selectionLayer = new SelectionLayer(new DataLayerFixture(10, 10, 100, 20));
        this.viewportLayer = new ViewportLayer(this.selectionLayer);
    }
View Full Code Here

    public DefaultBodyLayerStack(IUniqueIndexLayer underlyingLayer) {
        columnReorderLayer = new ColumnReorderLayer(underlyingLayer);
        columnHideShowLayer = new ColumnHideShowLayer(columnReorderLayer);
        selectionLayer = new SelectionLayer(columnHideShowLayer);
        viewportLayer = new ViewportLayer(selectionLayer);
        setUnderlyingLayer(viewportLayer);

        registerCommandHandler(new CopyDataCommandHandler(selectionLayer));
    }
View Full Code Here

                columnGroupModel[columnGroupModel.length - 1]);
        columnHideShowLayer = new ColumnHideShowLayer(columnGroupReorderLayer);
        columnGroupExpandCollapseLayer = new ColumnGroupExpandCollapseLayer(
                columnHideShowLayer, columnGroupModel);
        selectionLayer = new SelectionLayer(columnGroupExpandCollapseLayer);
        viewportLayer = new ViewportLayer(selectionLayer);
        setUnderlyingLayer(viewportLayer);

        registerCommandHandler(new CopyDataCommandHandler(selectionLayer));
    }
View Full Code Here

            glazedListsEventLayer = new GlazedListsEventLayer<T>(bodyDataLayer,
                    this.filterList);
            columnReorderLayer = new ColumnReorderLayer(glazedListsEventLayer);
            columnHideShowLayer = new ColumnHideShowLayer(columnReorderLayer);
            selectionLayer = new SelectionLayer(columnHideShowLayer);
            viewportLayer = new ViewportLayer(selectionLayer);
            setUnderlyingLayer(viewportLayer);

            registerCommandHandler(new CopyDataCommandHandler(selectionLayer));
        }
View Full Code Here

                columnReorderLayer, columnGroupModel);
        columnHideShowLayer = new ColumnHideShowLayer(columnGroupReorderLayer);
        columnGroupExpandCollapseLayer = new ColumnGroupExpandCollapseLayer(
                columnHideShowLayer, columnGroupModel);
        selectionLayer = new SelectionLayer(columnGroupExpandCollapseLayer);
        viewportLayer = new ViewportLayer(selectionLayer);
        freezeLayer = new FreezeLayer(selectionLayer);
        compositeFreezeLayer = new CompositeFreezeLayer(freezeLayer,
                viewportLayer, selectionLayer);

        setUnderlyingLayer(compositeFreezeLayer);
View Full Code Here

    @Before
    public void setUp() {
        this.dataLayer = new DataLayerFixture(10, 10, 100, 20);
        this.selectionLayer = new SelectionLayer(this.dataLayer);
        this.viewportLayer = new ViewportLayer(this.selectionLayer);
        this.viewportLayer.setRegionName(GridRegion.BODY);

        this.viewportLayer.addConfiguration(new DefaultEditBindings());
        this.viewportLayer.addConfiguration(new DefaultEditConfiguration());
View Full Code Here

        // directly as body layer is also working.
        IDataProvider bodyDataProvider = new DefaultBodyDataProvider<Person>(
                PersonService.getPersons(10), propertyNames);
        DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        SelectionLayer selectionLayer = new SelectionLayer(bodyDataLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        // build the column header layer
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer$KeepRowInsideViewportEventHandler

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.