Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: e43ff5a3c040ab30acfb78e0a09cb35a791235db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*****************************************************************************
 * Copyright (c) 2014 CEA LIST.
 *
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
 *
 *****************************************************************************/
package org.eclipse.papyrus.infra.nattable.dataprovider;

import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;

/**
 * The Class CompositeColumnHeaderDataProvider.
 *
 * @author Vincent Lorenzo
 */
public class CompositeColumnHeaderDataProvider extends AbstractCompositeDataProvider {

	/**
	 *
	 * Constructor.
	 *
	 * @param manager
	 *            the nattable model manager
	 */
	public CompositeColumnHeaderDataProvider(INattableModelManager manager) {
		super(manager);
	}


	/**
	 * Gets the row count.
	 *
	 * @return the row count
	 * @see org.eclipse.papyrus.infra.nattable.dataprovider.AbstractCompositeDataProvider#getColumnCount()
	 */
	@Override
	public int getRowCount() {
		int i = 0;
		for (IDataProvider current : providers) {
			i += current.getRowCount();
		}
		return i;
	}

	/**
	 * Gets the column count.
	 *
	 * @return the column count
	 * @see org.eclipse.papyrus.infra.nattable.dataprovider.AbstractCompositeDataProvider#getRowCount()
	 */
	@Override
	public int getColumnCount() {
		return this.manager.getColumnElementsList().size();
	}
}

Back to the top