Skip to main content
summaryrefslogtreecommitdiffstats
blob: 488ff04b68a37482356185720b1254ae2e9f67d9 (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
172
/*****************************************************************************
 * 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.axis;

import java.util.Collection;

import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
import org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AxisManagerRepresentation;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisprovider.AbstractAxisProvider;
import org.eclipse.papyrus.infra.widgets.providers.IRestrictedContentProvider;
import org.eclipse.ui.services.IDisposable;

/**
 * The common interface used by the axis manager
 * 
 * @author Vincent Lorenzo
 * 
 */
public interface IAxisManager extends IDisposable {

	/**
	 * 
	 * @return <code>true</code> if the manager can be used horizontally
	 */
	public boolean canBeUsedAsRowManager();

	/**
	 * 
	 * @return <code>true</code> if the manager can be used vertically
	 */
	public boolean canBeUsedAsColumnManager();

	/**
	 * 
	 * @param domain
	 *        the editing domain
	 * @param objectToAdd
	 *        the object to add
	 * @return the command to add an axis to the emf model
	 */
	public Command getAddAxisCommand(final EditingDomain domain, final Collection<Object> objectToAdd);

	/**
	 * 
	 * @param domain
	 *        the editing domain
	 * @param objectToAdd
	 *        the object to add
	 * @return the complementary command, which is called by the master on the
	 *         slave to add required axis
	 */
	public Command getComplementaryAddAxisCommand(final EditingDomain domain, final Collection<Object> objectToAdd);

	/**
	 * 
	 * @param manager
	 *        the table model manager
	 * @param managerRep
	 *        its axis manager representation
	 * @param provider
	 *        //FIXME : realy usefule?
	 *        the managed axis provider
	 */
	public void init(final INattableModelManager manager, AxisManagerRepresentation managerRep, final AbstractAxisProvider provider);

	public void setHeaderDataValue(int columnIndex, int rowIndex, Object newValue);

	/**
	 * 
	 * @return
	 *         the managed axis provider
	 */
	public AbstractAxisProvider getRepresentedContentProvider();

	/**
	 * 
	 * 
	 * @return
	 *         the table manager using this axis manager
	 */
	public NattableModelManager getTableManager(); //FIXME : we must use an interface with a small set of accessible method... 



	/**
	 * 
	 * @return
	 *         <code>true</code> if the contents provided by the axis manager is derived of the contents provided by the others axis manager
	 */
	public boolean isSlave();

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

	public boolean canDropAxisElement(Collection<Object> objectsToAdd);

	public Command getInsertAxisCommand(Collection<Object> objectsToAdd, int index);

	/**
	 * 
	 * @param object
	 *        an object
	 * @return
	 *         <code>true</code> if the object can be managed by the AxisManager
	 */
	public boolean isAllowedContents(final Object object);

	/**
	 * 
	 * @return <code>true</code> if we can move elements on the axis
	 */
	public boolean canMoveAxis();

	/**
	 * 
	 * @param isRestricted
	 * @return
	 */
	public IRestrictedContentProvider createDestroyColumnsContentProvider(boolean isRestricted);


	/**
	 * 
	 * @param domain
	 * @param objectToDestroy
	 * @return
	 */
	public Command getDestroyAxisCommand(EditingDomain domain, Collection<Object> objectToDestroy);

	/**
	 * 
	 * @return
	 *         the list of the existing axis managed by the axis manager
	 */
	public Collection<Object> getAllManagedAxis();

	/**
	 * 
	 * @return
	 *         <code>true</code> if the contents provided by this axis manager is derived of the (UML) model
	 */
	public boolean isDynamic();

	/**
	 * 
	 * @param newIndex
	 * @param axisToMove
	 */
	public void moveAxis(final Object elementToMove, final int newIndex);

	/**
	 * 
	 * @param elementId
	 *        the id of the element to create
	 * @return
	 *         <code>true</code> if the element can be created
	 */
	public boolean canCreateAxisElement(final String elementId);
}

Back to the top