diff --git a/core/org.eclipse.cdt.ui/icons/dlcl16/build_exec.png b/core/org.eclipse.cdt.ui/icons/dlcl16/build_exec.png
new file mode 100644
index 00000000000..b6d8adc93f5
Binary files /dev/null and b/core/org.eclipse.cdt.ui/icons/dlcl16/build_exec.png differ
diff --git a/core/org.eclipse.cdt.ui/icons/elcl16/build_exec.png b/core/org.eclipse.cdt.ui/icons/elcl16/build_exec.png
new file mode 100644
index 00000000000..c0272bb5d88
Binary files /dev/null and b/core/org.eclipse.cdt.ui/icons/elcl16/build_exec.png differ
diff --git a/core/org.eclipse.cdt.ui/plugin.properties b/core/org.eclipse.cdt.ui/plugin.properties
index 3a23b441cb1..f13b4076704 100644
--- a/core/org.eclipse.cdt.ui/plugin.properties
+++ b/core/org.eclipse.cdt.ui/plugin.properties
@@ -157,6 +157,8 @@ BuildConfigMenuAction.label=Set Active
BuildConfigContextAction.label=Set Active
BuildConfigAction.tooltip=Change active build configuration for project(s)
BuildConfigAction.tooltip2=Manage configurations for the current project
+BuildActiveConfiguration.label=Build Active Configuration
+BuildActiveConfiguration.tooltip=Build the active configurations of selected projects
ManageConfigAction.label=Manage...
DeleteRcConfigAction.label=Delete resource cfgs...
@@ -401,7 +403,7 @@ exportWizard.CDTCategory.name = C/C++
page.c.general=C/C++ General
# menu labels
-Configurations.menu=Build configurations
+Configurations.menu=Build Configurations
Index.menu=Index
CDTWizard=CDT New Project Wizard
diff --git a/core/org.eclipse.cdt.ui/plugin.xml b/core/org.eclipse.cdt.ui/plugin.xml
index 27738a58649..c3d024a129a 100644
--- a/core/org.eclipse.cdt.ui/plugin.xml
+++ b/core/org.eclipse.cdt.ui/plugin.xml
@@ -1058,8 +1058,17 @@
menubarPath="project/org.eclipse.cdt.ui.prjmenu/gm1"
style="pulldown"
tooltip="%BuildConfigAction.tooltip"/>
-
-
+ 0) {
- for (int i = 0; i < configs.length; i++) {
- if (configs[i].getName().equals(fConfigName)) {
- configs[i].setActive();
- CDTPropertyManager.performOk(null);
- AbstractPage.updateViews(prj);
- break;
- }
- }
- }
- }
+ super.run();
+ buildAction.selectionChanged(new StructuredSelection(fProjects.toArray()));
+ buildAction.run();
}
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ChangeBuildConfigActionBase.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ChangeBuildConfigActionBase.java
index 6667089b2b6..1246670f8d6 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ChangeBuildConfigActionBase.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ChangeBuildConfigActionBase.java
@@ -122,7 +122,7 @@ public class ChangeBuildConfigActionBase {
builder.append(" (...)"); //$NON-NLS-1$
}
- IAction action = new BuildConfigAction(fProjects, sName, builder.toString(), accel + 1);
+ IAction action = makeAction(sName ,builder, accel);
if (bCurrentConfig && sCurrentConfig.equals(sName)) {
action.setChecked(true);
}
@@ -133,6 +133,10 @@ public class ChangeBuildConfigActionBase {
}
}
+ protected IAction makeAction(String sName, StringBuffer builder, int accel) {
+ return new ChangeConfigAction(fProjects, sName, builder.toString(), accel + 1);
+ }
+
/**
* selectionChanged() event handler. Fills the list of managed-built projects
* based on the selection. If some non-managed-built projects are selected,
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ChangeConfigAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ChangeConfigAction.java
new file mode 100644
index 00000000000..85501d61b5b
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ChangeConfigAction.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Intel 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Intel Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.ui.actions;
+
+import java.util.HashSet;
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.action.Action;
+
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICProjectDescription;
+import org.eclipse.cdt.ui.newui.AbstractPage;
+import org.eclipse.cdt.ui.newui.CDTPropertyManager;
+
+/**
+ * Action which changes active build configuration of the current project to
+ * the given one.
+ */
+public class ChangeConfigAction extends Action {
+
+ private String fConfigName = null;
+ protected HashSet fProjects = null;
+
+ /**
+ * Constructs the action.
+ * @param projects List of selected managed-built projects
+ * @param configName Build configuration name
+ * @param accel Number to be used as accelerator
+ */
+ public ChangeConfigAction(HashSet projects, String configName, String displayName, int accel) {
+ super("&" + accel + " " + displayName); //$NON-NLS-1$ //$NON-NLS-2$
+ fProjects = projects;
+ fConfigName = configName;
+ }
+
+ /**
+ * @see org.eclipse.jface.action.IAction#run()
+ */
+ public void run() {
+ Iterator iter = fProjects.iterator();
+ while (iter.hasNext()) {
+ IProject prj = (IProject)iter.next();
+ ICProjectDescription prjd = CDTPropertyManager.getProjectDescription(prj);
+ ICConfigurationDescription[] configs = prjd.getConfigurations();
+ if (configs != null && configs.length > 0) {
+ for (int i = 0; i < configs.length; i++) {
+ if (configs[i].getName().equals(fConfigName)) {
+ configs[i].setActive();
+ CDTPropertyManager.performOk(null);
+ AbstractPage.updateViews(prj);
+ break;
+ }
+ }
+ }
+ }
+ }
+}