1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-26 18:35:32 +02:00

Fix for bug 60950 - When creating a project, wizard should let you unselect both Debug and Release configs

This commit is contained in:
Sean Evoy 2004-06-15 15:02:42 +00:00
parent 7b15edbc7f
commit 14c5c93240
3 changed files with 34 additions and 22 deletions

View file

@ -42,6 +42,7 @@ PlatformBlock.tip.platform=Select the target of the build goal
PlatformBlock.label.platform=Build Target: PlatformBlock.label.platform=Build Target:
PlatformBlock.label.configs=Configurations: PlatformBlock.label.configs=Configurations:
PlatformBlock.label.showall=Show All Targets PlatformBlock.label.showall=Show All Targets
PlatformBlock.message.error.noconfigs=You must select at least one configuration
# -- Strings for the additional options tab # -- Strings for the additional options tab
MngMakeProjectWizard.options.title=Additional Project Settings MngMakeProjectWizard.options.title=Additional Project Settings

View file

@ -903,6 +903,7 @@ public class BuildPropertyPage extends PropertyPage implements IWorkbenchPropert
// Find the configurations defined for the platform // Find the configurations defined for the platform
configurations = selectedTarget.getConfigurations(); configurations = selectedTarget.getConfigurations();
if (configurations.length == 0) return;
// Clear and replace the contents of the selector widget // Clear and replace the contents of the selector widget
configSelector.removeAll(); configSelector.removeAll();

View file

@ -44,29 +44,32 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.ui.help.WorkbenchHelp;
public class CProjectPlatformPage extends WizardPage { /**
/* * Class that implements the target and configuration selection page in the new
* Bookeeping variables * project wizard for managed builder projects.
*
* @since 1.2
*/ */
private ArrayList selectedConfigurations; public class CProjectPlatformPage extends WizardPage {
protected ITarget selectedTarget;
protected String[] targetNames;
protected ArrayList targets;
protected NewManagedProjectWizard parentWizard;
/* /*
* Dialog variables and string constants * 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 PREFIX = "PlatformBlock"; //$NON-NLS-1$
private static final String LABEL = PREFIX + ".label"; //$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 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 CONFIG_LABEL = LABEL + ".configs"; //$NON-NLS-1$
private static final String SHOWALL_LABEL = LABEL + ".showall"; //$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. * Constructor.
@ -209,6 +212,13 @@ public class CProjectPlatformPage extends WizardPage {
platformSelection.setLayoutData(gd); platformSelection.setLayoutData(gd);
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getProject()
*/
public IProject getProject() {
return ((NewCProjectWizard)getWizard()).getNewProject();
}
/** /**
* @return * @return
*/ */
@ -230,6 +240,7 @@ public class CProjectPlatformPage extends WizardPage {
// Get the selections from the table viewer // Get the selections from the table viewer
selectedConfigurations.clear(); selectedConfigurations.clear();
selectedConfigurations.addAll(Arrays.asList(tableViewer.getCheckedElements())); selectedConfigurations.addAll(Arrays.asList(tableViewer.getCheckedElements()));
setPageComplete(validatePage());
} }
/** /**
@ -320,13 +331,12 @@ public class CProjectPlatformPage extends WizardPage {
*/ */
private boolean validatePage() { private boolean validatePage() {
// TODO some validation ... maybe // TODO some validation ... maybe
if ((tableViewer.getCheckedElements()).length > 0) {
setErrorMessage(null);
return true; return true;
} } else {
setErrorMessage(ManagedBuilderUIMessages.getResourceString("PlatformBlock.message.error.noconfigs")); //$NON-NLS-1$
/* (non-Javadoc) return false;
* @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getProject() }
*/
public IProject getProject() {
return ((NewCProjectWizard)getWizard()).getNewProject();
} }
} }