mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 292978 - New C/C++ wizard toolbar buttons are showing UI contributions that should be hidden by activities
This commit is contained in:
parent
1558c3a6e8
commit
b74f0e0b85
1 changed files with 32 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue