mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Allow override of default project name.
This commit is contained in:
parent
8f61e02fd9
commit
f76bef99d6
2 changed files with 12 additions and 13 deletions
|
@ -282,4 +282,15 @@ public abstract class AbstractImportExecutableWizard extends Wizard implements I
|
|||
return new String[] { defaultBinaryParserId };
|
||||
}
|
||||
|
||||
public String getDefaultProjectName() {
|
||||
String defaultName = new String();
|
||||
String[] executables = getImportExecutablePage()
|
||||
.getSelectedExecutables();
|
||||
if (executables.length > 0) {
|
||||
String fileName = new File(executables[0]).getName();
|
||||
defaultName = new String(Messages.ImportExecutablePageTwo_DefaultProjectPrefix + fileName);
|
||||
}
|
||||
return defaultName;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.ui.importexecutable;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
|
@ -102,7 +101,7 @@ public class ImportExecutablePageTwo extends WizardPage {
|
|||
public void checkExecutableSettings() {
|
||||
shouldUpdateButtons = false;
|
||||
if (isCreateNewProjectSelected) {
|
||||
String defaultName = getDefaultProjectName();
|
||||
String defaultName = wizard.getDefaultProjectName();
|
||||
if (defaultName.length() > 0) {
|
||||
ICProject cProject = CoreModel.getDefault().getCModel()
|
||||
.getCProject(defaultName);
|
||||
|
@ -316,17 +315,6 @@ public class ImportExecutablePageTwo extends WizardPage {
|
|||
return (ICProject[]) list.toArray(new ICProject[list.size()]);
|
||||
}
|
||||
|
||||
protected String getDefaultProjectName() {
|
||||
String defaultName = new String();
|
||||
String[] executables = wizard.getImportExecutablePage()
|
||||
.getSelectedExecutables();
|
||||
if (executables.length > 0) {
|
||||
String fileName = new File(executables[0]).getName();
|
||||
defaultName = new String(Messages.ImportExecutablePageTwo_DefaultProjectPrefix + fileName);
|
||||
}
|
||||
return defaultName;
|
||||
}
|
||||
|
||||
protected ICProject getExistingCProject() {
|
||||
String projectName = existingProjectName.getText().trim();
|
||||
if (projectName.length() < 1) {
|
||||
|
|
Loading…
Add table
Reference in a new issue