Examples of ILayerCell


Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

    }

    @Override
    public void handleLayerEvent(InlineCellEditEvent event) {
        if (event.convertToLocal(layer)) {
            ILayerCell cell = layer.getCellByPosition(
                    event.getColumnPosition(), event.getRowPosition());
            EditController.editCell(cell, event.getParent(),
                    event.getInitialValue(), event.getConfigRegistry());
        }
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

    public int getCheckedCellsCount(int columnPosition,
            IConfigRegistry configRegistry) {
        int checkedCellsCount = 0;

        for (int rowPosition = 0; rowPosition < columnDataLayer.getRowCount(); rowPosition++) {
            ILayerCell columnCell = columnDataLayer.getCellByPosition(
                    columnPosition, rowPosition);
            if (isChecked(columnCell, configRegistry)) {
                checkedCellsCount++;
            }
        }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

     * @return The {@link ICellEditor} of the last cell of the current selection
     *         in the specified {@link SelectionLayer}. Will return
     *         <code>null</code> if there is no selection.
     */
    public static ICellEditor getLastSelectedCellEditor(SelectionLayer selectionLayer, IConfigRegistry configRegistry) {
        ILayerCell lastSelectedCell = EditUtils.getLastSelectedCell(selectionLayer);
        if (lastSelectedCell != null) {
            final List<String> lastSelectedCellLabelsArray = lastSelectedCell.getConfigLabels().getLabels();
            return configRegistry.getConfigAttribute(
                    EditConfigAttributes.CELL_EDITOR,
                    DisplayMode.EDIT,
                    lastSelectedCellLabelsArray);
        }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

     *            <code>false</code> if not
     * @return <code>true</code> if the current selected cell contains an editor
     *         that should be activated, <code>false</code> if not
     */
    public static boolean activateLastSelectedCellEditor(SelectionLayer selectionLayer, IConfigRegistry configRegistry, boolean byTraversal) {
        ILayerCell lastSelectedCell = EditUtils.getLastSelectedCell(selectionLayer);
        if (lastSelectedCell != null) {
            final List<String> lastSelectedCellLabelsArray = lastSelectedCell.getConfigLabels().getLabels();
            ICellEditor editor = configRegistry.getConfigAttribute(
                    EditConfigAttributes.CELL_EDITOR,
                    DisplayMode.EDIT,
                    lastSelectedCellLabelsArray);
            if (editor != null) {
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

     * @return <code>true</code> if the cell is editable, <code>false</code> if
     *         not
     */
    public static boolean isCellEditable(ILayer layer,
            IConfigRegistry configRegistry, PositionCoordinate cellCoords) {
        ILayerCell layerCell = layer.getCellByPosition(cellCoords.columnPosition, cellCoords.rowPosition);
        LabelStack labelStack = layerCell.getConfigLabels();

        IEditableRule editableRule = configRegistry.getConfigAttribute(
                EditConfigAttributes.CELL_EDITABLE_RULE,
                DisplayMode.EDIT,
                labelStack.getLabels());
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

            if (selectionLayer.getSelectionModel().getSelectedRowCount() == 1) {
                selectedCells.add(getLastSelectedCell(selectionLayer));
            }
            else {
                ILayerCell anchor = getLastSelectedCell(selectionLayer);
                for (ILayerCell cell : selectionLayer.getSelectedCells()) {
                    if (cell.getColumnPosition() == anchor.getColumnPosition()) {
                        selectedCells.add(cell);
                    }
                }
            }
        }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

                // don't know the correct bounds of the cell to edit inline
                // corresponding to the NatTable.
                // On firing the event, a translation process is triggered,
                // converting the information to the correct values
                // needed for inline editing
                ILayerCell cell = selectedCells.iterator().next();
                this.selectionLayer.fireLayerEvent(
                        new InlineCellEditEvent(
                                this.selectionLayer,
                                new PositionCoordinate(this.selectionLayer, cell.getColumnPosition(), cell.getRowPosition()),
                                parent,
                                configRegistry,
                                (initialValue != null ? initialValue : cell.getDataValue())));
            } else if (selectedCells.size() > 1) {
                // determine the initial value
                Object initialEditValue = initialValue;
                if (initialValue == null
                        && EditUtils.isValueSame(this.selectionLayer)) {
                    ILayerCell cell = selectedCells.iterator().next();
                    initialEditValue = this.selectionLayer.getDataValueByPosition(
                            cell.getColumnPosition(),
                            cell.getRowPosition());
                }

                EditController.editCells(selectedCells, parent, initialEditValue, configRegistry);
            }
        }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

        return EditCellCommand.class;
    }

    @Override
    public boolean doCommand(EditCellCommand command) {
        ILayerCell cell = command.getCell();
        Composite parent = command.getParent();
        IConfigRegistry configRegistry = command.getConfigRegistry();

        // check if the cell is editable
        IEditableRule rule = configRegistry.getConfigAttribute(
                EditConfigAttributes.CELL_EDITABLE_RULE, DisplayMode.EDIT, cell
                        .getConfigLabels().getLabels());

        if (rule.isEditable(cell, configRegistry)) {
            EditController.editCell(cell, parent, cell.getDataValue(),
                    configRegistry);
        }

        // as commands by default are intended to be consumed by the handler,
        // always
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

    }

    @Override
    public boolean matches(NatTable natTable, MouseEvent event,
            LabelStack regionLabels) {
        ILayerCell cell = natTable.getCellByPosition(
                natTable.getColumnPositionByX(event.x),
                natTable.getRowPositionByY(event.y));

        if (cell != null) {
            boolean displayModeMatches = this.displayMode.equals(cell
                    .getDisplayMode());
            if (this.aggregate != null) {
                return displayModeMatches
                        && this.aggregate
                                .matches(natTable, event, regionLabels);
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell

        return getHorizontalCellEdge(layer, clickPt, -1);
    }

    public static CellEdgeEnum getHorizontalCellEdge(ILayer layer,
            Point clickPt, int handleWidth) {
        ILayerCell cell = layer.getCellByPosition(
                layer.getColumnPositionByX(clickPt.x),
                layer.getRowPositionByY(clickPt.y));
        if (cell != null) {
            return getHorizontalCellEdge(cell.getBounds(), clickPt, handleWidth);
        } else {
            return CellEdgeEnum.NONE;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.