1 /*******************************************************************************
2 * Copyright (c) 2007, 2008 Nokia and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Nokia - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.cdt.ui.actions;
13 import java.util.HashSet;
15 import org.eclipse.core.resources.IProject;
16 import org.eclipse.jface.viewers.StructuredSelection;
17 import org.eclipse.ui.actions.BuildAction;
20 * Action which builds the active configurations of the selected projects.
22 public class BuildConfigAction extends ChangeConfigAction {
24 private BuildAction buildAction;
27 * Constructs the action.
28 * @param projects List of selected managed-built projects
29 * @param configName Build configuration name
30 * @param accel Number to be used as accelerator
32 public BuildConfigAction(HashSet<IProject> projects, String configName, String displayName, int accel, BuildAction buildAction) {
33 super(projects, configName, displayName, accel);
34 this.buildAction = buildAction;
38 * @see org.eclipse.jface.action.IAction#run()
43 buildAction.selectionChanged(new StructuredSelection(fProjects.toArray()));