Skip to main content
summaryrefslogtreecommitdiffstats
blob: f933142ba46a0928d3d73c113d9044c5bffc1acf (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/*****************************************************************************
 * Copyright (c) 2012 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.manager.table;

import java.util.Collection;
import java.util.List;

import org.eclipse.emf.common.command.Command;
import org.eclipse.nebula.widgets.nattable.NatTable;
import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
import org.eclipse.nebula.widgets.nattable.ui.NatEventData;
import org.eclipse.papyrus.infra.nattable.layerstack.BodyLayerStack;
import org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager;
import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisprovider.AbstractAxisProvider;
import org.eclipse.papyrus.infra.nattable.utils.LocationValue;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.services.IDisposable;


public interface INattableModelManager extends ILimitedNattableModelManager, ITableAxisElementProvider, IDisposable, IDataProvider {


	public int getColumnCount();

	public int getRowCount();

	public void addRows(final Collection<Object> objectsToAdd);

	public void addColumns(final Collection<Object> objectsToAdd);

	public boolean canInsertRow(final Collection<Object> objectsToAdd, int index);

	public boolean canInsertColumns(final Collection<Object> objectsToAdd, int index);

	public boolean canDropColumnsElement(final Collection<Object> objectsToAdd);

	public boolean canDropRowElement(final Collection<Object> objectsToAdd);

	public void insertRows(final Collection<Object> objectsToAdd, int index);

	public void insertColumns(final Collection<Object> objectsToAdd, int index);

	public IDataProvider getBodyDataProvider();

	public IAxisManager getColumnDataProvider();

	public IAxisManager getLineDataProvider();

	public boolean canMoveColumns();

	public boolean canMoveRows();

	public void moveColumnElement(final Object axisToMove, final int newIndex);

	public void moveRowElement(final Object axisToMove, final int newIndex);

	public void invertAxis();

	public boolean canInvertAxis();

	public boolean declareEditorsOnColumns();

	public boolean declareEditorsOnRows();

	public Table getTable();

	public ITableAxisElementProvider getTableAxisElementProvider();

	public NatTable createNattable(final Composite parent, int style, IWorkbenchPartSite site);

	public LocationValue getLocationInTheTable(final Point location);

	public List<Object> getElementsList(final AbstractAxisProvider axisProvider);

	public boolean canCreateRowElement(String elementType);

	public boolean canCreateColumnElement(String elementType);

	public Command getAddRowElementCommand(Collection<Object> objectsToAdd);

	public Command getAddColumnElementCommand(Collection<Object> objectsToAdd);



	public void print();

	public void selectAll();

	public void exportToXLS();

	/**
	 * Opens a dialog to choose the columns to display or to destroy. This action doesn't create or destroy model element. It can only create/destroy
	 * axis
	 */
	public void openCreateDestroyColumnsManagerDialog();

	/**
	 * Opens a dialog to choose the columns to display or to destroy. This action doesn't create or destroy model element. It can only create/destroy
	 * axis
	 */
	public void openCreateDestroyRowsManagerDialog();

	/**
	 * Returns <code>true</code> if columns axis can be destroyed (only are will be destroyed, the model element won't be destroyed)
	 * 
	 * @return
	 */
	public boolean canCreateDestroyColumnsAxis();

	/**
	 * Returns <code>true</code> if columns axis can be destroyed (only are will be destroyed, the model element won't be destroyed)
	 * 
	 * @return
	 */
	public boolean canCreateDestroyRowsAxis();

	public void sortColumnsByName(final boolean alphabeticOrder);

	public void sortRowsByName(final boolean alphabeticOrder);


	/**
	 * 
	 * @return
	 *         the "real"{@link AbstractAxisProvider}, that's to say that this method use the property {@link Table#isInvertAxis()} to return the real
	 *         vertical axis
	 */
	public AbstractAxisProvider getVerticalAxisProvider();

	/**
	 * 
	 * @return
	 *         the "real"{@link AbstractAxisProvider}, that's to say that this method use the property {@link Table#isInvertAxis()} to return the real
	 *         horizontal axis
	 */
	public AbstractAxisProvider getHorizontalAxisProvider();

	public BodyLayerStack getBodyLayerStack();

	/**
	 * Opens a dialog to edit the alias of the row
	 * 
	 * @param event
	 */
	public void openEditRowAliasDialog(final NatEventData event);

	/**
	 * Opens a dialog to edit the alias of the column
	 * 
	 * @param event
	 */
	public void openEditColumnAliasDialog(final NatEventData event);

	public boolean canEditColumnHeader(final NatEventData eventData);

	public boolean canEditRowHeader(final NatEventData eventData);
}

Back to the top