Skip to main content
summaryrefslogtreecommitdiffstats
blob: e1a69ad495d728835298126ed6124dbddb4c0685 (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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
/*******************************************************************************
 * Copyright (c) 2002, 2008 IBM Corporation and others.
 * 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
 *
 * Initial Contributors:
 * The following IBM employees contributed to the Remote System Explorer
 * component that contains this file: David McKnight, Kushal Munir,
 * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
 * 
 * Contributors:
 * David Dykstal (IBM) - [226561] Add API markup to RSE Javadocs where extend / implement is allowed
 *******************************************************************************/

package org.eclipse.rse.core.filters;

import org.eclipse.rse.core.references.IRSEBasePersistableReferenceManager;
import org.eclipse.rse.core.subsystems.ISubSystem;

/**
 * This class manages a persistable list of objects each of which reference
 * a filter pool. This class builds on the parent class SystemPersistableReferenceManager,
 * offering convenience versions of the parent methods that are typed to the
 * classes in the filters framework.
 * @noimplement This interface is not intended to be implemented by clients.
 * The allowable implementations are already present in the framework.
 */
public interface ISystemFilterPoolReferenceManager extends IRSEBasePersistableReferenceManager {
	/**
	 * Get the object which instantiated this instance of the filter pool reference manager.
	 * This is also available from any filter reference framework object.
	 */
	public ISystemFilterPoolReferenceManagerProvider getProvider();

	/**
	 * Set the object which instantiated this instance of the filter pool reference manager.
	 * This makes it available to retrieve from any filter reference framework object,
	 * via the ubiquitous getProvider interface method.
	 */
	public void setProvider(ISystemFilterPoolReferenceManagerProvider caller);

	/**
	 * Turn off callbacks to the provider until turned on again.
	 */
	public void setProviderEventNotification(boolean fireEvents);

	// ------------------------------------------------------------
	// Methods for setting and querying related filterpool manager
	// ------------------------------------------------------------
	/*
	 * Set the managers of the master list of filter pools, from which
	 *  objects in this list reference.
	 * NOW DELETED SO THAT WE DYNAMICALLY QUERY THIS LIST FROM THE
	 * ASSOCIATED SYSTEMFILTERPOOLMANAGER PROVIDER, SO IT IS ALWAYS UP
	 * TO DATE. psc.
	 */
	//public void setSystemFilterPoolManagers(SystemFilterPoolManager[] mgrs);
	/**
	 * Set the associated master pool manager provider. Note the provider
	 *  typically manages multiple pool managers and we manage references
	 *  across those.
	 */
	public void setSystemFilterPoolManagerProvider(ISystemFilterPoolManagerProvider poolMgrProvider);

	/**
	 * Get the associated master pool manager provider. Note the provider
	 *  typically manages multiple pool managers and we manage references
	 *  across those.
	 */
	public ISystemFilterPoolManagerProvider getSystemFilterPoolManagerProvider();

	/**
	 * Get the managers of the master list of filter pools, from which
	 *  objects in this list reference.
	 */
	public ISystemFilterPoolManager[] getSystemFilterPoolManagers();

	/**
	 * Get the managers of the master list of filter pools, from which
	 *  objects in this list reference, but which are not in the list of
	 *  managers our pool manager supplier gives us. That is, these are
	 *  references to filter pools outside the expected list.
	 * @return null if no unmatched managers found, else an array of such managers.
	 */
	public ISystemFilterPoolManager[] getAdditionalSystemFilterPoolManagers();

	/**
	 * Set the default manager of the master list of filter pools, from which
	 *  objects in this list reference.
	 */
	public void setDefaultSystemFilterPoolManager(ISystemFilterPoolManager mgr);

	/**
	 * Get the default manager of the master list of filter pools, from which
	 *  objects in this list reference.
	 */
	public ISystemFilterPoolManager getDefaultSystemFilterPoolManager();

	// ---------------------------------------------------
	// Methods that work on FilterPool referencing objects
	// ---------------------------------------------------
	/**
	 * Ask each referenced pool for its name, and update it.
	 * Called after the name of the pool or its manager changes.
	 */
	public void regenerateReferencedSystemFilterPoolNames();

	/**
	 * Return array of SystemFilterPoolReference objects.
	 * Result will never be null, although it may be an array of length zero.
	 */
	public ISystemFilterPoolReference[] getSystemFilterPoolReferences();

	/**
	 * In one shot, set the filter pool references
	 * <p> Calls back to inform provider
	 * @param filterPoolReferences of filter pool reference objects to set the list to.
	 * @param deReference true to first de-reference all objects in the existing list.
	 */
	public void setSystemFilterPoolReferences(ISystemFilterPoolReference[] filterPoolReferences, boolean deReference);

	/**
	 * Add a filter pool referencing object to the list.
	 * @return the new count of referencing objects
	 */
	public int addSystemFilterPoolReference(ISystemFilterPoolReference filterPoolReference);

	/**
	 * Reset the filter pool a reference points to. Called on a move-filter-pool operation
	 */
	public void resetSystemFilterPoolReference(ISystemFilterPoolReference filterPoolReference, ISystemFilterPool newPool);

	/**
	 * Remove a filter pool referencing object from the list.
	 * @param filterPoolReference the reference to remove
	 * @param deReference true if we want to dereference the referenced object (call removeReference on it)
	 * @return the new count of referencing objects
	 */
	public int removeSystemFilterPoolReference(ISystemFilterPoolReference filterPoolReference, boolean deReference);

	/**
	 * Return count of referenced filter pools
	 */
	public int getSystemFilterPoolReferenceCount();

	/**
	 * Return the zero-based position of a SystemFilterPoolReference object within this list
	 */
	public int getSystemFilterPoolReferencePosition(ISystemFilterPoolReference filterPoolRef);

	/**
	 * Move a given filter pool reference to a given zero-based location
	 * <p> Calls back to inform provider
	 */
	public void moveSystemFilterPoolReference(ISystemFilterPoolReference filterPoolRef, int pos);

	/**
	 * Move existing filter pool references a given number of positions.
	 * If the delta is negative, they are all moved up by the given amount. If
	 * positive, they are all moved down by the given amount.<p>
	 * <p> Calls back to inform provider
	 * @param filterPoolRefs Array of SystemFilterPoolReferences to move.
	 * @param delta the amount by which to move the filter pool references.
	 */
	public void moveSystemFilterPoolReferences(ISystemFilterPoolReference[] filterPoolRefs, int delta);

	// ----------------------------------------------
	// Methods that work on FilterPool master objects
	// ----------------------------------------------
	/**
	 * Return array of filter pools currently referenced by this manager
	 * Result will never be null, although it may be an array of length zero.
	 */
	public ISystemFilterPool[] getReferencedSystemFilterPools();

	/**
	 * Return true if the given filter pool has a referencing object in this list.
	 */
	public boolean isSystemFilterPoolReferenced(ISystemFilterPool filterPool);

	/**
	 * Given a filter pool, locate the referencing object for it and return it.
	 * @return the referencing object if found, else null
	 */
	public ISystemFilterPoolReference getReferenceToSystemFilterPool(ISystemFilterPool filterPool);

	/**
	 * Given a filter pool, create a referencing object and add it to the list.
	 * <p> Calls back to inform provider
	 * @return new filter pool reference
	 */
	public ISystemFilterPoolReference addReferenceToSystemFilterPool(ISystemFilterPool filterPool);

	/**
	 * Given a filter pool name, create a referencing object and add it to the list.
	 * This creates an unresolved reference to that filter pool. It will be resolved on first use.
	 * <p> Calls back to inform provider
	 * @param filterPoolName the name of the filter pool being referenced.
	 * @return new filter pool reference
	 */
	public ISystemFilterPoolReference addReferenceToSystemFilterPool(String filterPoolName);

	/**
	 * Given a filter pool, locate the referencing object for it and remove it from the list.
	 * <p> Calls back to inform provider
	 * @return the new count of referencing objects
	 */
	public int removeReferenceToSystemFilterPool(ISystemFilterPool filterPool);

	/**
	 * A reference filter pool has been renamed. Update our stored name...
	 * <p> Calls back to inform provider
	 */
	public void renameReferenceToSystemFilterPool(ISystemFilterPool pool);

	/**
	 * In one shot, set the filter pool references to new references to supplied filter pools.
	 * <p> Calls back to inform provider
	 * @param filterPools of filter pool objects to create references for
	 * @param deReference true to first de-reference all objects in the existing list.
	 */
	public void setSystemFilterPoolReferences(ISystemFilterPool[] filterPools, boolean deReference);

	// -------------------------
	// SPECIAL CASE METHODS
	// -------------------------
	/**
	 * Create a single filter refererence to a given filter. Needed when a filter
	 *  is added to a pool, and the GUI is not showing pools but rather all filters
	 *  in all pool references.
	 */
	public ISystemFilterReference getSystemFilterReference(ISubSystem subSystem, ISystemFilter filter);

	/**
	 * Concatenate all filter references from all filter pools we reference, into one
	 * big list.
	 */
	public ISystemFilterReference[] getSystemFilterReferences(ISubSystem subSystem);

	/**
	 * Given a filter reference, return its position within this reference manager
	 *  when you think of all filter references from all filter pool references as
	 *  being concatenated
	 */
	public int getSystemFilterReferencePosition(ISystemFilterReference filterRef);

	/**
	 * Given a filter, return its position within this reference manager
	 *  when you think of all filter references from all filter pool references as
	 *  being concatenated
	 */
	public int getSystemFilterReferencePosition(ISubSystem subSystem, ISystemFilter filter);

}

Back to the top