diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/BuildGroup.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/BuildGroup.java index f57270681b9..10292583978 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/BuildGroup.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/BuildGroup.java @@ -33,7 +33,8 @@ import org.eclipse.ui.ide.IDEActionFactory; public class BuildGroup extends CViewActionGroup { private BuildAction buildAction; - private BuildAction rebuildAction; +// private BuildAction rebuildAction; + private BuildAction cleanAction; // Menu tags for the build final String BUILD_GROUP_MARKER = "buildGroup"; //$NON-NLS-1$ @@ -45,7 +46,7 @@ public class BuildGroup extends CViewActionGroup { public void fillActionBars(IActionBars actionBars) { actionBars.setGlobalActionHandler(IDEActionFactory.BUILD_PROJECT.getId(), buildAction); - actionBars.setGlobalActionHandler(IDEActionFactory.REBUILD_PROJECT.getId(), rebuildAction); +// actionBars.setGlobalActionHandler(IDEActionFactory.REBUILD_PROJECT.getId(), rebuildAction); } /** @@ -99,15 +100,14 @@ public class BuildGroup extends CViewActionGroup { hasBuilder = false; } } - // Allow manual incremental build only if auto build is off. - //if (!selection.isEmpty() && isProjectSelection - // && !ResourcesPlugin.getWorkspace().isAutoBuilding() - // && hasBuilder) { + if (!selection.isEmpty() && isProjectSelection && hasBuilder) { buildAction.selectionChanged(selection); menu.add(buildAction); - rebuildAction.selectionChanged(selection); - menu.add(rebuildAction); +// rebuildAction.selectionChanged(selection); +// menu.add(rebuildAction); + cleanAction.selectionChanged(selection); + menu.add(cleanAction); } menu.add(new GroupMarker(BUILD_GROUP_MARKER_END)); } @@ -137,13 +137,27 @@ public class BuildGroup extends CViewActionGroup { protected void makeActions() { Shell shell = getCView().getSite().getShell(); + + // when the managed builder can handle a full build we should change this to use FULL BUILD + // the incremental build allows the eclipse plaftorm to decide that the CDT builder does not + // need to be called. FULL_BUILD will always call our builders and WE can decide what to do. buildAction = new BuildAction(shell, IncrementalProjectBuilder.INCREMENTAL_BUILD); - rebuildAction = new BuildAction(shell, IncrementalProjectBuilder.FULL_BUILD); +// buildAction = new BuildAction(shell, IncrementalProjectBuilder.FULL_BUILD); + buildAction.setText(CViewMessages.getString("BuildAction.label")); //$NON-NLS-1$ + + cleanAction = new BuildAction(shell, IncrementalProjectBuilder.CLEAN_BUILD); + cleanAction.setText(CViewMessages.getString("CleanAction.label")); //$NON-NLS-1$ + + // I need to figure out how to override the action on the rebuild. Currently this is all implemented + // as the default action. I would like to do both CLEAN_BUILD followed by INCREMENTAL_BUILD + // oddly enough if it is not INCREMENTAL_BUILD the strings are maped to "rebuild" in the contructor of BuildAction +// rebuildAction = new BuildAction(shell, IncrementalProjectBuilder.FULL_BUILD); +// rebuildAction.setText(CViewMessages.getString("RebuildAction.label")); //$NON-NLS-1$ } public void updateActionBars() { IStructuredSelection selection = (IStructuredSelection) getContext().getSelection(); buildAction.selectionChanged(selection); - rebuildAction.selectionChanged(selection); +// rebuildAction.selectionChanged(selection); } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMessages.properties index 2005bf4c29d..795a6ac496c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMessages.properties +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMessages.properties @@ -14,6 +14,7 @@ OpenWithMenu.label=Open Wit&h BuildAction.label=&Build Project RebuildAction.label=Rebuild Pro&ject +CleanAction.label=Clean Project CollapseAllAction.label=Collapse All CollapseAllAction.tooltip=Collapse All