mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug #190042 : Configuration icons disabled when Includes folder selected
This commit is contained in:
parent
11b35857bf
commit
9964787e29
2 changed files with 31 additions and 1 deletions
|
@ -29,6 +29,9 @@ import org.eclipse.cdt.core.model.ICProject;
|
|||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.cview.IncludeRefContainer;
|
||||
import org.eclipse.cdt.internal.ui.cview.IncludeReferenceProxy;
|
||||
|
||||
/**
|
||||
* Base class for build configuration actions.
|
||||
*/
|
||||
|
@ -161,6 +164,17 @@ public class ChangeBuildConfigActionBase {
|
|||
}
|
||||
else if (selItem instanceof IResource) {
|
||||
project = ((IResource)selItem).getProject();
|
||||
} else if (selItem instanceof IncludeRefContainer) {
|
||||
ICProject fCProject = ((IncludeRefContainer)selItem).getCProject();
|
||||
if (fCProject != null)
|
||||
project = fCProject.getProject();
|
||||
} else if (selItem instanceof IncludeReferenceProxy) {
|
||||
IncludeRefContainer irc = ((IncludeReferenceProxy)selItem).getIncludeRefContainer();
|
||||
if (irc != null) {
|
||||
ICProject fCProject = irc.getCProject();
|
||||
if (fCProject != null)
|
||||
project = fCProject.getProject();
|
||||
}
|
||||
}
|
||||
// Check whether the project is CDT project
|
||||
if (project != null) {
|
||||
|
|
|
@ -23,6 +23,10 @@ import org.eclipse.core.runtime.Platform;
|
|||
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.cview.IncludeRefContainer;
|
||||
import org.eclipse.cdt.internal.ui.cview.IncludeReferenceProxy;
|
||||
|
||||
/**
|
||||
* This class provides static methods to work with multiple
|
||||
|
@ -79,6 +83,18 @@ public class ManageConfigSelector {
|
|||
prj = ((ICElement)obs[i]).getCProject().getProject();
|
||||
} else if (obs[i] instanceof IResource) { // for other views
|
||||
prj = ((IResource)obs[i]).getProject();
|
||||
/* get project from Include folder elements */
|
||||
} else if (obs[i] instanceof IncludeRefContainer) {
|
||||
ICProject fCProject = ((IncludeRefContainer)obs[i]).getCProject();
|
||||
if (fCProject != null)
|
||||
prj = fCProject.getProject();
|
||||
} else if (obs[i] instanceof IncludeReferenceProxy) {
|
||||
IncludeRefContainer irc = ((IncludeReferenceProxy)obs[i]).getIncludeRefContainer();
|
||||
if (irc != null) {
|
||||
ICProject fCProject = irc.getCProject();
|
||||
if (fCProject != null)
|
||||
prj = fCProject.getProject();
|
||||
}
|
||||
}
|
||||
|
||||
if (prj == null || lst.contains(prj) ||
|
||||
|
|
Loading…
Add table
Reference in a new issue