Package org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel

Examples of org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel.ColumnGroup


        ColumnGroup columnGroup = model.getColumnGroupByIndex(columnIndex);
        columnGroup.setUnbreakable(true);
    }

    public void setGroupAsCollapsed(int columnIndex) {
        ColumnGroup columnGroup = model.getColumnGroupByIndex(columnIndex);
        columnGroup.setCollapsed(true);
    }
View Full Code Here


        if (isHiddeninUnderlyingLayer)
            return true;

        for (ColumnGroupModel model : models) {
            ColumnGroup columnGroup = model.getColumnGroupByIndex(columnIndex);
            boolean isCollapsedAndStaticColumn = columnGroup != null
                    && columnGroup.isCollapsed()
                    && !ColumnGroupUtils.isStaticOrFirstVisibleColumn(
                            columnIndex, underlyingLayer, underlyingLayer,
                            model);

            if (isCollapsedAndStaticColumn)
View Full Code Here

        int underlyingColumnCount = underlyingLayer.getColumnCount();
        for (int i = 0; i < underlyingColumnCount; i++) {
            int columnIndex = underlyingLayer.getColumnIndexByPosition(i);

            for (ColumnGroupModel model : models) {
                ColumnGroup columnGroup = model
                        .getColumnGroupByIndex(columnIndex);

                if (columnGroup != null && columnGroup.isCollapsed()) {
                    if (!ColumnGroupUtils.isStaticOrFirstVisibleColumn(
                            columnIndex, underlyingLayer, underlyingLayer,
                            model)) {
                        hiddenColumnIndexes.add(Integer.valueOf(columnIndex));
                    }
View Full Code Here

     * @param columnPosition
     *            position of any column belonging to the group
     */
    protected int getColumnSpan(int columnPosition) {
        int columnIndex = getColumnIndexByPosition(columnPosition);
        ColumnGroup columnGroup = model.getColumnGroupByIndex(columnIndex);

        int sizeOfGroup = columnGroup.getSize();

        if (columnGroup.isCollapsed()) {
            int sizeOfStaticColumns = columnGroup.getStaticColumnIndexes()
                    .size();
            if (sizeOfStaticColumns == 0) {
                return 1;
            } else {
                sizeOfGroup = sizeOfStaticColumns;
            }
        }

        int startPositionOfGroup = getStartPositionOfGroup(columnPosition);
        int endPositionOfGroup = startPositionOfGroup + sizeOfGroup;
        List<Integer> columnIndexesInGroup = columnGroup.getMembers();

        for (int i = startPositionOfGroup; i < endPositionOfGroup; i++) {
            int index = getColumnIndexByPosition(i);
            if (!columnIndexesInGroup.contains(Integer.valueOf(index))) {
                sizeOfGroup--;
View Full Code Here

     *            of any column belonging to the group
     * @return first position of the column group
     */
    private int getStartPositionOfGroup(int columnPosition) {
        int bodyColumnIndex = getColumnIndexByPosition(columnPosition);
        ColumnGroup columnGroup = model.getColumnGroupByIndex(bodyColumnIndex);

        int leastPossibleStartPositionOfGroup = columnPosition
                - columnGroup.getSize();
        int i = 0;
        for (i = leastPossibleStartPositionOfGroup; i < columnPosition; i++) {
            if (ColumnGroupUtils.isInTheSameGroup(getColumnIndexByPosition(i),
                    bodyColumnIndex, model)) {
                break;
View Full Code Here

        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);
                }
            }
View Full Code Here

    }

    @Override
    public Object getDataValueByPosition(int columnPosition, int rowPosition) {
        int columnIndex = getColumnIndexByPosition(columnPosition);
        ColumnGroup columnGroup = model.getColumnGroupByIndex(columnIndex);

        if (rowPosition == 0) {
            if (model.isPartOfAGroup(columnIndex)) {
                return columnGroup.getName();
            }
        } else {
            rowPosition--;
        }
View Full Code Here

    /**
     * @see ColumnGroup#setUnbreakable(boolean)
     */
    public void setGroupUnbreakable(int columnIndex) {
        ColumnGroup columnGroup = model.getColumnGroupByIndex(columnIndex);
        columnGroup.setUnbreakable(true);
    }
View Full Code Here

        ColumnGroup columnGroup = model.getColumnGroupByIndex(columnIndex);
        columnGroup.setUnbreakable(true);
    }

    public void setGroupAsCollapsed(int columnIndex) {
        ColumnGroup columnGroup = model.getColumnGroupByIndex(columnIndex);
        columnGroup.setCollapsed(true);
    }
View Full Code Here

            int columnEntryIndex = columnEntry.getIndex().intValue();

            // Create a node for the column group - if needed
            if (columnGroupModel != null
                    && columnGroupModel.isPartOfAGroup(columnEntryIndex)) {
                ColumnGroup columnGroup = columnGroupModel
                        .getColumnGroupByIndex(columnEntryIndex);
                String columnGroupName = columnGroup.getName();
                TreeItem columnGroupTreeItem = getTreeItem(tree,
                        columnGroupName);

                if (columnGroupTreeItem == null) {
                    columnGroupTreeItem = new TreeItem(tree, SWT.NONE);
                    ColumnGroupEntry columnGroupEntry = new ColumnGroupEntry(
                            columnGroupName, columnEntry.getPosition(),
                            columnEntry.getIndex(), columnGroup.isCollapsed());
                    columnGroupTreeItem.setData(columnGroupEntry);
                    columnGroupTreeItem.setText(columnGroupEntry.getLabel());
                }
                treeItem = new TreeItem(columnGroupTreeItem, SWT.NONE);
            } else {
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel.ColumnGroup

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.