Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVivian Kong2009-10-22 03:29:15 +0000
committerVivian Kong2009-10-22 03:29:15 +0000
commita2db5a0fa588083f9e4fcdf10ee5b56c55c6b32f (patch)
tree74fb540183d9db9acff8d111cf7158a356ac3684
parent2ec86a8ca0b94491903c9323610c86a0b0ed9640 (diff)
downloadorg.eclipse.cdt-a2db5a0fa588083f9e4fcdf10ee5b56c55c6b32f.tar.gz
org.eclipse.cdt-a2db5a0fa588083f9e4fcdf10ee5b56c55c6b32f.tar.xz
org.eclipse.cdt-a2db5a0fa588083f9e4fcdf10ee5b56c55c6b32f.zip
Bug 292978 - New C/C++ wizard toolbar buttons are showing UI contributions that should be hidden by activities
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/CWizardRegistry.java40
1 files changed, 32 insertions, 8 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/CWizardRegistry.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/CWizardRegistry.java
index 62e7eaedbca..044674935e1 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/CWizardRegistry.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/CWizardRegistry.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2005 QNX Software Systems and others.
+ * Copyright (c) 2004, 2009 QNX Software Systems 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
@@ -7,6 +7,7 @@
*
* Contributors:
* QNX Software Systems - initial API and implementation
+ * IBM Corporation
*******************************************************************************/
package org.eclipse.cdt.internal.ui.wizards;
@@ -17,7 +18,9 @@ import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.action.IAction;
+import org.eclipse.ui.IPluginContribution;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.activities.WorkbenchActivityHelper;
import org.eclipse.cdt.ui.CUIPlugin;
@@ -373,6 +376,25 @@ public class CWizardRegistry {
return actionList.toArray(new IAction[actionList.size()]);
}
+
+ private static class WizardConfig implements IPluginContribution {
+
+ private IConfigurationElement fElement;
+
+ public WizardConfig(IConfigurationElement element) {
+ fElement = element;
+ }
+
+ public String getLocalId() {
+ return fElement.getAttribute("id"); //$NON-NLS-1$
+ }
+
+ public String getPluginId() {
+ return fElement.getContributor().getName();
+ }
+
+ }
+
/**
* Returns extension data for all the C/C++ wizards contributed to the workbench.
@@ -394,13 +416,15 @@ public class CWizardRegistry {
if (extensionPoint != null) {
IConfigurationElement[] elements = extensionPoint.getConfigurationElements();
for (IConfigurationElement element : elements) {
- if (element.getName().equals(TAG_WIZARD)) {
- String category = element.getAttribute(ATT_CATEGORY);
- if (category != null &&
- (category.equals(CUIPlugin.CCWIZARD_CATEGORY_ID)
- || category.equals(CUIPlugin.CWIZARD_CATEGORY_ID))) {
- elemList.add(element);
- }
+ if (element.getName().equals(TAG_WIZARD)) {
+ if (!WorkbenchActivityHelper.filterItem(new WizardConfig(element))) {
+ String category = element.getAttribute(ATT_CATEGORY);
+ if (category != null &&
+ (category.equals(CUIPlugin.CCWIZARD_CATEGORY_ID)
+ || category.equals(CUIPlugin.CWIZARD_CATEGORY_ID))) {
+ elemList.add(element);
+ }
+ }
}
}
}

Back to the top