Examples of LabelStack


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

        return super.getDataValueByPosition(columnPosition, rowPosition);
    }

    @Override
    public LabelStack getConfigLabelsByPosition(int columnPosition, int rowPosition) {
        LabelStack labelStack = super.getConfigLabelsByPosition(columnPosition, rowPosition);
        // add a label to the row header summary row cell aswell, so
        // it can be styled differently too in this case it will simply use
        // the same styling as the summary row in the body
        if (rowPosition == 0)
            labelStack.addLabelOnTop(SummaryRowLayer.DEFAULT_SUMMARY_ROW_CONFIG_LABEL);
        return labelStack;
    }
View Full Code Here

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

     *         render the sort arrows
     */
    @Override
    public LabelStack getConfigLabelsByPosition(int columnPosition,
            int rowPosition) {
        LabelStack configLabels = super.getConfigLabelsByPosition(
                columnPosition, rowPosition);

        if (sortModel != null) {
            int columnIndex = getColumnIndexByPosition(columnPosition);
            if (sortModel.isColumnIndexSorted(columnIndex)) {

                String sortConfig = DefaultSortConfiguration.SORT_SEQ_CONFIG_TYPE
                        + sortModel.getSortOrder(columnIndex);
                configLabels.addLabelOnTop(sortConfig);

                SortDirectionEnum sortDirection = sortModel
                        .getSortDirection(columnIndex);

                switch (sortDirection) {
                    case ASC:
                        configLabels
                                .addLabelOnTop(DefaultSortConfiguration.SORT_UP_CONFIG_TYPE);
                        break;
                    case DESC:
                        configLabels
                                .addLabelOnTop(DefaultSortConfiguration.SORT_DOWN_CONFIG_TYPE);
                        break;
                }
            }
        }
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);

        ILayerCell cell = getCellByPosition(columnPosition, rowPosition);
        if (cell != null) {
            Rectangle cellRectangle = new Rectangle(
                    cell.getOriginColumnPosition(),
                    cell.getOriginRowPosition(), cell.getColumnSpan(),
                    cell.getRowSpan());

            if (cellRectangle.contains(getSelectionAnchor().columnPosition,
                    getSelectionAnchor().rowPosition)) {
                labelStack
                        .addLabel(SelectionStyleLabels.SELECTION_ANCHOR_STYLE);
            }
        }

        return labelStack;
View Full Code Here

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

    @Override
    public LabelStack getConfigLabelsByPosition(int columnPosition,
            int rowPosition) {
        // At the data layer level position == index
        final LabelStack labels = super.getConfigLabelsByPosition(
                columnPosition, rowPosition);
        // the label needs to be index based as the position changes on
        // scrolling
        labels.addLabel(FILTER_ROW_COLUMN_LABEL_PREFIX
                + getColumnIndexByPosition(columnPosition));
        labels.addLabel(GridRegion.FILTER_ROW);
        return labels;
    }
View Full Code Here

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

    @Override
    public boolean doCommand(DisplayColumnStyleEditorCommand command) {
        int columnIndexOfClick = command.getNattableLayer()
                .getColumnIndexByPosition(command.columnPosition);

        LabelStack configLabels = new LabelStack();
        columnLabelAccumulator.accumulateConfigLabels(configLabels,
                columnIndexOfClick, 0);
        configLabels.addLabel(getConfigLabel(columnIndexOfClick));

        // Column style
        Style clickedCellStyle = (Style) configRegistry.getConfigAttribute(
                CELL_STYLE, NORMAL, configLabels.getLabels());

        dialog = new ColumnStyleEditorDialog(Display.getCurrent()
                .getActiveShell(), clickedCellStyle);
        dialog.open();
View Full Code Here

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

    @Override
    protected boolean shouldCreateToolTip(Event event) {
        // check the region?
        boolean regionCheckPassed = false;
        if (this.tooltipRegions.length > 0) {
            LabelStack regionLabels = natTable.getRegionLabelsByXY(event.x,
                    event.y);
            if (regionLabels != null) {
                for (String label : this.tooltipRegions) {
                    if (regionLabels.hasLabel(label)) {
                        regionCheckPassed = true;
                        break;
                    }
                }
            }
View Full Code Here

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

public class FilterRowMouseEventMatcher implements IMouseEventMatcher {

    public boolean matches(NatTable natTable, MouseEvent event,
            LabelStack regionLabels) {
        NatEventData eventData = NatEventData.createInstanceFromEvent(event);
        LabelStack labels = eventData.getRegionLabels();

        if (isNotNull(labels)) {
            return labels.getLabels().contains(GridRegion.FILTER_ROW);
        }
        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 selectionLayerRowPosition = LayerUtil.convertRowPosition(
                this, rowPosition, selectionLayer);
        if (selectionLayer
                .isRowPositionFullySelected(selectionLayerRowPosition)) {
            labelStack.addLabel(SelectionStyleLabels.ROW_FULLY_SELECTED_STYLE);
        }

        return labelStack;
    }
View Full Code Here

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

    @Override
    public LabelStack getConfigLabelsByPosition(int columnPosition,
            int rowPosition) {
        int columnIndex = getColumnIndexByPosition(columnPosition);
        if (rowPosition == 0 && model.isPartOfAGroup(columnIndex)) {
            LabelStack stack = new LabelStack(GridRegion.COLUMN_GROUP_HEADER);

            if (model.isPartOfACollapseableGroup(columnIndex)) {
                ColumnGroup group = model.getColumnGroupByIndex(columnIndex);
                if (group.isCollapsed()) {
                    stack.addLabelOnTop(DefaultColumnGroupHeaderLayerConfiguration.GROUP_COLLAPSED_CONFIG_TYPE);
                } else {
                    stack.addLabelOnTop(DefaultColumnGroupHeaderLayerConfiguration.GROUP_EXPANDED_CONFIG_TYPE);
                }
            }

            return stack;
        } else {
View Full Code Here

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

    @Override
    public LabelStack getRegionLabelsByXY(int x, int y) {
        int columnIndex = getColumnIndexByPosition(getColumnPositionByX(x));
        if (model.isPartOfAGroup(columnIndex) && y < getRowHeightByPosition(0)) {
            return new LabelStack(GridRegion.COLUMN_GROUP_HEADER);
        } else {
            return columnGroupHeaderLayer.getRegionLabelsByXY(x, y
                    - getRowHeightByPosition(0));
        }
    }
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.