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

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


                + "the default example layer. In this case the backing layer is a basic data layer that simply displays dummy data and does "
                + "nothing else.";
    }

    public Control createExampleControl(Composite parent) {
        ILayer layer = new DataLayer(new DummyBodyDataProvider(20, 20));
        return new NatTable(parent, layer);
    }
View Full Code Here


        final DefaultRowHeaderDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
                bodyDataProvider);
        DefaultRowHeaderDataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(
                rowHeaderDataProvider);
        ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
                bodyLayer, bodyLayer.getSelectionLayer());

        // Corner

        final DefaultCornerDataProvider cornerDataProvider = new DefaultCornerDataProvider(
                defaultColumnHeaderDataProvider, rowHeaderDataProvider);
        DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
        ILayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer,
                columnGroupHeaderLayer);

        // Grid
        GridLayer gridLayer = new GridLayer(bodyLayer, columnGroupHeaderLayer,
                rowHeaderLayer, cornerLayer);
View Full Code Here

        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

            Object initialCanonicalValue, final IConfigRegistry configRegistry) {

        try {
            // determine the position of the cell to put into edit mode
            Rectangle cellBounds = cell.getBounds();
            ILayer layer = cell.getLayer();

            int columnPosition = cell.getColumnPosition();
            int rowPosition = cell.getRowPosition();

            // read the configuration for the specified cell for
            // - which editor to use for that cell
            final List<String> configLabels = cell.getConfigLabels()
                    .getLabels();

            // check which editor to use
            final ICellEditor cellEditor = configRegistry.getConfigAttribute(
                    EditConfigAttributes.CELL_EDITOR, DisplayMode.EDIT,
                    configLabels);

            if (cellEditor.openInline(configRegistry, configLabels)) {
                // edit inline
                ICellEditHandler editHandler = new InlineEditHandler(layer,
                        columnPosition, rowPosition);

                Rectangle editorBounds = layer.getLayerPainter()
                        .adjustCellBounds(
                                columnPosition,
                                rowPosition,
                                new Rectangle(cellBounds.x, cellBounds.y,
                                        cellBounds.width, cellBounds.height));

                cellEditor.activateCell(parent, initialCanonicalValue,
                        EditModeEnum.INLINE, editHandler, cell, configRegistry);

                final Control editorControl = cellEditor.getEditorControl();

                editorBounds = cellEditor.calculateControlBounds(editorBounds);

                if (editorControl != null && !editorControl.isDisposed()) {
                    editorControl.setBounds(editorBounds);
                    // We need to add the control listeners after setting the
                    // bounds to it
                    // because of the strange behaviour on Mac OS where a
                    // control loses focus
                    // if its bounds are set
                    cellEditor.addEditorControlListeners();
                    layer.fireLayerEvent(new CellEditorCreatedEvent(cellEditor));
                }
            } else {
                List<ILayerCell> cells = new ArrayList<ILayerCell>();
                cells.add(cell);
                editCells(cells, parent, initialCanonicalValue, configRegistry);
View Full Code Here

    private void cacheVisibleColumnIndexes() {
        cachedVisibleColumnIndexOrder = new ArrayList<Integer>();
        cachedHiddenColumnIndexToPositionMap = new HashMap<Integer, Integer>();
        startXCache.clear();

        ILayer underlyingLayer = getUnderlyingLayer();
        int columnPosition = 0;
        for (int parentColumnPosition = 0; parentColumnPosition < underlyingLayer
                .getColumnCount(); parentColumnPosition++) {
            int columnIndex = underlyingLayer
                    .getColumnIndexByPosition(parentColumnPosition);

            if (!isColumnIndexHidden(columnIndex)) {
                cachedVisibleColumnIndexOrder.add(Integer.valueOf(columnIndex));
                columnPosition++;
View Full Code Here

                            if (!(dialog.getEditType() == EditTypeEnum.SET)) {
                                editorValue = dialog.calculateValue(
                                        selectedCell.getDataValue(),
                                        editorValue);
                            }
                            ILayer layer = selectedCell.getLayer();

                            layer.doCommand(new UpdateDataCommand(layer,
                                    selectedCell.getColumnPosition(),
                                    selectedCell.getRowPosition(), editorValue));
                        }
                    }
                } else {
View Full Code Here

        cachedVisibleRowIndexOrder = new HashMap<Integer, Integer>();
        cachedVisibleRowPositionOrder = new HashMap<Integer, Integer>();
        cachedHiddenRowIndexToPositionMap = new HashMap<Integer, Integer>();
        startYCache.clear();

        ILayer underlyingLayer = getUnderlyingLayer();
        int rowPosition = 0;
        for (int parentRowPosition = 0; parentRowPosition < underlyingLayer
                .getRowCount(); parentRowPosition++) {
            int rowIndex = underlyingLayer
                    .getRowIndexByPosition(parentRowPosition);

            if (!isRowIndexHidden(rowIndex)) {
                cachedVisibleRowIndexOrder.put(Integer.valueOf(rowIndex),
                        rowPosition);
View Full Code Here

                numColumns, numRows);
    }

    protected void paintCell(ILayerCell cell, GC gc,
            IConfigRegistry configRegistry) {
        ILayer layer = cell.getLayer();
        int columnPosition = cell.getColumnPosition();
        int rowPosition = cell.getRowPosition();
        ICellPainter cellPainter = layer.getCellPainter(columnPosition,
                rowPosition, cell, configRegistry);
        Rectangle adjustedCellBounds = layer
                .getLayerPainter()
                .adjustCellBounds(columnPosition, rowPosition, cell.getBounds());
        if (cellPainter != null) {
            Rectangle originalClipping = gc.getClipping();
View Full Code Here

        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

        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

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.