summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDean Roberts2011-10-17 11:46:40 (EDT)
committer Remy Suen2011-10-17 12:04:41 (EDT)
commit9f8dc9cf07e6066ef6570e8b4afbefac494da803 (patch)
tree0760a5b4f477b92da74e20e4c39496b5d57ad853
parent5d8b16f21e275659ac22ab97d76cdbdf637f6fac (diff)
downloadeclipse.platform.ui-9f8dc9cf07e6066ef6570e8b4afbefac494da803.zip
eclipse.platform.ui-9f8dc9cf07e6066ef6570e8b4afbefac494da803.tar.gz
eclipse.platform.ui-9f8dc9cf07e6066ef6570e8b4afbefac494da803.tar.bz2
Bug 361127 AbstractActivityManager does not manage listeners properlyv20111017-1604
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityManager.java23
1 files changed, 10 insertions, 13 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityManager.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityManager.java
index cbee560..f7ef9b4 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityManager.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -11,15 +11,13 @@
package org.eclipse.ui.internal.activities;
-import java.util.ArrayList;
-import java.util.List;
-
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.ui.activities.ActivityManagerEvent;
import org.eclipse.ui.activities.IActivityManager;
import org.eclipse.ui.activities.IActivityManagerListener;
public abstract class AbstractActivityManager implements IActivityManager {
- private List activityManagerListeners;
+ private ListenerList activityManagerListeners;
protected AbstractActivityManager() {
}
@@ -31,12 +29,10 @@ public abstract class AbstractActivityManager implements IActivityManager {
}
if (activityManagerListeners == null) {
- activityManagerListeners = new ArrayList();
+ activityManagerListeners = new ListenerList();
}
- if (!activityManagerListeners.contains(activityManagerListener)) {
- activityManagerListeners.add(activityManagerListener);
- }
+ activityManagerListeners.add(activityManagerListener);
}
protected void fireActivityManagerChanged(
@@ -45,10 +41,11 @@ public abstract class AbstractActivityManager implements IActivityManager {
throw new NullPointerException();
}
- if (activityManagerListeners != null) {
- for (int i = 0; i < activityManagerListeners.size(); i++) {
- ((IActivityManagerListener) activityManagerListeners.get(i))
- .activityManagerChanged(activityManagerEvent);
+ if (activityManagerListeners != null) {
+ Object[] listeners = activityManagerListeners.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ ((IActivityManagerListener) listeners[i])
+ .activityManagerChanged(activityManagerEvent);
}
}
}