mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 10:46:02 +02:00
Patch from Alex Chapiro to provide build contribution
to the CView.
This commit is contained in:
parent
0eb01b1ba1
commit
42d1154261
1 changed files with 11 additions and 2 deletions
|
@ -44,6 +44,7 @@ import org.eclipse.core.runtime.IAdaptable;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.jface.action.ActionContributionItem;
|
import org.eclipse.jface.action.ActionContributionItem;
|
||||||
|
import org.eclipse.jface.action.GroupMarker;
|
||||||
import org.eclipse.jface.action.IMenuListener;
|
import org.eclipse.jface.action.IMenuListener;
|
||||||
import org.eclipse.jface.action.IMenuManager;
|
import org.eclipse.jface.action.IMenuManager;
|
||||||
import org.eclipse.jface.action.IToolBarManager;
|
import org.eclipse.jface.action.IToolBarManager;
|
||||||
|
@ -188,6 +189,10 @@ public class CView extends ViewPart implements IMenuListener, ISetSelectionTarge
|
||||||
final String WORKING_GROUP_MARKER = "workingSetGroup";
|
final String WORKING_GROUP_MARKER = "workingSetGroup";
|
||||||
final String WORKING_GROUP_MARKER_END = "end-workingSetGroup";
|
final String WORKING_GROUP_MARKER_END = "end-workingSetGroup";
|
||||||
|
|
||||||
|
// Menu tags for the build
|
||||||
|
final String BUILD_GROUP_MARKER = "buildGroup";
|
||||||
|
final String BUILD_GROUP_MARKER_END = "end-buildGroup";
|
||||||
|
|
||||||
private IPartListener partListener = new IPartListener() {
|
private IPartListener partListener = new IPartListener() {
|
||||||
public void partActivated(IWorkbenchPart part) {
|
public void partActivated(IWorkbenchPart part) {
|
||||||
if (part instanceof IEditorPart) {
|
if (part instanceof IEditorPart) {
|
||||||
|
@ -791,8 +796,11 @@ public class CView extends ViewPart implements IMenuListener, ISetSelectionTarge
|
||||||
void addBuildMenu(IMenuManager menu, IStructuredSelection selection) {
|
void addBuildMenu(IMenuManager menu, IStructuredSelection selection) {
|
||||||
IAdaptable element = (IAdaptable)selection.getFirstElement();
|
IAdaptable element = (IAdaptable)selection.getFirstElement();
|
||||||
IResource resource = (IResource)element.getAdapter(IResource.class);
|
IResource resource = (IResource)element.getAdapter(IResource.class);
|
||||||
if (resource == null)
|
if (resource == null) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
menu.add(new GroupMarker(BUILD_GROUP_MARKER));
|
||||||
|
|
||||||
//if (resource instanceof IProject) {
|
//if (resource instanceof IProject) {
|
||||||
// Allow manual incremental build only if auto build is off.
|
// Allow manual incremental build only if auto build is off.
|
||||||
|
@ -826,6 +834,7 @@ public class CView extends ViewPart implements IMenuListener, ISetSelectionTarge
|
||||||
|
|
||||||
menu.add(makeTargetAction);
|
menu.add(makeTargetAction);
|
||||||
}
|
}
|
||||||
|
menu.add(new GroupMarker(BUILD_GROUP_MARKER_END));
|
||||||
}
|
}
|
||||||
|
|
||||||
void addRefreshMenu (IMenuManager menu, IStructuredSelection selection) {
|
void addRefreshMenu (IMenuManager menu, IStructuredSelection selection) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue