Examples of LabelStack


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

    }

    @Override
    public LabelStack getConfigLabelsByPosition(int columnPosition,
            int rowPosition) {
        LabelStack configLabels = super.getConfigLabelsByPosition(
                columnPosition, rowPosition);
        if (this.treeData.getDataAtIndex(getRowIndexByPosition(rowPosition)) instanceof GroupByObject) {
            configLabels.addLabelOnTop(GROUP_BY_OBJECT);
            configLabels.addLabelOnTop(GROUP_BY_COLUMN_PREFIX + columnPosition);
            if (getGroupBySummaryProvider(configLabels) != null) {
                configLabels.addLabelOnTop(GROUP_BY_SUMMARY);
                configLabels.addLabelOnTop(GROUP_BY_SUMMARY_COLUMN_PREFIX
                        + columnPosition);
            }
        }
        return configLabels;
    }
View Full Code Here

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

    }

    @Override
    public Object getDataValueByPosition(final int columnPosition,
            final int rowPosition) {
        LabelStack labelStack = getConfigLabelsByPosition(columnPosition,
                rowPosition);
        if (labelStack.hasLabel(GROUP_BY_OBJECT)) {
            GroupByObject groupByObject = (GroupByObject) this.treeData
                    .getDataAtIndex(rowPosition);

            // ensure to only load the children if they are needed
            List<T> children = null;

            final IGroupBySummaryProvider<T> summaryProvider = getGroupBySummaryProvider(labelStack);
            if (summaryProvider != null) {
                children = getElementsInGroup(groupByObject);
                final List<T> c = children;
                return this.valueCache.getCalculatedValue(columnPosition,
                        rowPosition, new GroupByValueCacheKey(columnPosition,
                                rowPosition, groupByObject), true,
                        new ICalculator() {
                            @Override
                            public Object executeCalculation() {
                                return summaryProvider.summarize(
                                        columnPosition, c);
                            }
                        });
            }

            if (this.configRegistry != null) {
                String childCountPattern = this.configRegistry
                        .getConfigAttribute(
                                GroupByConfigAttributes.GROUP_BY_CHILD_COUNT_PATTERN,
                                DisplayMode.NORMAL, labelStack.getLabels());

                if (childCountPattern != null && childCountPattern.length() > 0) {
                    if (children == null) {
                        children = getElementsInGroup(groupByObject);
                    }
View Full Code Here

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

            // iterate over the whole tree structure and pre-calculate the
            // summary values
            for (int i = 0; i < getRowCount(); i++) {
                if (this.treeData.getDataAtIndex(i) instanceof GroupByObject) {
                    for (int j = 0; j < getColumnCount(); j++) {
                        LabelStack labelStack = getConfigLabelsByPosition(j, i);
                        final IGroupBySummaryProvider<T> summaryProvider = getGroupBySummaryProvider(labelStack);
                        if (summaryProvider != null) {
                            GroupByObject groupByObject = (GroupByObject) this.treeData
                                    .getDataAtIndex(i);
                            final List<T> children = getElementsInGroup(groupByObject);
View Full Code Here

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

    @Override
    public void mouseMove(NatTable natTable, MouseEvent event) {}

    @Override
    public void mouseUp(NatTable natTable, MouseEvent event) {
        LabelStack regionLabels = natTable
                .getRegionLabelsByXY(event.x, event.y);
        if (regionLabels != null
                && regionLabels.hasLabel(GroupByHeaderLayer.GROUP_BY_REGION)
                && this.selectedColumnIndex != -1) {
            natTable.doCommand(new GroupByColumnIndexCommand(
                    this.selectedColumnIndex));
            this.selectedColumnIndex = -1;
        }
View Full Code Here

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

public class GroupByColumnReorderDragMode extends ColumnReorderDragMode {

    @Override
    protected boolean isValidTargetColumnPosition(ILayer natLayer, int dragFromGridColumnPosition, int dragToGridColumnPosition) {
        // Suppress reorder if cursor is over the group by region
        LabelStack regionLabels = natLayer.getRegionLabelsByXY(this.currentEvent.x, this.currentEvent.y);
        if (regionLabels != null && !regionLabels.hasLabel(GroupByHeaderLayer.GROUP_BY_REGION)) {
            return super.isValidTargetColumnPosition(natLayer, dragFromGridColumnPosition, dragToGridColumnPosition);
        }
        return false;
    }
View Full Code Here

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

    }

    @Override
    public LabelStack getConfigLabelsByPosition(int columnPosition,
            int rowPosition) {
        LabelStack labelStack = super.getConfigLabelsByPosition(columnPosition,
                rowPosition);

        final int selectionLayerColumnPosition = LayerUtil
                .convertColumnPosition(this, columnPosition, selectionLayer);
        if (selectionLayer
                .isColumnPositionFullySelected(selectionLayerColumnPosition)) {
            labelStack
                    .addLabel(SelectionStyleLabels.COLUMN_FULLY_SELECTED_STYLE);
        }

        return labelStack;
    }
View Full Code Here

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

     *         <code>false</code> if at least one cell is not editable.
     */
    public static boolean allCellsEditable(Collection<ILayerCell> selectedCells, IConfigRegistry configRegistry) {
        if (selectedCells != null) {
            for (ILayerCell layerCell : selectedCells) {
                LabelStack labelStack = layerCell.getConfigLabels();
                IEditableRule editableRule = configRegistry.getConfigAttribute(
                        EditConfigAttributes.CELL_EDITABLE_RULE,
                        DisplayMode.EDIT,
                        labelStack.getLabels());

                if (editableRule == null
                        || !editableRule.isEditable(layerCell, configRegistry)) {
                    return false;
                }
View Full Code Here

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

    @Override
    public void paintLayer(ILayer natLayer, GC gc, int xOffset, int yOffset,
            Rectangle rectangle, IConfigRegistry configRegistry) {
        Boolean renderConfig = null;
        LabelStack stack = natLayer.getRegionLabelsByXY(xOffset, yOffset);
        if (stack != null) {
            // check if there is a configuration telling to not rendering grid
            // lines
            renderConfig = configRegistry.getConfigAttribute(
                    CellConfigAttributes.RENDER_GRID_LINES, DisplayMode.NORMAL,
                    stack.getLabels());
        }

        this.renderGridLines = (renderConfig != null) ? renderConfig : true;

        // Draw GridLines
View Full Code Here

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

     *         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());
        if (editableRule == null) {
            return false;
        }

        return editableRule.isEditable(layerCell, configRegistry);
View Full Code Here

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

     */
    public static boolean isEditorSame(Collection<ILayerCell> selectedCells, IConfigRegistry configRegistry) {
        if (selectedCells != null) {
            ICellEditor lastSelectedCellEditor = null;
            for (ILayerCell selectedCell : selectedCells) {
                LabelStack labelStack = selectedCell.getConfigLabels();
                ICellEditor cellEditor = configRegistry.getConfigAttribute(
                        EditConfigAttributes.CELL_EDITOR,
                        DisplayMode.EDIT,
                        labelStack.getLabels());

                // The first time we get here we need to remember the editor so
                // further checks can use it.
                // Getting the editor before by getLastSelectedCellEditor()
                // might cause issues in case there is no active selection
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.