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

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


                propertyNames, propertyToLabelMap);
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
                columnHeaderDataProvider);
        HoverLayer columnHoverLayer = new HoverLayer(columnHeaderDataLayer,
                false);
        ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
                columnHoverLayer, viewportLayer, selectionLayer, false);

        // add ColumnHeaderHoverLayerConfiguration to ensure that hover styling
        // and resizing is working together
        columnHeaderLayer
                .addConfiguration(new ColumnHeaderHoverLayerConfiguration(
                        columnHoverLayer));

        // build the row header layer
        IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
View Full Code Here


        // build the column header layer
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        final DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
                columnHeaderDataProvider);
        final AbstractLayer columnHeaderLayer = new ColumnHeaderLayer(
                columnHeaderDataLayer, bodyLayer, bodyLayer.getSelectionLayer());

        // Use this special layer painter that supports rendering of split
        // viewports although
        // the ColumnHeaderLayer is not split. Here is some custom calculation
        // included that
        // might not work correctly in case there are column groups or other
        // spanning involved.
        columnHeaderLayer.setLayerPainter(new CellLayerPainter() {
            @Override
            protected boolean isClipLeft(int position) {
                // check position-1 because of the row header column count
                // as the body is a composite layer, the default transformation
                // for the grid is not working correctly
View Full Code Here

                IColumnPropertyAccessor<T> columnPropertyAccessor,
                IConfigRegistry configRegistry) {

            DefaultColumnHeaderDataLayer dataLayer = new DefaultColumnHeaderDataLayer(
                    dataProvider);
            ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
                    dataLayer, bodyLayerStack,
                    bodyLayerStack.getSelectionLayer());

            SortHeaderLayer<T> sortHeaderLayer = new SortHeaderLayer<T>(
                    columnHeaderLayer, new GlazedListsSortModel<T>(
View Full Code Here

        // build the column header layer
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
                columnHeaderDataProvider);
        ILayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer,
                bodyLayerStack, bodyLayerStack.getSelectionLayer());

        // add sorting
        SortHeaderLayer<ExtendedPersonWithAddress> sortHeaderLayer = new SortHeaderLayer<ExtendedPersonWithAddress>(
                columnHeaderLayer,
View Full Code Here

        // build the column header layer
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
                columnHeaderDataProvider);
        ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
                columnHeaderDataLayer, viewportLayer, selectionLayer, false);

        // add ColumnHeaderHoverLayerConfiguration to ensure that hover styling
        // and resizing is working together
        columnHeaderLayer
                .addConfiguration(new ColumnHeaderHoverLayerConfiguration(null));

        // build the row header layer
        IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
                bodyDataProvider);
View Full Code Here

        // build the column header layer
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
                columnHeaderDataProvider);
        ILayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer,
                bodyLayerStack, bodyLayerStack.getSelectionLayer());

        // Note: The column header layer is wrapped in a filter row composite.
        // This plugs in the filter row functionality
        FilterRowHeaderComposite<PersonWithAddress> filterRowHeaderLayer = new FilterRowHeaderComposite<PersonWithAddress>(
View Full Code Here

        // build the column header layer
        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                propertyNames, propertyToLabelMap);
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
                columnHeaderDataProvider);
        ILayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer,
                viewportLayer, selectionLayer);

        // build the row header layer
        IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
                bodyDataProvider);
View Full Code Here

        // 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);
        ILayer secondColumnHeaderLayer = new ColumnHeaderLayer(
                secondColumnHeaderDataLayer, secondViewportLayer,
                secondSelectionLayer);

        // register custom label styling to indicate if the table is active
        secondColumnHeaderDataLayer
View Full Code Here

                propertyNames, propertyToLabelMap);
        DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(
                columnHeaderDataProvider);
        HoverLayer columnHoverLayer = new HoverLayer(columnHeaderDataLayer,
                false);
        ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
                columnHoverLayer, viewportLayer, selectionLayer, false);

        // add ColumnHeaderHoverLayerConfiguration to ensure that hover styling
        // and resizing is working together
        columnHeaderLayer
                .addConfiguration(new ColumnHeaderHoverLayerConfiguration(
                        columnHoverLayer));

        // build the row header layer
        IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
View Full Code Here

            setBodyLayer(this.selectionLayer);

            // create and set the column header layer stack
            IDataProvider columnHeaderDataProvider = new DummyColumnHeaderDataProvider(bodyDataProvider);
            DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(columnHeaderDataProvider);
            ILayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer, this.selectionLayer, this.selectionLayer);
            setColumnHeaderLayer(columnHeaderLayer);

            // create and set the row header layer stack
            IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(bodyDataProvider);
            DataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(rowHeaderDataProvider);
View Full Code Here

TOP

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

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.