Package org.eclipse.nebula.widgets.nattable.selection

Examples of org.eclipse.nebula.widgets.nattable.selection.SelectionLayer


            ColumnReorderLayer columnReorderLayer = new ColumnReorderLayer(
                    glazedListsEventLayer);
            ColumnHideShowLayer columnHideShowLayer = new ColumnHideShowLayer(
                    columnReorderLayer);
            this.selectionLayer = new SelectionLayer(columnHideShowLayer);

            // add a tree layer to visualise the grouping
            TreeLayer treeLayer = new TreeLayer(selectionLayer,
                    bodyDataLayer.getTreeRowModel());
View Full Code Here


            // layer for event handling of GlazedLists and PropertyChanges
            GlazedListsEventLayer<T> glazedListsEventLayer = new GlazedListsEventLayer<T>(
                    bodyDataLayer, filterList);

            this.selectionLayer = new SelectionLayer(glazedListsEventLayer);
            ViewportLayer viewportLayer = new ViewportLayer(getSelectionLayer());

            setUnderlyingLayer(viewportLayer);
        }
View Full Code Here

        // create the body layer stack
        final IRowDataProvider<Person> firstBodyDataProvider = new ListDataProvider<Person>(
                getSimpsonsList(), columnPropertyAccessor);
        final DataLayer firstBodyDataLayer = new DataLayer(
                firstBodyDataProvider);
        final SelectionLayer firstSelectionLayer = new SelectionLayer(
                firstBodyDataLayer);
        ViewportLayer firstViewportLayer = new ViewportLayer(
                firstSelectionLayer);

        // use a RowSelectionModel that will perform row selections and is able
        // to identify a row via unique ID
        firstSelectionLayer.setSelectionModel(new RowSelectionModel<Person>(
                firstSelectionLayer, firstBodyDataProvider, rowIdAccessor));

        // create the column header layer stack
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DataLayer firstColumnHeaderDataLayer = new DataLayer(
                columnHeaderDataProvider);
        ColumnHeaderLayer firstColumnHeaderLayer = new ColumnHeaderLayer(
                firstColumnHeaderDataLayer, firstViewportLayer,
                firstSelectionLayer);

        // register custom label styling to indicate if the table is active
        firstColumnHeaderDataLayer
                .setConfigLabelAccumulator(new IConfigLabelAccumulator() {
                    @Override
                    public void accumulateConfigLabels(LabelStack configLabels,
                            int columnPosition, int rowPosition) {
                        if (isFirstSelectionProvider) {
                            configLabels.addLabelOnTop(ACTIVE_LABEL);
                        }
                    }
                });

        // set the region labels to make default configurations work, e.g.
        // selection
        CompositeLayer firstCompositeLayer = new CompositeLayer(1, 2);
        firstCompositeLayer.setChildLayer(GridRegion.COLUMN_HEADER,
                firstColumnHeaderLayer, 0, 0);
        firstCompositeLayer.setChildLayer(GridRegion.BODY, firstViewportLayer,
                0, 1);

        final NatTable firstNatTable = new NatTable(panel, firstCompositeLayer,
                false);

        firstNatTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        firstNatTable.addConfiguration(new ActiveTableStyleConfiguration());
        firstNatTable.configure();

        // set the modern theme
        firstNatTable.setTheme(new ModernNatTableThemeConfiguration());

        // add overlay painter for full borders
        firstNatTable.addOverlayPainter(new NatTableBorderOverlayPainter());

        // create the second table
        // create the body layer stack
        final IRowDataProvider<Person> secondBodyDataProvider = new ListDataProvider<Person>(
                getFlandersList(), columnPropertyAccessor);
        final DataLayer secondBodyDataLayer = new DataLayer(
                secondBodyDataProvider);
        final SelectionLayer secondSelectionLayer = new SelectionLayer(
                secondBodyDataLayer);
        ViewportLayer secondViewportLayer = new ViewportLayer(
                secondSelectionLayer);

        // use a RowSelectionModel that will perform row selections and is able
        // to identify a row via unique ID
        secondSelectionLayer.setSelectionModel(new RowSelectionModel<Person>(
                secondSelectionLayer, secondBodyDataProvider, rowIdAccessor));

        // create the column header layer stack
        DataLayer secondColumnHeaderDataLayer = new DataLayer(
                columnHeaderDataProvider);
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);
        HoverLayer bodyHoverLayer = new HoverLayer(bodyDataLayer);
        SelectionLayer selectionLayer = new SelectionLayer(bodyHoverLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

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

            // create and set the body layer stack
            this.bodyDataLayer = new DataLayer(bodyDataProvider);
            ColumnReorderLayer columnReorderLayer = new ColumnReorderLayer(this.bodyDataLayer);
            ColumnHideShowLayer columnHideShowLayer = new ColumnHideShowLayer(columnReorderLayer);
            this.selectionLayer = new SelectionLayer(columnHideShowLayer);
            setBodyLayer(this.selectionLayer);

            // create and set the column header layer stack
            IDataProvider columnHeaderDataProvider = new DummyColumnHeaderDataProvider(bodyDataProvider);
            DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(columnHeaderDataProvider);
View Full Code Here

        IRowDataProvider<Person> bodyDataProvider = new ListDataProvider<Person>(
                data, columnPropertyAccessor);
        final DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        ColumnReorderLayer reorderLayer = new ColumnReorderLayer(bodyDataLayer);
        final SelectionLayer selectionLayer = new SelectionLayer(reorderLayer);

        // set row selection model with single selection enabled
        selectionLayer.setSelectionModel(new RowSelectionModel<Person>(
                selectionLayer, bodyDataProvider, new IRowIdAccessor<Person>() {

                    @Override
                    public Serializable getRowId(Person rowObject) {
                        return rowObject.getId();
View Full Code Here

        // create the body layer stack
        IRowDataProvider<Person> bodyDataProvider = new ListDataProvider<Person>(
                data, columnPropertyAccessor);
        final DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        final SelectionLayer selectionLayer = new SelectionLayer(bodyDataLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        // use a RowSelectionModel that will perform row selections and is able
        // to identify a row via unique ID
        selectionLayer.setSelectionModel(new RowSelectionModel<Person>(
                selectionLayer, bodyDataProvider, new IRowIdAccessor<Person>() {

                    @Override
                    public Serializable getRowId(Person rowObject) {
                        return rowObject.getId();
                    }

                }));

        // register different selection move command handler that always moves
        // by row
        selectionLayer
                .addConfiguration(new RowOnlySelectionConfiguration<Person>());

        // register selection bindings that will perform row selections instead
        // of cell selections
        // registering the bindings on a layer that is above the SelectionLayer
View Full Code Here

            this.columnHideShowLayer = new ColumnHideShowLayer(
                    columnGroupReorderLayer);
            ColumnGroupExpandCollapseLayer columnGroupExpandCollapseLayer = new ColumnGroupExpandCollapseLayer(
                    columnHideShowLayer, columnGroupModel);

            this.selectionLayer = new SelectionLayer(
                    columnGroupExpandCollapseLayer);

            // add a tree layer to visualise the grouping
            TreeLayer treeLayer = new TreeLayer(selectionLayer,
                    bodyDataLayer.getTreeRowModel());
View Full Code Here

        IDataProvider bodyDataProvider = new DefaultBodyDataProvider<Person>(
                contents, propertyNames);
        final DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        final RowReorderLayer rowReorderLayer = new RowReorderLayer(
                bodyDataLayer);
        final SelectionLayer selectionLayer = new SelectionLayer(
                rowReorderLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

        // build the column header layer
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
View Full Code Here

    private ColumnOverrideLabelAccumulator columnLabelAccumulator;

    @Before
    public void setup() {
        DataLayerFixture bodyDataLayer = new DataLayerFixture();
        selectionLayer = new SelectionLayer(bodyDataLayer);
        selectionLayer.setSelectedCell(1, 1);

        testConfigRegistry = new ConfigRegistry();
        testConfigRegistry.registerConfigAttribute(
                TickUpdateConfigAttributes.UPDATE_HANDLER,
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.selection.SelectionLayer

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.