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

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


        for (Integer fromColumnPosition : fromColumnPositions) {
            int fromColumnIndex = underlyingLayer
                    .getColumnIndexByPosition(fromColumnPosition.intValue());

            ColumnGroupModel model = columnGroupReorderLayer.getModel();
            if (model.isPartOfAGroup(fromColumnIndex)) {
                String groupName = model.getColumnGroupByIndex(fromColumnIndex)
                        .getName();
                if (!groupsProcessed.contains(groupName)) {
                    groupsProcessed.add(groupName);
                    fromColumnPositionsWithGroupColumns
                            .addAll(columnGroupReorderLayer
View Full Code Here


        int toColumnIndex = underlyingLayer
                .getColumnIndexByPosition(toColumnPosition);

        List<Integer> fromColumnPositions = command.getFromColumnPositions();

        ColumnGroupModel model = columnGroupReorderLayer.getModel();

        if (updateModel(underlyingLayer, toColumnIndex, fromColumnPositions,
                model)) {
            return underlyingLayer.doCommand(command);
        } else {
View Full Code Here

    @Override
    protected boolean doCommand(ColumnGroupExpandCollapseCommand command) {

        int columnIndex = columnGroupExpandCollapseLayer
                .getColumnIndexByPosition(command.getColumnPosition());
        ColumnGroupModel model = columnGroupExpandCollapseLayer
                .getModel(command.getRowPosition());
        ColumnGroup columnGroup = model.getColumnGroupByIndex(columnIndex);

        // if group of columnIndex is not collapseable return without any
        // further operation ...
        if (columnGroup == null || !columnGroup.isCollapseable()) {
            return true;
View Full Code Here

        final String[] propertyNames = RowDataListFixture.getPropertyNames();
        final Map<String, String> propertyToLabelMap = RowDataListFixture
                .getPropertyToLabelMap();

        ConfigRegistry configRegistry = new ConfigRegistry();
        ColumnGroupModel columnGroupModel = new ColumnGroupModel();

        // Body

        LinkedList<BlinkingRowDataFixture> rowData = new LinkedList<BlinkingRowDataFixture>();
        this.baseEventList = GlazedLists.threadSafeList(GlazedLists
View Full Code Here

        propertyToLabelMap.put("lastName", "Lastname");
        propertyToLabelMap.put("gender", "Gender");
        propertyToLabelMap.put("married", "Married");
        propertyToLabelMap.put("birthday", "Birthday");

        ColumnGroupModel columnGroupModel = new ColumnGroupModel();

        // build the body layer stack
        // Usually you would create a new layer stack by extending
        // AbstractIndexLayerTransform and
        // setting the ViewportLayer as underlying layer. But in this case using
View Full Code Here

        glazedListsEventLayer = new GlazedListsEventLayer<T>(bodyDataLayer,
                eventList);
        glazedListsEventLayer.setTestMode(true);

        ColumnGroupModel columnGroupModel = new ColumnGroupModel();
        columnReorderLayer = new ColumnReorderLayer(glazedListsEventLayer);
        columnGroupReorderLayer = new ColumnGroupReorderLayer(
                columnReorderLayer, columnGroupModel);
        columnHideShowLayer = new ColumnHideShowLayer(columnGroupReorderLayer);
        columnGroupExpandCollapseLayer = new ColumnGroupExpandCollapseLayer(
View Full Code Here

        propertyToLabelMap.put("favouriteDrinks", "Drinks");

        IColumnPropertyAccessor<ExtendedPersonWithAddress> columnPropertyAccessor = new ExtendedReflectiveColumnPropertyAccessor<ExtendedPersonWithAddress>(
                propertyNames);

        ColumnGroupModel columnGroupModel = new ColumnGroupModel();

        // build the body layer stack
        // Usually you would create a new layer stack by extending
        // AbstractIndexLayerTransform and
        // setting the ViewportLayer as underlying layer. But in this case using
View Full Code Here

        propertyToLabelMap.put("favouriteDrinks", "Drinks");

        IColumnPropertyAccessor<ExtendedPersonWithAddress> columnPropertyAccessor = new ExtendedReflectiveColumnPropertyAccessor<ExtendedPersonWithAddress>(
                propertyNames);

        ColumnGroupModel columnGroupModel = new ColumnGroupModel();
        ColumnGroupModel sndColumnGroupModel = new ColumnGroupModel();

        // build the body layer stack
        // Usually you would create a new layer stack by extending
        // AbstractIndexLayerTransform and
        // setting the ViewportLayer as underlying layer. But in this case using
View Full Code Here

    private ColumnGroupExpandCollapseLayer expandCollapseLayer;
    private ColumnHideShowLayerFixture underlyingLayer;

    @Before
    public void setup() {
        model = new ColumnGroupModel();

        // 10 Columns in total - column 10 hidden
        underlyingLayer = new ColumnHideShowLayerFixture(9);
        expandCollapseLayer = new ColumnGroupExpandCollapseLayer(
                underlyingLayer, model);
View Full Code Here

import org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel;

public class ColumnGroupModelAssembler {

    public static ColumnGroupModel setupColumnGroups(TableColumn[] columnProps) {
        ColumnGroupModel columnGroupModel;
        columnGroupModel = new ColumnGroupModel();
        Map<String, Set<Integer>> columnGroupToColumnIndexesMap = new HashMap<String, Set<Integer>>();

        for (int columnIndex = 0; columnIndex < columnProps.length; columnIndex++) {
            String columnGroupName = columnProps[columnIndex].groupName;

            // Column if part of a group
            if (columnGroupName != null) {
                Set<Integer> columnGroupIndexes = columnGroupToColumnIndexesMap
                        .get(columnGroupName);
                // Create an entry in the map for the group
                if (columnGroupIndexes == null) {
                    columnGroupIndexes = new HashSet<Integer>();
                    columnGroupToColumnIndexesMap.put(columnGroupName,
                            columnGroupIndexes);
                }
                // Add to map
                columnGroupIndexes.add(columnIndex);
            }
        }

        // Transfer the map created to the model
        for (String columnGroupName : columnGroupToColumnIndexesMap.keySet()) {
            Set<Integer> columnIndexes = columnGroupToColumnIndexesMap
                    .get(columnGroupName);
            int[] intColumnIndexes = new int[columnIndexes.size()];
            int i = 0;
            for (Integer columnIndex : columnIndexes) {
                intColumnIndexes[i] = columnIndex;
                i++;
            }
            columnGroupModel.addColumnsIndexesToGroup(columnGroupName,
                    intColumnIndexes);
        }

        return columnGroupModel;
    }
View Full Code Here

TOP

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

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.