mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
CProjectWizardPage constructor takes CProjectWizard argument
validatePage calls isValidName().
This commit is contained in:
parent
16f27bb89f
commit
40e68a1ff3
1 changed files with 10 additions and 1 deletions
|
@ -60,6 +60,7 @@ public class CProjectWizardPage extends WizardPage {
|
|||
protected Text locationPathField;
|
||||
protected Label locationLabel;
|
||||
protected Button browseButton;
|
||||
protected CProjectWizard wizard;
|
||||
|
||||
private Listener nameModifyListener = new Listener() {
|
||||
public void handleEvent(Event e) {
|
||||
|
@ -271,10 +272,11 @@ public class CProjectWizardPage extends WizardPage {
|
|||
*
|
||||
* @param pageName the name of this page
|
||||
*/
|
||||
public CProjectWizardPage(String pageName) {
|
||||
public CProjectWizardPage(CProjectWizard wizard, String pageName) {
|
||||
super(pageName);
|
||||
setPageComplete(false);
|
||||
this.initialLocationFieldValue = Platform.getLocation();
|
||||
this.wizard = wizard;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -304,6 +306,13 @@ public class CProjectWizardPage extends WizardPage {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Give a chance to the wizard to do its own validation
|
||||
IStatus validName = wizard.isValidName(projectFieldContents);
|
||||
if (!validName.isOK()) {
|
||||
setErrorMessage(validName.getMessage());
|
||||
return false;
|
||||
}
|
||||
|
||||
IStatus nameStatus =
|
||||
workspace.validateName(projectFieldContents, IResource.PROJECT);
|
||||
if (!nameStatus.isOK()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue