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

Examples of org.eclipse.nebula.widgets.nattable.layer.DataLayer


    private boolean visible = true;

    public GroupByHeaderLayer(GroupByModel groupByModel, ILayer gridLayer,
            IDataProvider columnHeaderDataProvider) {
        super(new DataLayer(new IDataProvider() {
            @Override
            public Object getDataValue(int columnIndex, int rowIndex) {
                return null;
            }
View Full Code Here


    public Control createExampleControl(Composite parent) {
        gridLayer = new SelectionExampleGridLayer();
        NatTable natTable = new NatTable(parent, gridLayer, false);
        IConfigRegistry configRegistry = new ConfigRegistry();

        DataLayer bodyDataLayer = gridLayer.getBodyDataLayer();

        // Step 1: Create a label accumulator - adds custom labels to all cells
        // which we
        // wish to render differently. In this case render as a button.
        ColumnOverrideLabelAccumulator cellLabelAccumulator = new ColumnOverrideLabelAccumulator(
                bodyDataLayer);
        cellLabelAccumulator.registerColumnOverrides(2, CUSTOM_CELL_LABEL);

        // Step 2: Register label accumulator
        bodyDataLayer.setConfigLabelAccumulator(cellLabelAccumulator);

        // Step 3: Register your custom cell painter, cell style, against the
        // label applied to the cell.
        addButtonToColumn(configRegistry, natTable);
        natTable.addConfiguration(new ButtonClickConfiguration<RowDataFixture>(
View Full Code Here

    @Before
    public void setUp() {
        contents = new ArrayList<String>(Arrays.asList("one", "two", "three",
                "four"));
        underlyingLayer = new DataLayer(new ListDataProvider<String>(contents,
                new IColumnAccessor<String>() {

                    @Override
                    public Object getDataValue(String rowObject, int columnIndex) {
                        return rowObject;
View Full Code Here

    @Before
    public void setUp() {
        contents = new ArrayList<List<String>>();
        contents.add(new ArrayList<String>(Arrays.asList("one", "two", "three",
                "four")));
        underlyingLayer = new DataLayer(new ListDataProvider<List<String>>(
                contents, new IColumnAccessor<List<String>>() {

                    @Override
                    public Object getDataValue(List<String> rowObject,
                            int columnIndex) {
View Full Code Here

    public Control createExampleControl(Composite parent) {
        DummyBodyDataProvider bodyDataProvider = new DummyBodyDataProvider(500,
                1000000);
        SelectionLayer selectionLayer = new SelectionLayer(
                new ColumnHideShowLayer(new ColumnReorderLayer(new DataLayer(
                        bodyDataProvider))));
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        DummyColumnHeaderDataProvider columnHeaderDataProvider = new DummyColumnHeaderDataProvider(
                bodyDataProvider);
        DataLayer columnHeaderDataLayer = new DataLayer(
                columnHeaderDataProvider);
        ILayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer,
                viewportLayer, selectionLayer);

        DefaultRowHeaderDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
                bodyDataProvider);
        DataLayer rowHeaderDataLayer = new DataLayer(rowHeaderDataProvider);
        rowHeaderDataLayer.setDefaultColumnWidth(40);
        ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
                viewportLayer, selectionLayer);

        ILayer cornerLayer = new CornerLayer(new DataLayer(
                new DefaultCornerDataProvider(columnHeaderDataProvider,
                        rowHeaderDataProvider)), rowHeaderLayer,
                columnHeaderLayer);

        GridLayer compositeLayer = new GridLayer(viewportLayer,
View Full Code Here

        return tableContainer;
    }

    private void createNatTable(Composite parent, final ICellPainter painter) {
        IDataProvider bodyDataProvider = new ExampleTextBodyDataProvider();
        DataLayer dataLayer = new DataLayer(bodyDataProvider);
        dataLayer.setRowHeightByPosition(0, 32);
        SelectionLayer selectionLayer = new SelectionLayer(dataLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        ILayer columnHeaderLayer = new ColumnHeaderLayer(new DataLayer(
                new DummyColumnHeaderDataProvider(bodyDataProvider)),
                viewportLayer, selectionLayer);

        CompositeLayer compositeLayer = new CompositeLayer(1, 2);
        compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER,
View Full Code Here

        GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);
    }

    private void createNatTable2(Composite parent, final ICellPainter painter) {
        IDataProvider bodyDataProvider = new ExampleTextBodyDataProvider();
        DataLayer dataLayer = new DataLayer(bodyDataProvider);
        dataLayer.setRowHeightByPosition(0, 32);
        SelectionLayer selectionLayer = new SelectionLayer(dataLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
                new DataLayer(new ExampleHeaderDataProvider()), viewportLayer,
                selectionLayer, false);
        columnHeaderLayer
                .addConfiguration(new DefaultColumnHeaderLayerConfiguration() {
                    @Override
                    protected void addColumnHeaderStyleConfig() {
View Full Code Here

    }

    private void createVerticalHeaderNatTable(Composite parent,
            final ICellPainter painter) {
        IDataProvider bodyDataProvider = new ExampleHeaderDataProvider();
        SelectionLayer selectionLayer = new SelectionLayer(new DataLayer(
                bodyDataProvider));
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
                new DataLayer(new ExampleHeaderDataProvider()), viewportLayer,
                selectionLayer, false);
        columnHeaderLayer
                .addConfiguration(new DefaultColumnHeaderLayerConfiguration() {
                    @Override
                    protected void addColumnHeaderStyleConfig() {
View Full Code Here

    }

    @SuppressWarnings("unused")
    private void createNatTable3(Composite parent, final ICellPainter painter) {
        IDataProvider bodyDataProvider = new ExampleHeaderDataProvider();
        DataLayer dataLayer = new DataLayer(bodyDataProvider);

        SelectionLayer selectionLayer = new SelectionLayer(dataLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        ILayer columnHeaderLayer = new ColumnHeaderLayer(new DataLayer(
                new DummyColumnHeaderDataProvider(bodyDataProvider)),
                viewportLayer, selectionLayer);

        CompositeLayer compositeLayer = new CompositeLayer(1, 2);
        compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER,
View Full Code Here

    @SuppressWarnings("unused")
    private void createVerticalNatTable(Composite parent,
            final ICellPainter painter) {
        IDataProvider bodyDataProvider = new ExampleHeaderDataProvider();
        SelectionLayer selectionLayer = new SelectionLayer(new DataLayer(
                bodyDataProvider, 20, 100));
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
                new DataLayer(new DummyColumnHeaderDataProvider(
                        bodyDataProvider), 20, 100), viewportLayer,
                selectionLayer);
        columnHeaderLayer
                .addConfiguration(new DefaultColumnHeaderLayerConfiguration() {
                    @Override
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.layer.DataLayer

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.