001: /*
002: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
003: */
004: package org.terracotta.dso;
005:
006: import org.eclipse.core.commands.common.EventManager;
007: import org.eclipse.core.resources.IProject;
008:
009: public class ConfigurationEventManager extends EventManager {
010: void addConfigurationListener(IConfigurationListener listener) {
011: addListenerObject(listener);
012: }
013:
014: void removeConfigurationListener(IConfigurationListener listener) {
015: removeListenerObject(listener);
016: }
017:
018: void fireConfigurationChange(IProject project) {
019: Object[] listeners = getListeners();
020: if (listeners != null) {
021: for (int i = 0; i < listeners.length; i++) {
022: ((IConfigurationListener) listeners[i])
023: .configurationChanged(project);
024: }
025: }
026: }
027:
028: void fireRootChanged(IProject project, int index) {
029: Object[] listeners = getListeners();
030: if (listeners != null) {
031: for (int i = 0; i < listeners.length; i++) {
032: ((IConfigurationListener) listeners[i]).rootChanged(
033: project, index);
034: }
035: }
036: }
037:
038: void fireRootsChanged(IProject project) {
039: Object[] listeners = getListeners();
040: if (listeners != null) {
041: for (int i = 0; i < listeners.length; i++) {
042: ((IConfigurationListener) listeners[i])
043: .rootsChanged(project);
044: }
045: }
046: }
047:
048: void fireServerChanged(IProject project, int index) {
049: Object[] listeners = getListeners();
050: if (listeners != null) {
051: for (int i = 0; i < listeners.length; i++) {
052: ((IConfigurationListener) listeners[i]).serverChanged(
053: project, index);
054: }
055: }
056: }
057:
058: void fireServersChanged(IProject project) {
059: Object[] listeners = getListeners();
060: if (listeners != null) {
061: for (int i = 0; i < listeners.length; i++) {
062: ((IConfigurationListener) listeners[i])
063: .serversChanged(project);
064: }
065: }
066: }
067:
068: public void fireDistributedMethodsChanged(IProject project) {
069: Object[] listeners = getListeners();
070: if (listeners != null) {
071: for (int i = 0; i < listeners.length; i++) {
072: ((IConfigurationListener) listeners[i])
073: .distributedMethodsChanged(project);
074: }
075: }
076: }
077:
078: public void fireDistributedMethodChanged(IProject project, int index) {
079: Object[] listeners = getListeners();
080: if (listeners != null) {
081: for (int i = 0; i < listeners.length; i++) {
082: ((IConfigurationListener) listeners[i])
083: .distributedMethodChanged(project, index);
084: }
085: }
086: }
087:
088: public void fireBootClassesChanged(IProject project) {
089: Object[] listeners = getListeners();
090: if (listeners != null) {
091: for (int i = 0; i < listeners.length; i++) {
092: ((IConfigurationListener) listeners[i])
093: .bootClassesChanged(project);
094: }
095: }
096: }
097:
098: public void fireBootClassChanged(IProject project, int index) {
099: Object[] listeners = getListeners();
100: if (listeners != null) {
101: for (int i = 0; i < listeners.length; i++) {
102: ((IConfigurationListener) listeners[i])
103: .bootClassChanged(project, index);
104: }
105: }
106: }
107:
108: public void fireTransientFieldsChanged(IProject project) {
109: Object[] listeners = getListeners();
110: if (listeners != null) {
111: for (int i = 0; i < listeners.length; i++) {
112: ((IConfigurationListener) listeners[i])
113: .transientFieldsChanged(project);
114: }
115: }
116: }
117:
118: public void fireTransientFieldChanged(IProject project, int index) {
119: Object[] listeners = getListeners();
120: if (listeners != null) {
121: for (int i = 0; i < listeners.length; i++) {
122: ((IConfigurationListener) listeners[i])
123: .transientFieldChanged(project, index);
124: }
125: }
126: }
127:
128: public void fireNamedLockChanged(IProject project, int index) {
129: Object[] listeners = getListeners();
130: if (listeners != null) {
131: for (int i = 0; i < listeners.length; i++) {
132: ((IConfigurationListener) listeners[i])
133: .namedLockChanged(project, index);
134: }
135: }
136: }
137:
138: public void fireNamedLocksChanged(IProject project) {
139: Object[] listeners = getListeners();
140: if (listeners != null) {
141: for (int i = 0; i < listeners.length; i++) {
142: ((IConfigurationListener) listeners[i])
143: .namedLocksChanged(project);
144: }
145: }
146: }
147:
148: public void fireAutolockChanged(IProject project, int index) {
149: Object[] listeners = getListeners();
150: if (listeners != null) {
151: for (int i = 0; i < listeners.length; i++) {
152: ((IConfigurationListener) listeners[i])
153: .autolockChanged(project, index);
154: }
155: }
156: }
157:
158: public void fireAutolocksChanged(IProject project) {
159: Object[] listeners = getListeners();
160: if (listeners != null) {
161: for (int i = 0; i < listeners.length; i++) {
162: ((IConfigurationListener) listeners[i])
163: .autolocksChanged(project);
164: }
165: }
166: }
167:
168: public void fireIncludeRuleChanged(IProject project, int index) {
169: Object[] listeners = getListeners();
170: if (listeners != null) {
171: for (int i = 0; i < listeners.length; i++) {
172: ((IConfigurationListener) listeners[i])
173: .includeRuleChanged(project, index);
174: }
175: }
176: }
177:
178: public void fireIncludeRulesChanged(IProject project) {
179: Object[] listeners = getListeners();
180: if (listeners != null) {
181: for (int i = 0; i < listeners.length; i++) {
182: ((IConfigurationListener) listeners[i])
183: .includeRulesChanged(project);
184: }
185: }
186: }
187:
188: public void fireExcludeRuleChanged(IProject project, int index) {
189: Object[] listeners = getListeners();
190: if (listeners != null) {
191: for (int i = 0; i < listeners.length; i++) {
192: ((IConfigurationListener) listeners[i])
193: .excludeRuleChanged(project, index);
194: }
195: }
196: }
197:
198: public void fireExcludeRulesChanged(IProject project) {
199: Object[] listeners = getListeners();
200: if (listeners != null) {
201: for (int i = 0; i < listeners.length; i++) {
202: ((IConfigurationListener) listeners[i])
203: .excludeRulesChanged(project);
204: }
205: }
206: }
207:
208: public void fireInstrumentationRulesChanged(IProject project) {
209: Object[] listeners = getListeners();
210: if (listeners != null) {
211: for (int i = 0; i < listeners.length; i++) {
212: ((IConfigurationListener) listeners[i])
213: .instrumentationRulesChanged(project);
214: }
215: }
216: }
217:
218: public void fireClientChanged(IProject project) {
219: Object[] listeners = getListeners();
220: if (listeners != null) {
221: for (int i = 0; i < listeners.length; i++) {
222: ((IConfigurationListener) listeners[i])
223: .clientChanged(project);
224: }
225: }
226: }
227:
228: public void fireModuleReposChanged(IProject project) {
229: Object[] listeners = getListeners();
230: if (listeners != null) {
231: for (int i = 0; i < listeners.length; i++) {
232: ((IConfigurationListener) listeners[i])
233: .moduleReposChanged(project);
234: }
235: }
236: }
237:
238: public void fireModuleRepoChanged(IProject project, int index) {
239: Object[] listeners = getListeners();
240: if (listeners != null) {
241: for (int i = 0; i < listeners.length; i++) {
242: ((IConfigurationListener) listeners[i])
243: .moduleRepoChanged(project, index);
244: }
245: }
246: }
247:
248: public void fireModuleChanged(IProject project, int index) {
249: Object[] listeners = getListeners();
250: if (listeners != null) {
251: for (int i = 0; i < listeners.length; i++) {
252: ((IConfigurationListener) listeners[i]).moduleChanged(
253: project, index);
254: }
255: }
256: }
257:
258: public void fireModulesChanged(IProject project) {
259: Object[] listeners = getListeners();
260: if (listeners != null) {
261: for (int i = 0; i < listeners.length; i++) {
262: ((IConfigurationListener) listeners[i])
263: .modulesChanged(project);
264: }
265: }
266: }
267: }
|