mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 01:06:01 +02:00
added workbench build/rebuild to content menu
This commit is contained in:
parent
b7c0c7a977
commit
433976a043
2 changed files with 27 additions and 8 deletions
|
@ -1,3 +1,8 @@
|
|||
2003-09-18 David Inglis
|
||||
Add workbench build/rebuild in context menu.
|
||||
|
||||
* src/org/eclipse/cdt/internal/ui/cview/CView.java
|
||||
|
||||
2003-09-16 Alain Magloire
|
||||
|
||||
Work to the new BinaryParserBlock to add dynamic UI
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.eclipse.cdt.internal.ui.util.ProblemTreeViewer;
|
|||
import org.eclipse.cdt.ui.CElementContentProvider;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.cdt.ui.PreferenceConstants;
|
||||
import org.eclipse.core.resources.ICommand;
|
||||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
|
@ -42,6 +43,7 @@ import org.eclipse.core.resources.IResource;
|
|||
import org.eclipse.core.resources.IResourceChangeEvent;
|
||||
import org.eclipse.core.resources.IWorkspace;
|
||||
import org.eclipse.core.resources.IncrementalProjectBuilder;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
|
@ -134,8 +136,6 @@ public class CView extends ViewPart implements IMenuListener, ISetSelectionTarge
|
|||
|
||||
// Actions for Menu context.
|
||||
AddBookmarkAction addBookmarkAction;
|
||||
//BuildAction buildAction;
|
||||
//BuildAction rebuildAction;
|
||||
CopyResourceAction copyResourceAction;
|
||||
DeleteResourceAction deleteResourceAction;
|
||||
OpenFileAction openFileAction;
|
||||
|
@ -816,15 +816,29 @@ public class CView extends ViewPart implements IMenuListener, ISetSelectionTarge
|
|||
}
|
||||
|
||||
menu.add(new GroupMarker(BUILD_GROUP_MARKER));
|
||||
if (resource instanceof IProject && hasBuilder((IProject) resource)) {
|
||||
buildAction.selectionChanged(selection);
|
||||
menu.add(buildAction);
|
||||
rebuildAction.selectionChanged(selection);
|
||||
menu.add(rebuildAction);
|
||||
}
|
||||
|
||||
//if (resource instanceof IProject) {
|
||||
// Allow manual incremental build only if auto build is off.
|
||||
//if (!ResourcesPlugin.getWorkspace().isAutoBuilding()) {
|
||||
//menu.add(buildAction);
|
||||
//}
|
||||
//}
|
||||
menu.add(new GroupMarker(BUILD_GROUP_MARKER_END));
|
||||
}
|
||||
|
||||
boolean hasBuilder(IProject project) {
|
||||
try {
|
||||
ICommand[] commands = project.getDescription().getBuildSpec();
|
||||
if (commands.length > 0)
|
||||
return true;
|
||||
}
|
||||
catch (CoreException e) {
|
||||
// Cannot determine if project has builders. Project is closed
|
||||
// or does not exist. Fall through to return false.
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void addRefreshMenu (IMenuManager menu, IStructuredSelection selection) {
|
||||
menu.add(refreshAction);
|
||||
|
|
Loading…
Add table
Reference in a new issue