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

Examples of org.eclipse.nebula.widgets.nattable.grid.layer.DefaultGridLayer


    public static final String COMBO_BOX_CONFIG_LABEL = "comboBox";
    public static final String COMBO_BOX_EDITOR_CONFIG_LABEL = "comboBoxEditor";

    @Override
    public Control createExampleControl(Composite parent) {
        DefaultGridLayer gridLayer = new DefaultGridLayer(
                RowDataListFixture.getList(),
                RowDataListFixture.getPropertyNames(),
                RowDataListFixture.getPropertyToLabelMap());

        DataLayer columnHeaderDataLayer = (DataLayer) gridLayer
                .getColumnHeaderDataLayer();
        columnHeaderDataLayer
        .setConfigLabelAccumulator(new ColumnLabelAccumulator());

        final DataLayer bodyDataLayer = (DataLayer) gridLayer
                .getBodyDataLayer();
        IDataProvider dataProvider = bodyDataLayer.getDataProvider();

        // NOTE: Register the accumulator on the body data layer.
        // This ensures that the labels are bound to the column index and are
View Full Code Here


        IColumnPropertyAccessor<Person> columnPropertyAccessor = new ReflectiveColumnPropertyAccessor<Person>(
                propertyNames);
        IRowDataProvider<Person> bodyDataProvider = new ListDataProvider<Person>(
                myList, columnPropertyAccessor);

        DefaultGridLayer gridLayer = new DefaultGridLayer(bodyDataProvider,
                new DefaultColumnHeaderDataProvider(propertyNames));

        NatTable natTable = new NatTable(parent, gridLayer);

        ISelectionProvider selectionProvider = new RowSelectionProvider<Person>(
                gridLayer.getBodyLayer().getSelectionLayer(), bodyDataProvider,
                false); // Provides rows where any cell in the row is selected

        selectionProvider
                .addSelectionChangedListener(new ISelectionChangedListener() {
View Full Code Here

    @Test
    public void performanceOfListDataProvider() throws Exception {
        List<RowDataFixture> largeList = RowDataListFixture.getList(26000);
        Assert.assertTrue(largeList.size() > 25000);

        layer = new DefaultGridLayer(largeList,
                RowDataListFixture.getPropertyNames(),
                RowDataListFixture.getPropertyToLabelMap());
    }
View Full Code Here

                        propertyNames));

        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);

        layer = new DefaultGridLayer(glazedListsDataProvider,
                columnHeaderDataProvider);
    }
View Full Code Here

        IDataProvider bodyDataProvider = new ListDataProvider<ExtendedPersonWithAddress>(
                PersonService.getExtendedPersonsWithAddress(10),
                new ExtendedReflectiveColumnPropertyAccessor<ExtendedPersonWithAddress>(
                        propertyNames));

        DefaultGridLayer gridLayer = new DefaultGridLayer(bodyDataProvider,
                new DefaultColumnHeaderDataProvider(propertyNames,
                        propertyToLabelMap));

        final DataLayer bodyDataLayer = (DataLayer) gridLayer
                .getBodyDataLayer();

        final ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(
                bodyDataLayer);
        bodyDataLayer.setConfigLabelAccumulator(columnLabelAccumulator);
View Full Code Here

        propertyToLabelMap.put("toDate", "To");

        valuesToShow.addAll(createEventData());

        ConfigRegistry configRegistry = new ConfigRegistry();
        DefaultGridLayer gridLayer = new DefaultGridLayer(valuesToShow,
                propertyNames, propertyToLabelMap);
        DataLayer bodyDataLayer = (DataLayer) gridLayer.getBodyDataLayer();

        IRowDataProvider<EventData> bodyDataProvider = (IRowDataProvider<EventData>) bodyDataLayer
                .getDataProvider();
        bodyDataLayer
                .setConfigLabelAccumulator(new CrossValidationLabelAccumulator(
View Full Code Here

        propertyToLabelMap.put("columnTwoNumber", "Column 2");
        propertyToLabelMap.put("columnThreeNumber", "Column 3");
        propertyToLabelMap.put("columnFourNumber", "Column 4");
        propertyToLabelMap.put("columnFiveNumber", "Column 5");

        DefaultGridLayer gridLayer = new DefaultGridLayer(
                createNumberValuesList(), propertyNames, propertyToLabelMap);
        DataLayer bodyDataLayer = (DataLayer) gridLayer.getBodyDataLayer();

        final ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(
                bodyDataLayer);
        bodyDataLayer.setConfigLabelAccumulator(columnLabelAccumulator);
        registerColumnLabels(columnLabelAccumulator);
View Full Code Here

        IDataProvider bodyDataProvider = new ListDataProvider<ExtendedPersonWithAddress>(
                PersonService.getExtendedPersonsWithAddress(10),
                new ExtendedReflectiveColumnPropertyAccessor<ExtendedPersonWithAddress>(
                        propertyNames));

        DefaultGridLayer gridLayer = new DefaultGridLayer(bodyDataProvider,
                new DefaultColumnHeaderDataProvider(propertyNames,
                        propertyToLabelMap));

        final DataLayer bodyDataLayer = (DataLayer) gridLayer
                .getBodyDataLayer();

        final ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(
                bodyDataLayer);
        bodyDataLayer.setConfigLabelAccumulator(columnLabelAccumulator);
View Full Code Here

        IRowDataProvider<Person> bodyDataProvider = new ListDataProvider<Person>(
                PersonService.getPersons(10),
                new ExtendedReflectiveColumnPropertyAccessor<Person>(propertyNames));

        DefaultGridLayer gridLayer = new DefaultGridLayer(
                bodyDataProvider, new DefaultColumnHeaderDataProvider(propertyNames, propertyToLabelMap));

        final DataLayer bodyDataLayer = (DataLayer) gridLayer.getBodyDataLayer();

        final ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(bodyDataLayer);
        bodyDataLayer.setConfigLabelAccumulator(columnLabelAccumulator);
        registerColumnLabels(columnLabelAccumulator);
View Full Code Here

        assertNull(ActiveCellEditorRegistry.getActiveCellEditor());
    }

    @Test
    public void clickingOnTheCheckBoxMustToggleItsValue() throws Exception {
        DefaultGridLayer layerStack = new DefaultGridLayer(
                RowDataListFixture.getList(),
                RowDataListFixture.getPropertyNames(),
                RowDataListFixture.getPropertyToLabelMap());
        natTable = new NatTableFixture(layerStack, 1200, 300, false);

        // Enable editing
        natTable.enableEditingOnAllCells();

        // Calculate pixel value to click on
        int columnIndex = RowDataListFixture
                .getColumnIndexOfProperty(RowDataListFixture.PUBLISH_FLAG_PROP_NAME);
        int columnPosition = columnIndex + ROW_HEADER_COLUMN_COUNT;
        int startX = natTable.getStartXOfColumnPosition(columnPosition);
        int columnWidth = natTable.getColumnWidthByPosition(columnPosition);
        int startY = natTable.getStartYOfRowPosition(1);
        int rowHeight = natTable.getRowHeightByPosition(1);

        // Register check box for the publish flag column
        DataLayer bodyDataLayer = (DataLayer) layerStack.getBodyDataLayer();
        natTable.registerLabelOnColumn(bodyDataLayer, columnIndex, TEST_LABEL);
        registerCheckBoxEditor(natTable.getConfigRegistry(),
                new CheckBoxPainter(), new CheckBoxCellEditor());

        natTable.configure();
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.grid.layer.DefaultGridLayer

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.