1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 01:15:29 +02:00

Patch for bug 178305 by Ravi Sankar

This commit is contained in:
Vivian Kong 2007-03-27 16:49:44 +00:00
parent d171f334bc
commit dc8208f660
2 changed files with 32 additions and 5 deletions

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2006 QNX Software Systems and others.
* Copyright (c) 2004, 2007 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -7,6 +7,7 @@
*
* Contributors:
* QNX Software Systems - initial API and implementation
* IBM Corporation
*******************************************************************************/
package org.eclipse.cdt.internal.ui.wizards.filewizard;
@ -78,6 +79,13 @@ public abstract class AbstractFileCreationWizardPage extends NewElementWizardPag
private IStatus fNewFileStatus;
private final IStatus STATUS_OK = new StatusInfo();
/**
* This flag isFirstTime is used to keep a note
* that the file creation wizard has just been
* created.
*/
private boolean isFirstTime = false;
public AbstractFileCreationWizardPage(String name) {
super(name);
@ -94,6 +102,9 @@ public abstract class AbstractFileCreationWizardPage extends NewElementWizardPag
fSourceFolderStatus = STATUS_OK;
fNewFileStatus = STATUS_OK;
fLastFocusedField = 0;
isFirstTime = true;
}
// -------- UI Creation ---------
@ -415,7 +426,11 @@ public abstract class AbstractFileCreationWizardPage extends NewElementWizardPag
fSourceFolderStatus = sourceFolderChanged();
}
if (fieldChanged(fields, NEW_FILE_ID)) {
fNewFileStatus = fileNameChanged();
if( isFirstTime ){
isFirstTime = false;
return;
}
fNewFileStatus = fileNameChanged();
}
doStatusUpdate();
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2006 QNX Software Systems and others.
* Copyright (c) 2004, 2007 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -138,7 +138,13 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
protected IFile fCreatedSourceFile = null;
protected IFile fCreatedHeaderFile = null;
protected ICElement fCreatedClass = null;
/**
* This flag isFirstTime is used to keep a note
* that the class creation wizard has just been
* created.
*/
private boolean isFirstTime = false;
/**
* the default method stubs
*/
@ -203,7 +209,9 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
fHeaderFileStatus = STATUS_OK;
fSourceFileStatus = STATUS_OK;
fLastFocusedField = 0;
isFirstTime = true;
updateNamespaceEnableState();
updateFileGroupEnableState();
}
@ -1335,6 +1343,10 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
fNamespaceStatus = namespaceChanged();
}
if (fieldChanged(fields, CLASS_NAME_ID)) {
if( isFirstTime ) {
isFirstTime = false;
return;
}
fClassNameStatus = classNameChanged();
}
if (fieldChanged(fields, BASE_CLASSES_ID)) {