Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/ContributorBlackList.java')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/ContributorBlackList.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/ContributorBlackList.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/ContributorBlackList.java
new file mode 100644
index 000000000..599d47149
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/util/ContributorBlackList.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Tasktop Technologies 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
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.tasks.core.util;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+
+/**
+ * Manages a list of plug-in IDs that have been black listed for contributions.
+ */
+public class ContributorBlackList {
+
+ /**
+ * Plug-in ids of connector extensions that are black listed.
+ */
+ private final Set<String> disabledContributors = new HashSet<String>();
+
+ public boolean isDisabled(IConfigurationElement element) {
+ return disabledContributors.contains(element.getContributor().getName());
+ }
+
+ public Set<String> getDisabledContributors() {
+ return Collections.unmodifiableSet(new HashSet<String>(disabledContributors));
+ }
+
+ public void disableContributor(String pluginId) {
+ disabledContributors.add(pluginId);
+ }
+
+ public void merge(ContributorBlackList blackList) {
+ disabledContributors.addAll(blackList.getDisabledContributors());
+ }
+
+}

Back to the top