diff options
author | Mikhail Sennikovsky | 2006-08-16 15:36:39 +0000 |
---|---|---|
committer | Mikhail Sennikovsky | 2006-08-16 15:36:39 +0000 |
commit | cb6f2b49425a28f17c8ec6440e8af9b87a6b6f50 (patch) | |
tree | 787166132e630650762ca734aee16d61aa0cb688 /build | |
parent | c7c351109fe6bb686ee59c1b5e11e4234dc015af (diff) | |
download | org.eclipse.cdt-cb6f2b49425a28f17c8ec6440e8af9b87a6b6f50.tar.gz org.eclipse.cdt-cb6f2b49425a28f17c8ec6440e8af9b87a6b6f50.tar.xz org.eclipse.cdt-cb6f2b49425a28f17c8ec6440e8af9b87a6b6f50.zip |
Patch from Sunil Davasam with fixes to make the "Project unsupported.." message be displayed only when neccessary for the "C/C++ Build" property page
Diffstat (limited to 'build')
-rw-r--r-- | build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java index 1f2b17131dc..c03179619f4 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java @@ -11,8 +11,10 @@ package org.eclipse.cdt.managedbuilder.ui.properties; import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.ListIterator; import org.eclipse.cdt.managedbuilder.core.IConfiguration; import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; @@ -151,7 +153,7 @@ public class BuildPropertyPage extends AbstractBuildPropertyPage implements IWor noContent(parent,ManagedBuilderUIMessages.getResourceString("BuildPropertyPage.error.version_low")); //$NON-NLS-1$ return; } - projectTypes = ManagedBuildManager.getDefinedProjectTypes(); + projectTypes = getProjectTypes(); IProjectType defaultProjectType = info.getManagedProject().getProjectType(); // Add a config selection area @@ -228,6 +230,35 @@ public class BuildPropertyPage extends AbstractBuildPropertyPage implements IWor WorkbenchHelp.setHelp(parent, ManagedBuilderHelpContextIds.MAN_PROJ_BUILD_PROP); } + private IProjectType[] getProjectTypes() { + + IProjectType [] allProjectTypes = ManagedBuildManager.getDefinedProjectTypes(); + ArrayList types = new ArrayList(); + + // The projectTypes that has 'convertToId' attribute is used only in conversion process, + // These projectTypes should not be used during project creation or during the display of projectTypes + // to the user. So we need to filter the projectTypes based on the 'convertToId' attribute. + // Check if project type has 'convertToId' attribute. If so, then do not add it to the list. + + + for (int i = 0; i < allProjectTypes.length; i++) { + IProjectType projectType = allProjectTypes[i]; + if (!projectType.getConvertToId().equals("")) + continue; + types.add(projectType); + } + types.trimToSize(); + + IProjectType [] tmpProjectTypes = new IProjectType[types.size()]; + ListIterator iter = types.listIterator(); + int index = 0; + while (iter.hasNext()) { + tmpProjectTypes[index++] = (IProjectType) iter.next(); + } + return tmpProjectTypes; + + } + private void contentForClosedProject(Composite parent) { noContent(parent, ManagedBuilderUIMessages.getResourceString(MSG_CLOSEDPROJECT)); } |