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

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


        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);

        layer = new GridLayer(viewportLayer, columnHeaderLayer, rowHeaderLayer,
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);

        ConfigRegistry configRegistry = new ConfigRegistry();
        SortHeaderLayer<Person> sortHeaderLayer = new SortHeaderLayer<Person>(
                columnHeaderLayer, new GlazedListsSortModel<Person>(sortedList,
                        accessor, configRegistry, columnHeaderDataLayer));

        ColumnGroupHeaderLayer columnGroupHeaderLayer = new ColumnGroupHeaderLayer(
                sortHeaderLayer, selectionLayer, columnGroupModel);

        // configure the column groups
        columnGroupHeaderLayer.addColumnsIndexesToGroup("Name", 0, 1);
        columnGroupHeaderLayer.addColumnsIndexesToGroup("Details", 2, 3, 4);
        columnGroupHeaderLayer.setGroupUnbreakable(1);

        // build the row header layer
        IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
                bodyDataProvider);
        DataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
                rowHeaderDataProvider);
        ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
                viewportLayer, selectionLayer);

        // build the corner layer
        IDataProvider cornerDataProvider = new DefaultCornerDataProvider(
                columnHeaderDataProvider, rowHeaderDataProvider);
        DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
        ILayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer,
                columnGroupHeaderLayer);

        // build the grid layer
        GridLayer gridLayer = new GridLayer(viewportLayer,
                columnGroupHeaderLayer, rowHeaderLayer, cornerLayer);
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);
        DataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
                rowHeaderDataProvider);
        ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
                viewportLayer, selectionLayer);

        // build the corner layer
        IDataProvider cornerDataProvider = new DefaultCornerDataProvider(
                columnHeaderDataProvider, rowHeaderDataProvider);
        DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
        ILayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer,
                columnHeaderLayer);

        // build the grid layer
        GridLayer gridLayer = new GridLayer(viewportLayer, columnHeaderLayer,
                rowHeaderLayer, cornerLayer);
View Full Code Here

            SelectionLayer selectionLayer = bodyLayer.getSelectionLayer();

            // Column header
            IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                    propertyNames, propertyToLabelMap);
            ILayer columnHeaderLayer = new ColumnHeaderLayer(
                    new DefaultColumnHeaderDataLayer(columnHeaderDataProvider),
                    bodyLayer, selectionLayer);

            // Row header
            IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
                    bodyLayer.getDataLayer().getDataProvider());
            ILayer rowHeaderLayer = new RowHeaderLayer(
                    new DefaultRowHeaderDataLayer(rowHeaderDataProvider),
                    bodyLayer, selectionLayer);

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

            setBodyLayer(bodyLayer);
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);
        DataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
                rowHeaderDataProvider);
        ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
                viewportLayer, selectionLayer);

        // build the corner layer
        IDataProvider cornerDataProvider = new DefaultCornerDataProvider(
                columnHeaderDataProvider, rowHeaderDataProvider);
        DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
        ILayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer,
                columnHeaderLayer);

        // build the grid layer
        GridLayer gridLayer = new GridLayer(viewportLayer, columnHeaderLayer,
                rowHeaderLayer, cornerLayer);
View Full Code Here

                PersonService.getPersonsWithAddress(10), columnPropertyAccessor);
        final DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
        final SelectionLayer selectionLayer = new SelectionLayer(bodyDataLayer);
        ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

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

        // set the region labels to make default configurations work, e.g.
        // selection
View Full Code Here

public class LayerCommandUtil {

    public static PositionCoordinate convertPositionToTargetContext(
            PositionCoordinate positionCoordinate, ILayer targetLayer) {
        ILayer layer = positionCoordinate.getLayer();

        if (layer == targetLayer) {
            return positionCoordinate;
        }

        int columnPosition = positionCoordinate.getColumnPosition();
        int underlyingColumnPosition = layer
                .localToUnderlyingColumnPosition(columnPosition);
        if (underlyingColumnPosition < 0) {
            return null;
        }

        int rowPosition = positionCoordinate.getRowPosition();
        int underlyingRowPosition = layer
                .localToUnderlyingRowPosition(rowPosition);
        if (underlyingRowPosition < 0) {
            return null;
        }

        ILayer underlyingLayer = layer.getUnderlyingLayerByPosition(
                columnPosition, rowPosition);
        if (underlyingLayer == null) {
            return null;
        }
View Full Code Here

    public static ColumnPositionCoordinate convertColumnPositionToTargetContext(
            ColumnPositionCoordinate columnPositionCoordinate,
            ILayer targetLayer) {
        if (columnPositionCoordinate != null) {
            ILayer layer = columnPositionCoordinate.getLayer();

            if (layer == targetLayer) {
                return columnPositionCoordinate;
            }

            int columnPosition = columnPositionCoordinate.getColumnPosition();
            int underlyingColumnPosition = layer
                    .localToUnderlyingColumnPosition(columnPosition);
            if (underlyingColumnPosition < 0) {
                return null;
            }

            Collection<ILayer> underlyingLayers = layer
                    .getUnderlyingLayersByColumnPosition(columnPosition);
            if (underlyingLayers != null) {
                for (ILayer underlyingLayer : underlyingLayers) {
                    if (underlyingLayer != null) {
                        ColumnPositionCoordinate convertedColumnPositionCoordinate = convertColumnPositionToTargetContext(
View Full Code Here

    }

    public static RowPositionCoordinate convertRowPositionToTargetContext(
            RowPositionCoordinate rowPositionCoordinate, ILayer targetLayer) {
        if (rowPositionCoordinate != null) {
            ILayer layer = rowPositionCoordinate.getLayer();

            if (layer == targetLayer) {
                return rowPositionCoordinate;
            }

            int rowPosition = rowPositionCoordinate.getRowPosition();
            int underlyingRowPosition = layer
                    .localToUnderlyingRowPosition(rowPosition);
            if (underlyingRowPosition < 0) {
                return null;
            }

            Collection<ILayer> underlyingLayers = layer
                    .getUnderlyingLayersByRowPosition(rowPosition);
            if (underlyingLayers != null) {
                for (ILayer underlyingLayer : underlyingLayers) {
                    if (underlyingLayer != null) {
                        RowPositionCoordinate convertedRowPositionCoordinate = convertRowPositionToTargetContext(
View Full Code Here

    /**
     * Initially populate the index order to the local cache.
     */
    private void populateIndexOrder() {
        ILayer underlyingLayer = getUnderlyingLayer();
        for (int rowPosition = 0; rowPosition < underlyingLayer.getRowCount(); rowPosition++) {
            this.rowIndexOrder.add(underlyingLayer
                    .getRowIndexByPosition(rowPosition));
        }
    }
View Full Code Here

TOP

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

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.