mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 21:35:40 +02:00
Patch for bug 178305 by Ravi Sankar
This commit is contained in:
parent
d171f334bc
commit
dc8208f660
2 changed files with 32 additions and 5 deletions
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX Software Systems - initial API and implementation
|
* QNX Software Systems - initial API and implementation
|
||||||
|
* IBM Corporation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui.wizards.filewizard;
|
package org.eclipse.cdt.internal.ui.wizards.filewizard;
|
||||||
|
|
||||||
|
@ -78,6 +79,13 @@ public abstract class AbstractFileCreationWizardPage extends NewElementWizardPag
|
||||||
private IStatus fNewFileStatus;
|
private IStatus fNewFileStatus;
|
||||||
private final IStatus STATUS_OK = new StatusInfo();
|
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) {
|
public AbstractFileCreationWizardPage(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
|
|
||||||
|
@ -94,6 +102,9 @@ public abstract class AbstractFileCreationWizardPage extends NewElementWizardPag
|
||||||
fSourceFolderStatus = STATUS_OK;
|
fSourceFolderStatus = STATUS_OK;
|
||||||
fNewFileStatus = STATUS_OK;
|
fNewFileStatus = STATUS_OK;
|
||||||
fLastFocusedField = 0;
|
fLastFocusedField = 0;
|
||||||
|
|
||||||
|
isFirstTime = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------- UI Creation ---------
|
// -------- UI Creation ---------
|
||||||
|
@ -415,7 +426,11 @@ public abstract class AbstractFileCreationWizardPage extends NewElementWizardPag
|
||||||
fSourceFolderStatus = sourceFolderChanged();
|
fSourceFolderStatus = sourceFolderChanged();
|
||||||
}
|
}
|
||||||
if (fieldChanged(fields, NEW_FILE_ID)) {
|
if (fieldChanged(fields, NEW_FILE_ID)) {
|
||||||
fNewFileStatus = fileNameChanged();
|
if( isFirstTime ){
|
||||||
|
isFirstTime = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fNewFileStatus = fileNameChanged();
|
||||||
}
|
}
|
||||||
doStatusUpdate();
|
doStatusUpdate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -138,7 +138,13 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
protected IFile fCreatedSourceFile = null;
|
protected IFile fCreatedSourceFile = null;
|
||||||
protected IFile fCreatedHeaderFile = null;
|
protected IFile fCreatedHeaderFile = null;
|
||||||
protected ICElement fCreatedClass = 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
|
* the default method stubs
|
||||||
*/
|
*/
|
||||||
|
@ -203,7 +209,9 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
fHeaderFileStatus = STATUS_OK;
|
fHeaderFileStatus = STATUS_OK;
|
||||||
fSourceFileStatus = STATUS_OK;
|
fSourceFileStatus = STATUS_OK;
|
||||||
fLastFocusedField = 0;
|
fLastFocusedField = 0;
|
||||||
|
|
||||||
|
isFirstTime = true;
|
||||||
|
|
||||||
updateNamespaceEnableState();
|
updateNamespaceEnableState();
|
||||||
updateFileGroupEnableState();
|
updateFileGroupEnableState();
|
||||||
}
|
}
|
||||||
|
@ -1335,6 +1343,10 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
fNamespaceStatus = namespaceChanged();
|
fNamespaceStatus = namespaceChanged();
|
||||||
}
|
}
|
||||||
if (fieldChanged(fields, CLASS_NAME_ID)) {
|
if (fieldChanged(fields, CLASS_NAME_ID)) {
|
||||||
|
if( isFirstTime ) {
|
||||||
|
isFirstTime = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
fClassNameStatus = classNameChanged();
|
fClassNameStatus = classNameChanged();
|
||||||
}
|
}
|
||||||
if (fieldChanged(fields, BASE_CLASSES_ID)) {
|
if (fieldChanged(fields, BASE_CLASSES_ID)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue