Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Evoy2004-06-15 15:02:42 +0000
committerSean Evoy2004-06-15 15:02:42 +0000
commit14c5c93240537e22f513b3760b0c4e8552d037d3 (patch)
treebe679cfbfaed9f43efda47e48b196576b5198695 /build/org.eclipse.cdt.managedbuilder.ui/src
parent7b15edbc7f68c528d0bb0455f17e174cc63def7f (diff)
downloadorg.eclipse.cdt-14c5c93240537e22f513b3760b0c4e8552d037d3.tar.gz
org.eclipse.cdt-14c5c93240537e22f513b3760b0c4e8552d037d3.tar.xz
org.eclipse.cdt-14c5c93240537e22f513b3760b0c4e8552d037d3.zip
Fix for bug 60950 - When creating a project, wizard should let you unselect both Debug and Release configs
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.ui/src')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java54
3 files changed, 34 insertions, 22 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
index 87006be0e5..1c6ed61f18 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
@@ -42,6 +42,7 @@ PlatformBlock.tip.platform=Select the target of the build goal
PlatformBlock.label.platform=Build Target:
PlatformBlock.label.configs=Configurations:
PlatformBlock.label.showall=Show All Targets
+PlatformBlock.message.error.noconfigs=You must select at least one configuration
# -- Strings for the additional options tab
MngMakeProjectWizard.options.title=Additional Project Settings
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 89a22839bb..f03547eeb3 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
@@ -903,6 +903,7 @@ public class BuildPropertyPage extends PropertyPage implements IWorkbenchPropert
// Find the configurations defined for the platform
configurations = selectedTarget.getConfigurations();
+ if (configurations.length == 0) return;
// Clear and replace the contents of the selector widget
configSelector.removeAll();
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
index e758c1819d..950908890d 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
@@ -44,29 +44,32 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.help.WorkbenchHelp;
+/**
+ * Class that implements the target and configuration selection page in the new
+ * project wizard for managed builder projects.
+ *
+ * @since 1.2
+ */
public class CProjectPlatformPage extends WizardPage {
/*
- * Bookeeping variables
- */
- private ArrayList selectedConfigurations;
- protected ITarget selectedTarget;
- protected String[] targetNames;
- protected ArrayList targets;
- protected NewManagedProjectWizard parentWizard;
-
- /*
* Dialog variables and string constants
*/
- protected Combo platformSelection;
- protected CheckboxTableViewer tableViewer;
- protected Button showAll;
private static final String PREFIX = "PlatformBlock"; //$NON-NLS-1$
private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$
private static final String TIP = PREFIX + ".tip"; //$NON-NLS-1$
- private static final String TARGET_TIP = TIP + ".platform"; //$NON-NLS-1$
- private static final String TARGET_LABEL = LABEL + ".platform"; //$NON-NLS-1$
private static final String CONFIG_LABEL = LABEL + ".configs"; //$NON-NLS-1$
private static final String SHOWALL_LABEL = LABEL + ".showall"; //$NON-NLS-1$
+ private static final String TARGET_LABEL = LABEL + ".platform"; //$NON-NLS-1$
+ private static final String TARGET_TIP = TIP + ".platform"; //$NON-NLS-1$
+
+ protected NewManagedProjectWizard parentWizard;
+ protected Combo platformSelection;
+ private ArrayList selectedConfigurations;
+ protected ITarget selectedTarget;
+ protected Button showAll;
+ protected CheckboxTableViewer tableViewer;
+ protected String[] targetNames;
+ protected ArrayList targets;
/**
* Constructor.
@@ -208,6 +211,13 @@ public class CProjectPlatformPage extends WizardPage {
gd.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH + 50;
platformSelection.setLayoutData(gd);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getProject()
+ */
+ public IProject getProject() {
+ return ((NewCProjectWizard)getWizard()).getNewProject();
+ }
/**
* @return
@@ -230,6 +240,7 @@ public class CProjectPlatformPage extends WizardPage {
// Get the selections from the table viewer
selectedConfigurations.clear();
selectedConfigurations.addAll(Arrays.asList(tableViewer.getCheckedElements()));
+ setPageComplete(validatePage());
}
/**
@@ -320,13 +331,12 @@ public class CProjectPlatformPage extends WizardPage {
*/
private boolean validatePage() {
// TODO some validation ... maybe
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getProject()
- */
- public IProject getProject() {
- return ((NewCProjectWizard)getWizard()).getNewProject();
+ if ((tableViewer.getCheckedElements()).length > 0) {
+ setErrorMessage(null);
+ return true;
+ } else {
+ setErrorMessage(ManagedBuilderUIMessages.getResourceString("PlatformBlock.message.error.noconfigs")); //$NON-NLS-1$
+ return false;
+ }
}
}

Back to the top