mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 250625 - NPE in AbstractFileCreationWizardPage
This commit is contained in:
parent
11972439bb
commit
10b2bb8da5
1 changed files with 17 additions and 15 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2007 QNX Software Systems and others.
|
* Copyright (c) 2004, 2008 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
|
||||||
|
@ -241,22 +241,24 @@ public abstract class AbstractFileCreationWizardPage extends NewElementWizardPag
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateTemplates() {
|
protected void updateTemplates() {
|
||||||
Template selected= getSelectedTemplate();
|
if (fTemplateDialogField != null) {
|
||||||
String name = selected != null ?
|
Template selected= getSelectedTemplate();
|
||||||
selected.getName() :
|
String name = selected != null ?
|
||||||
getLastUsedTemplateName();
|
selected.getName() :
|
||||||
fTemplates= getApplicableTemplates();
|
getLastUsedTemplateName();
|
||||||
int idx= NO_TEMPLATE.equals(name) ? 0 : 1;
|
fTemplates= getApplicableTemplates();
|
||||||
String[] names= new String[fTemplates.length + 1];
|
int idx= NO_TEMPLATE.equals(name) ? 0 : 1;
|
||||||
for (int i = 0; i < fTemplates.length; i++) {
|
String[] names= new String[fTemplates.length + 1];
|
||||||
names[i + 1]= fTemplates[i].getName();
|
for (int i = 0; i < fTemplates.length; i++) {
|
||||||
if (name != null && name.equals(names[i + 1])) {
|
names[i + 1]= fTemplates[i].getName();
|
||||||
idx= i + 1;
|
if (name != null && name.equals(names[i + 1])) {
|
||||||
|
idx= i + 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
names[0]= NewFileWizardMessages.AbstractFileCreationWizardPage_noTemplate;
|
||||||
|
fTemplateDialogField.setItems(names);
|
||||||
|
fTemplateDialogField.selectItem(idx);
|
||||||
}
|
}
|
||||||
names[0]= NewFileWizardMessages.AbstractFileCreationWizardPage_noTemplate;
|
|
||||||
fTemplateDialogField.setItems(names);
|
|
||||||
fTemplateDialogField.selectItem(idx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue