mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 01:15:29 +02:00
further fixes for 139797
This commit is contained in:
parent
6d991143ef
commit
efdd319587
3 changed files with 21 additions and 5 deletions
|
@ -150,7 +150,7 @@
|
|||
<actionSet
|
||||
id="org.eclipse.cdt.managedbuilder.ui.buildSelectedFilesActionSet"
|
||||
label="%BuildSelectedFilesActionSet.label"
|
||||
visible="true">
|
||||
visible="false">
|
||||
<action
|
||||
class="org.eclipse.cdt.managedbuilder.ui.actions.BuildFilesAction"
|
||||
enablesFor="+"
|
||||
|
@ -191,7 +191,7 @@
|
|||
</objectContribution>
|
||||
<objectContribution
|
||||
adaptable="true"
|
||||
id="org.eclipse.cdt.managedbuilder.ui.objectContribution1"
|
||||
id="org.eclipse.cdt.managedbuilder.ui.BuildSelectedFilesContribution"
|
||||
objectClass="org.eclipse.core.resources.IResource">
|
||||
<action
|
||||
class="org.eclipse.cdt.managedbuilder.ui.actions.BuildFilesAction"
|
||||
|
@ -205,12 +205,16 @@
|
|||
id="org.eclipse.cdt.managedbuilder.ui.popups.cleanFilesAction"
|
||||
label="%CleanSelectedFiles.label"
|
||||
menubarPath="additions"/>
|
||||
<filter
|
||||
name="projectNature"
|
||||
value="org.eclipse.cdt.managedbuilder.core.managedBuildNature"/>
|
||||
</objectContribution>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.perspectiveExtensions">
|
||||
<perspectiveExtension targetID="org.eclipse.cdt.ui.CPerspective">
|
||||
<actionSet id="org.eclipse.cdt.managedbuilder.ui.buildConfigActionSet"/>
|
||||
<actionSet id="org.eclipse.cdt.managedbuilder.ui.buildSelectedFilesActionSet"/>
|
||||
</perspectiveExtension>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -266,9 +266,13 @@ public class BuildFilesAction extends ActionDelegate implements IWorkbenchWindow
|
|||
ISelectionService selectionService = workbenchWindow
|
||||
.getSelectionService();
|
||||
ISelection selection = selectionService.getSelection();
|
||||
|
||||
|
||||
if (selection instanceof IStructuredSelection) {
|
||||
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
|
||||
|
||||
if(structuredSelection.size() <= 0)
|
||||
return false;
|
||||
|
||||
for (Iterator elements = structuredSelection.iterator(); elements
|
||||
.hasNext();) {
|
||||
IFile file = convertToIFile(elements.next());
|
||||
|
@ -310,9 +314,11 @@ public class BuildFilesAction extends ActionDelegate implements IWorkbenchWindow
|
|||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -278,6 +278,10 @@ public class CleanFilesAction extends ActionDelegate implements IWorkbenchWindow
|
|||
|
||||
if (selection instanceof IStructuredSelection) {
|
||||
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
|
||||
|
||||
if(structuredSelection.size() <= 0)
|
||||
return false;
|
||||
|
||||
for (Iterator elements = structuredSelection.iterator(); elements
|
||||
.hasNext();) {
|
||||
IFile file = convertToIFile(elements.next());
|
||||
|
@ -305,9 +309,11 @@ public class CleanFilesAction extends ActionDelegate implements IWorkbenchWindow
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue